diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-20 08:37:45 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-20 08:37:45 +0000 |
commit | aaa2afdae25573c41f50b095c54e2977f7911f84 (patch) | |
tree | 013bd258cc3cc2e4729cfb7f6ef0477eeeb1dbc9 /acinclude.m4 | |
parent | cf98e3558154f97da9943f1cc9fa5136a6f623f8 (diff) |
Instead of having GCC and CLANG variables, just have
ac_supports_gcc_flags and ac_supports_W_linker_passthrough flags, the
first of which, for now, we set for GCC and clang, and the latter of
which we set for GCC, clang, and xlc (probably true for some other
compilers as well).
Rename AC_WIRESHARK_GCC_LDFLAGS_CHECK to AC_WIRESHARK_LDFLAGS_CHECK, as
it's not checking for anything GCC-specific. (Leave
AC_WIRESHARK_GCC_CFLAGS_CHECK unrenamed for now, as the flags we test
with it are originally GCC flags that clang also supports for GCC
compatibility.)
Fix some string-equality tests to use = rather than ==; the former is
what the test/[ command uses.
Don't turn on "-no-cpp-precomp" for clang - it whines if you do.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36731 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 67eb67d937..f296be9e47 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1681,20 +1681,19 @@ AC_DEFUN([AC_WIRESHARK_GEOIP_CHECK], fi ]) -#AC_WIRESHARK_GCC_LDFLAGS_CHECK +#AC_WIRESHARK_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. +# The macro first determines if the compiler supports "-Wl,{option}" to +# pass options through to the linker. Then it attempts to compile with +# the defined ldflags. The defined flags are added to LDFLAGS only if +# the compilation succeeds. # -# XXX - clang as well? -# -AC_DEFUN([AC_WIRESHARK_GCC_LDFLAGS_CHECK], +AC_DEFUN([AC_WIRESHARK_LDFLAGS_CHECK], [GCC_OPTION="$1" AC_MSG_CHECKING(whether we can add $GCC_OPTION to LDFLAGS) -if test "x$GCC" != "x"; then +if test "x$ac_supports_W_linker_passthrough" = "xyes"; then LDFLAGS_saved="$CFLAGS" LDFLAGS="$LDFLAGS $GCC_OPTION" AC_LINK_IFELSE([ @@ -1718,14 +1717,17 @@ fi # # $1 : cflags to test # -# The macro first determines if the compiler is GCC or clang. Then compile with -# the defined cflags. The defined flags are added to CFLAGS only if the -# compilation succeeds. +# The macro first determines if the compiler supports GCC-style flags. +# Then it attempts to compile with the defined cflags. The defined +# flags are added to CFLAGS only if the compilation succeeds. +# +# We do this because not all such options are necessarily supported by +# the version of the particular compiler we're using. # AC_DEFUN([AC_WIRESHARK_GCC_CFLAGS_CHECK], [GCC_OPTION="$1" AC_MSG_CHECKING(whether we can add $GCC_OPTION to CFLAGS) -if test "x$GCC" != "x" -o "x$CLANG" != "x" ; then +if test "x$ac_supports_gcc_flags" = "xyes" ; then CFLAGS_saved="$CFLAGS" CFLAGS="$CFLAGS $GCC_OPTION" AC_COMPILE_IFELSE([ @@ -1779,7 +1781,7 @@ AC_DEFUN([AC_WIRESHARK_OSX_INTEGRATION_CHECK], GTK_LIBS="$GTK_LIBS -ligemacintegration" ]) - if test x$have_ige_mac == x + if test x$have_ige_mac = x then # # Not found - check for the old integration functions in @@ -1796,7 +1798,7 @@ AC_DEFUN([AC_WIRESHARK_OSX_INTEGRATION_CHECK], ]) fi - if test x$have_ige_mac == x + if test x$have_ige_mac = x then # # Not found - check for the old integration functions in |