From 6b9a717c26229accc6d871b3c7d77cb34d5a68ac Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 30 Oct 2010 13:20:33 -0700 Subject: configure: Add a check for the -Wl,--as-needed flag. This fits with our general build philosophy of checking at configure time for desired support, (rather than putting platform-specific conditionals into our Makefiles). --- configure | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 1d93b2e4..bab25016 100755 --- a/configure +++ b/configure @@ -402,6 +402,16 @@ else rpath_ldflags="" fi +printf "Checking for -Wl,--as-needed... " +if ${CC} -Wl,--as-needed -o minimal minimal.c >/dev/null 2>&1 +then + printf "Yes.\n" + as_needed_ldflags="-Wl,--as-needed" +else + printf "No (nothing to worry about).\n" + as_needed_ldflags="" +fi + WARN_CXXFLAGS="" printf "Checking for available C++ compiler warning flags... " for flag in -Wall -Wextra -Wwrite-strings -Wswitch-enum; do @@ -535,6 +545,9 @@ TALLOC_LDFLAGS = ${talloc_ldflags} # Flags needed to have linker set rpath attribute RPATH_LDFLAGS = ${rpath_ldflags} +# Flags needed to have linker link only to necessary libraries +AS_NEEDED_LDFLAGS = ${as_needed_ldflags} + # Whether valgrind header files are available HAVE_VALGRIND = ${have_valgrind} -- cgit v1.2.3