Oh, dear, autoconf thinks clang is GCC, because it defines __GNUC__.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 20 Apr 2011 09:31:47 +0000 (09:31 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 20 Apr 2011 09:31:47 +0000 (09:31 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36733 f5534014-38df-0310-8fa8-9805f1628bb7

configure.in

index af25cb94a1280e91c3d074e1d0fe45b0090a23b3..342cd10ff008e1ae750033b3e3c553bf9a0ad3d6 100644 (file)
@@ -438,8 +438,23 @@ if test "x$GCC" = "xyes" ; then
                #
                # See comments above about Apple's lovely C compiler.
                #
-               CFLAGS="-no-cpp-precomp $CFLAGS"
-               AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
+               # NOTE: to AC_PROG_CC, "GCC" means "any compiler that
+               # defines __GNUC__"; clang defines __GNUC__, so that
+               # means we think clang is GCC.
+               #
+               # clang whines about -no-cpp-precomp being unused
+               # so we check whether this is really clang, and
+               # only add -no-cpp-precomp if it's not.
+               #
+               if test "x$CC" != "xclang" ; then
+                       CFLAGS="-no-cpp-precomp $CFLAGS"
+                       AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
+               else
+                       #
+                       # Clang, clang, clang went the trolley....
+                       #
+                       AC_MSG_RESULT(none needed)
+               fi
                ;;
        *)
                AC_MSG_RESULT(none needed)
@@ -471,9 +486,13 @@ else
                # GCC derivative, and it whines if you pass it
                # -no-cpp-precomp.
                #
+               # XXX - is there any version of autoconf we support
+               # where it uses another way to decide if the compiler
+               # is GCC or not?
+               #
                if test "x$CC" != "xclang" ; then
                        CFLAGS="-no-cpp-precomp $CFLAGS"
-                       AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
+                       AC_MSG_RESULT(Apple CC - added -no-cpp-precomp)
                else
                        #
                        # Clang, clang, clang went the trolley....