X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=bab25016a1162ecadf3e965a083d37594ac179d5;hp=1d93b2e4f20e2930b10018d3eab5e551b92ccdd7;hb=404db1de90f6e5a66c34077b38b18a39c955ece2;hpb=e94db26c5c7250c82cc2e2445fbb58cdb41847de 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}