Further merging from libdrizzle and gearman.
authorMonty Taylor <mordred@inaugust.com>
Mon, 15 Jun 2009 23:20:43 +0000 (23:20 +0000)
committerMonty Taylor <mordred@inaugust.com>
Mon, 15 Jun 2009 23:20:43 +0000 (23:20 +0000)
configure.ac
m4/64bit.m4

index 80b63da746e0950d84af55d5db3bef3e2e0c5a44..81602f828161db903d76a8a2a0481b040df78ca3 100644 (file)
@@ -116,7 +116,7 @@ then
    OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -xstrconst"
 fi
 
-SOLARIS_64BIT
+ENABLE_64BIT
 
 #--------------------------------------------------------------------
 # Check for libpthread
@@ -207,6 +207,63 @@ W_STRICT_ALIASING="-Wno-strict-aliasing"
 if test "$GCC" = "yes"
 then
 
+  AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
+    [ac_cv_safe_to_use_fdiagnostics_show_option_],
+    [save_CFLAGS="$CFLAGS"
+     CFLAGS="-fdiagnostics-show-option ${CFLAGS}"
+     AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([],[])],
+       [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
+       [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
+     CFLAGS="$save_CFLAGS"])
+
+  AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
+        [
+          F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
+        ])
+
+
+  AC_CACHE_CHECK([whether it is safe to use -Wconversion],
+    [ac_cv_safe_to_use_wconversion_],
+    [save_CFLAGS="$CFLAGS"
+     CFLAGS="-Werror -Wconversion ${CFLAGS}"
+     AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[
+#include <stdbool.h>
+void foo(bool a)
+{
+  (void)a;
+}
+       ]],[[
+foo(0);
+       ]])],
+       [ac_cv_safe_to_use_wconversion_=yes],
+       [ac_cv_safe_to_use_wconversion_=no])
+     CFLAGS="$save_CFLAGS"])
+  AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
+    [W_CONVERSION="-Wconversion"
+    AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
+      [ac_cv_safe_to_use_Wconversion_],
+      [save_CFLAGS="$CFLAGS"
+       CFLAGS="-Werror -Wconversion ${CFLAGS}"
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+           [[
+#include <netinet/in.h>
+           ]],[[
+uint16_t x= htons(80);
+           ]])],
+         [ac_cv_safe_to_use_Wconversion_=yes],
+         [ac_cv_safe_to_use_Wconversion_=no])
+       CFLAGS="$save_CFLAGS"])
+
+    AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
+          [
+            NO_CONVERSION="-Wno-conversion"
+          ])
+    ])
+
+  W_STRICT_ALIASING="-Wno-strict-aliasing"
 
   AS_IF([test "$ac_profiling" = "yes"],
         [CC_PROFILING="-pg"])
@@ -217,31 +274,10 @@ then
   AS_IF([test "$building_from_bzr" = "yes"],
         [W_FAIL="-Werror"])
 
-  BASE_WARNINGS="-pedantic -W -Wall -Wextra ${W_FAIL} -Wundef  -Wshadow -Wmissing-declarations ${W_STRICT_ALIASING} -fdiagnostics-show-option" 
+  BASE_WARNINGS="-pedantic -W -Wall -Wextra ${W_FAIL} -Wundef -Wshadow -Wmissing-declarations ${W_STRICT_ALIASING} ${F_DIAGNOSTICS_SHOW_OPTION} ${W_CONVERSION}"
   CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wswitch-default -Wswitch-enum -Wcast-align -Wconversion"
   CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual  -Wnon-virtual-dtor -Wctor-dtor-privacy  -Wold-style-cast -Weffc++ -Wno-long-long -Wconversion"
 
-  AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
-    [ac_cv_safe_to_use_Wconversion_],
-    [save_CFLAGS="$CFLAGS"
-     CFLAGS="-Wconversion -Werror ${CFLAGS}"
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-         [[
-#include <arpa/inet.h>
-#include <netinet/in.h>
-         ]],[[
-uint16_t x= htons(80);
-         ]])],
-       [ac_cv_safe_to_use_Wconversion_=yes],
-       [ac_cv_safe_to_use_Wconversion_=no])
-     CFLAGS="$save_CFLAGS"])
-
-  AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
-        [
-          NO_CONVERSION="-Wno-conversion"
-        ])
-
 
   AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
     [ac_cv_safe_to_use_Wlogical_op_],
index 377636e658340207657f4581764eee75d239323a..eeecf520576672e26d3ee0e214e25a668fc05d8a 100644 (file)
@@ -1,22 +1,21 @@
 dnl ---------------------------------------------------------------------------
-dnl Macro: SOLARIS_64BIT
+dnl Macro: ENABLE_64BIT
 dnl ---------------------------------------------------------------------------
-AC_DEFUN([SOLARIS_64BIT],[
-AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
-if test "x$ISAINFO" != "xno"
-then
-   isainfo_b=`${ISAINFO} -b` 
-   spro_common_flags="-mt"
-   if test "x$isainfo_b" = "x64"
-   then
-      AC_ARG_ENABLE([64bit],
-         [AS_HELP_STRING([--disable-64bit],
-            [Build 64 bit binary @<:@default=on@:>@])],
-         [ac_enable_64bit="$enableval"],
-         [ac_enable_64bit="yes"])
+AC_DEFUN([ENABLE_64BIT],[
 
-      if test "x$ac_enable_64bit" = "xyes"
-      then
+  AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
+  AS_IF([test "x$ISAINFO" != "xno"],
+        [isainfo_b=`${ISAINFO} -b`],
+        [isainfo_b="x"])
+
+  AS_IF([test "$isainfo_b" != "x"],
+        [AC_ARG_ENABLE([64bit],
+             [AS_HELP_STRING([--disable-64bit],
+                [Build 64 bit binary @<:@default=on@:>@])],
+             [ac_enable_64bit="$enableval"],
+             [ac_enable_64bit="yes"])])
+
+  AS_IF([test "x$ac_enable_64bit" = "xyes"],[
          if test "x$libdir" = "x\${exec_prefix}/lib" ; then
            # The user hasn't overridden the default libdir, so we'll 
            # the dir suffix to match solaris 32/64-bit policy
@@ -30,10 +29,8 @@ then
             CFLAGS="-xmemalign=8s $CFLAGS"
             CXXFLAGS="-xmemalign=8s $CXXFLAGS"
          fi
-      fi
-   fi
-fi
+       ])
 ])
 dnl ---------------------------------------------------------------------------
-dnl End Macro: 64BIT
+dnl End Macro: ENABLE_64BIT
 dnl ---------------------------------------------------------------------------