diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-07-01 12:46:38 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-07-01 19:47:07 +0000 |
commit | aa0f80981a34ce4361e97748a51b483d083cd8ea (patch) | |
tree | bc71ecec4cc786ccdbe406630d1fedc7349be23f /acinclude.m4 | |
parent | b378f725453526883d087b5e57165dd7dee13c67 (diff) |
Don't check for -Wl,{option} support.
Not all AC_WIRESHARK_LDFLAGS_CHECK flags are -Wl,{option} flags, so
don't check for that first. If we want to check for specific compilers
and linkers, we should do that, not for -Wl,{option} support.
Change-Id: Ib9581d4a1573a1ffa2493ce08e6d5845d2601352
Reviewed-on: https://code.wireshark.org/review/2755
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 66615b354a..52e5b967f9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1553,35 +1553,25 @@ AC_DEFUN([AC_WIRESHARK_GEOIP_CHECK], # # $1 : ldflag(s) to test # -# If we've determined that the compiler supports "-Wl,{option}" to -# pass options through to the linker, we use that to attempt to -# compile with the defined ldflags. The defined flags are added to -# LDFLAGS only if the compilation succeeds. -# -# XXX - not all flags passed to AC_WIRESHARK_LDFLAGS_CHECK are -# -Wl,{option} flags; should we just try the flag without bothering -# to check whether -Wl,{option} is supported? +# We attempt to compile and link a test program with the specified linker +# flag. The defined flag is added to LDFLAGS only if the link succeeds. # AC_DEFUN([AC_WIRESHARK_LDFLAGS_CHECK], -[GCC_OPTION="$1" -AC_MSG_CHECKING(whether we can add $GCC_OPTION to LDFLAGS) -if test "x$ac_supports_W_linker_passthrough" = "xyes"; then - LDFLAGS_saved="$LDFLAGS" - 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 +[LD_OPTION="$1" +AC_MSG_CHECKING(whether we can add $LD_OPTION to LDFLAGS) +LDFLAGS_saved="$LDFLAGS" +LDFLAGS="$LDFLAGS $LD_OPTION" +AC_LINK_IFELSE( + [ + AC_LANG_SOURCE([[main() { return; }]]) + ], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + LDFLAGS="$LDFLAGS_saved" + ]) ]) dnl |