diff options
author | Jörg Mayer <jmayer@loplof.de> | 2009-08-07 18:49:24 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2009-08-07 18:49:24 +0000 |
commit | b6cffe405019da8259413cfcb829339712a098a7 (patch) | |
tree | b6ed74fa34c5e2c15b24a5b53396dd9be211540a /acinclude.m4 | |
parent | 952cbd7902acda684fc2c6c06e17d54af5ecb225 (diff) | |
download | wireshark-b6cffe405019da8259413cfcb829339712a098a7.tar.gz wireshark-b6cffe405019da8259413cfcb829339712a098a7.tar.bz2 wireshark-b6cffe405019da8259413cfcb829339712a098a7.zip |
- Add an AC macro to test linker flags.
- Test whether the linker supports --as-needed and if so,
adds it to LDFLAGS
svn path=/trunk/; revision=29327
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 9709c8bc39..489cd81ecc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1642,6 +1642,36 @@ AC_DEFUN([AC_WIRESHARK_GEOIP_CHECK], fi ]) +#AC_WIRESHARK_GCC_LDFLAGS_CHECK +# +# $1 : ldflag(s) to test +# +# The macro first determines if the compiler is GCC. Then compile with the +# defined ldflags. The defined flags are added to LDFLAGS only if the +# compilation succeeds. +# +AC_DEFUN([AC_WIRESHARK_GCC_LDFLAGS_CHECK], +[GCC_OPTION="$1" +AC_MSG_CHECKING(whether we can add $GCC_OPTION to LDFLAGS) +if test "x$GCC" != "x"; then + LDFLAGS_saved="$CFLAGS" + LDFLAGS="$LDFLAGS $GCC_OPTION" + AC_LINK_IFELSE([ + AC_LANG_SOURCE([[ + main() { return; } + ]])], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + LDFLAGS="$LDFLAGS_saved" + ]) +else + AC_MSG_RESULT(no) +fi +]) + # # AC_WIRESHARK_GCC_CFLAGS_CHECK # |