From: Monty Taylor Date: Mon, 15 Jun 2009 23:20:43 +0000 (+0000) Subject: Further merging from libdrizzle and gearman. X-Git-Tag: 0.31~14^2~7^2~1^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c2271fbcf6d030fb28efa645b39ccbdd0048cc7a;p=m6w6%2Flibmemcached Further merging from libdrizzle and gearman. --- diff --git a/configure.ac b/configure.ac index 80b63da7..81602f82 100644 --- a/configure.ac +++ b/configure.ac @@ -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 +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 + ]],[[ +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 -#include - ]],[[ -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_], diff --git a/m4/64bit.m4 b/m4/64bit.m4 index 377636e6..eeecf520 100644 --- a/m4/64bit.m4 +++ b/m4/64bit.m4 @@ -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 ---------------------------------------------------------------------------