By being more consistant in applying CFLAGS and LDFLAGS (in
particular) to every invocation, we make it simpler to enable gcov
code coverage, both in the build system and on the build farm.
Andrew Bartlett
(This used to be commit
8c2f658a9688f0c51d2f3b948dc3213b65c7b77f)
NCALRPCDIR = $(localstatedir)/ncalrpc
BNLD = $(LD)
NCALRPCDIR = $(localstatedir)/ncalrpc
BNLD = $(LD)
+BNLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
-HOSTLD_FLAGS = $(LDFLAGS)
+HOSTLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
AC_SUBST(BLDSHARED)
AC_SUBST(LD)
AC_SUBST(BLDSHARED)
AC_SUBST(LD)
AC_SUBST(LDFLAGS)
# Assume non-shared by default and override below
AC_SUBST(LDFLAGS)
# Assume non-shared by default and override below
case "$host_os" in
*linux*)
BLDSHARED="true"
case "$host_os" in
*linux*)
BLDSHARED="true"
- LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ SYS_LDFLAGS="-Wl,--export-dynamic"
;;
*solaris*)
BLDSHARED="true"
if test "${GCC}" = "yes"; then
if test "${ac_cv_prog_gnu_ld}" = "yes"; then
;;
*solaris*)
BLDSHARED="true"
if test "${GCC}" = "yes"; then
if test "${ac_cv_prog_gnu_ld}" = "yes"; then
- LDFLAGS="$LDFLAGS -Wl,-E"
;;
*netbsd* | *freebsd* | *dragonfly* )
BLDSHARED="true"
;;
*netbsd* | *freebsd* | *dragonfly* )
BLDSHARED="true"
- LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ SYS_LDFLAGS="-Wl,--export-dynamic"
;;
*openbsd*)
BLDSHARED="true"
;;
*openbsd*)
BLDSHARED="true"
- LDFLAGS="$LDFLAGS -Wl,-Bdynamic"
+ SYS_LDFLAGS="-Wl,-Bdynamic"
;;
*irix*)
BLDSHARED="true"
;;
*aix*)
BLDSHARED="true"
;;
*irix*)
BLDSHARED="true"
;;
*aix*)
BLDSHARED="true"
- LDFLAGS="$LDFLAGS -Wl,-brtl,-bexpall,-bbigtoc"
+ SYS_LDFLAGS="-Wl,-brtl,-bexpall,-bbigtoc"
;;
*hpux*)
# Use special PIC flags for the native HP-UX compiler.
BLDSHARED="true" # I hope this is correct
if test "$host_cpu" = "ia64"; then
;;
*hpux*)
# Use special PIC flags for the native HP-UX compiler.
BLDSHARED="true" # I hope this is correct
if test "$host_cpu" = "ia64"; then
- LDFLAGS="$LDFLAGS -Wl,-E,+b/usr/local/lib/hpux32:/usr/lib/hpux32"
+ SYS_LDFLAGS="-Wl,-E,+b/usr/local/lib/hpux32:/usr/lib/hpux32"
- LDFLAGS="$LDFLAGS -Wl,-E,+b/usr/local/lib:/usr/lib"
+ SYS_LDFLAGS="-Wl,-E,+b/usr/local/lib:/usr/lib"
AC_MSG_RESULT([$LD])
AC_MSG_CHECKING([LDFLAGS])
AC_MSG_RESULT([$LDFLAGS])
AC_MSG_RESULT([$LD])
AC_MSG_CHECKING([LDFLAGS])
AC_MSG_RESULT([$LDFLAGS])
+AC_MSG_CHECKING([SYS_LDFLAGS])
+AC_MSG_RESULT([$SYS_LDFLAGS])
$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST) $init_obj
\@echo Linking \$\@
\@mkdir -p $ctx->{SHAREDDIR}
$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST) $init_obj
\@echo Linking \$\@
\@mkdir -p $ctx->{SHAREDDIR}
- \@\$(MDLD) \$(MDLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
+ \@\$(MDLD) \$(LDFLAGS) \$(MDLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
\$($ctx->{NAME}\_FULL_OBJ_LIST) $init_obj \\
\$($ctx->{NAME}_LINK_FLAGS)
__EOD__
\$($ctx->{NAME}\_FULL_OBJ_LIST) $init_obj \\
\$($ctx->{NAME}_LINK_FLAGS)
__EOD__
$ctx->{RESULT_SHARED_LIBRARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST)
\@echo Linking \$\@
\@mkdir -p $ctx->{SHAREDDIR}
$ctx->{RESULT_SHARED_LIBRARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST)
\@echo Linking \$\@
\@mkdir -p $ctx->{SHAREDDIR}
- \@\$(SHLD) \$(SHLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
+ \@\$(SHLD) \$(LDFLAGS) \$(SHLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
\$($ctx->{NAME}\_FULL_OBJ_LIST) \\
\$($ctx->{NAME}_LINK_FLAGS) \\
$soarg$lns
\$($ctx->{NAME}\_FULL_OBJ_LIST) \\
\$($ctx->{NAME}_LINK_FLAGS) \\
$soarg$lns
# End BINARY locktest
#################################
# End BINARY locktest
#################################
-GCOV_FLAGS = --coverage
-
COV_TARGET = test
COV_VARS = \
COV_TARGET = test
COV_VARS = \
- CFLAGS="$(CFLAGS) $(GCOV_FLAGS)" \
- BNLD_FLAGS="$(BNLD_FLAGS) $(GCOV_FLAGS)" \
- SHLD_FLAGS="$(SHLD_FLAGS) $(GCOV_FLAGS)" \
- MDLD_FLAGS="$(MDLD_FLAGS) $(GCOV_FLAGS)" \
- HOSTCC_FLAGS="$(HOSTCC_FLAGS) $(GCOV_FLAGS)" \
- HOSTLD_FLAGS="$(HOSTLD_FLAGS) $(GCOV_FLAGS)"
+ CFLAGS="$(CFLAGS) --coverage" \
+ LDFLAGS="$(LDFLAGS) --coverage"
test_cov:
-$(MAKE) $(COV_TARGET) $(COV_VARS)
test_cov:
-$(MAKE) $(COV_TARGET) $(COV_VARS)