From: Monty Taylor Date: Thu, 16 Jul 2009 02:28:54 +0000 (-0700) Subject: pandora-build v0.20 X-Git-Tag: 0.32~14^2~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=43bada17af8d073a79a8a44c836d1fa011f52ef8;p=m6w6%2Flibmemcached pandora-build v0.20 Turned off inllargeuse warning in sun studio --- diff --git a/m4/pandora_canonical.m4 b/m4/pandora_canonical.m4 index fc77522f..65e1d128 100644 --- a/m4/pandora_canonical.m4 +++ b/m4/pandora_canonical.m4 @@ -4,7 +4,7 @@ dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Which version of the canonical setup we're using -AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.13]) +AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.20]) AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[ dnl Force dependency tracking on for Sun Studio builds @@ -70,7 +70,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ m4_if(PCT_FORCE_GCC42, [yes], [ AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION) ]) - + + AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) + AC_CHECK_DECL([__ICC], [INTELCC="yes"], [INTELCC="no"]) + AS_IF([test "x$INTELCC" = "xyes"], [enable_rpath=no]) PANDORA_LIBTOOL @@ -97,15 +100,10 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ AC_C_CONST AC_C_INLINE AC_C_VOLATILE + AC_C_RESTRICT AC_HEADER_TIME AC_TYPE_SIZE_T - AC_FUNC_MALLOC - AC_FUNC_REALLOC - - - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) - AC_SYS_LARGEFILE @@ -127,6 +125,9 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ PANDORA_ENABLE_DTRACE + AC_LIB_PREFIX + PANDORA_HAVE_BETTER_MALLOC + AC_CHECK_PROGS([DOXYGEN], [doxygen]) AC_CHECK_PROGS([PERL], [perl]) diff --git a/m4/pandora_optimize.m4 b/m4/pandora_optimize.m4 index f38d9bb5..17b636bf 100644 --- a/m4/pandora_optimize.m4 +++ b/m4/pandora_optimize.m4 @@ -6,7 +6,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([PANDORA_OPTIMIZE],[ dnl Build optimized or debug version ? dnl First check for gcc and g++ - AS_IF([test "$GCC" = "yes"],[ + AS_IF([test "$GCC" = "yes" -a "$INTELCC" = "no"],[ dnl The following is required for portable results of floating point dnl calculations on PowerPC. The same must also be done for IA-64, but @@ -30,6 +30,20 @@ AC_DEFUN([PANDORA_OPTIMIZE],[ OPTIMIZE_CFLAGS="-O3" OPTIMIZE_CXXFLAGS="-O3" ]) + AS_IF([test "$INTELCC" = "yes"],[ + dnl Once we can use a modern autoconf, we can replace the std=gnu99 here + dnl with using AC_CC_STD_C99 above + CC="${CC} -std=c99" + + AM_CPPFLAGS="-g ${AM_CPPFLAGS}" + + DEBUG_CFLAGS="-O0" + DEBUG_CXXFLAGS="-O0" + + OPTIMIZE_CFLAGS="-xHOST -O3 -no-prec-div -static" + OPTIMIZE_CXXFLAGS="${OPTIMIZE_CFLAGS}" + + ]) AS_IF([test "$SUNCC" = "yes"],[ dnl Once we can use a modern autoconf, we can replace the -xc99=all here dnl with using AC_CC_STD_C99 above diff --git a/m4/pandora_warnings.m4 b/m4/pandora_warnings.m4 index 81795a5c..46d752ea 100644 --- a/m4/pandora_warnings.m4 +++ b/m4/pandora_warnings.m4 @@ -127,78 +127,88 @@ uint16_t x= htons(80); NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing" NO_SHADOW="-Wno-shadow" - m4_if(PW_LESS_WARNINGS,[no],[ - BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing" - CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings" - CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast" + AS_IF([test "$INTELCC" = "yes"],[ + m4_if(PW_LESS_WARNINGS,[no],[ + BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual" + ],[ + BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981" + ]) + CC_WARNINGS="${BASE_WARNINGS}" + CXX_WARNINGS="${BASE_WARNINGS}" ],[ - BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}" - ]) + m4_if(PW_LESS_WARNINGS,[no],[ + BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing" + CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings" + CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast" + ],[ + BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}" + ]) - AS_IF([test "${ac_cv_assert}" = "no"], - [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"]) - - BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}" - CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}" - CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}" - - AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++], - [ac_cv_safe_to_use_Wmissing_declarations_], - [AC_LANG_PUSH(C++) - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}" - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM( - [[ -#include - ]], [[]]) - ], - [ac_cv_safe_to_use_Wmissing_declarations_=yes], - [ac_cv_safe_to_use_Wmissing_declarations_=no]) - CXXFLAGS="$save_CXXFLAGS" - AC_LANG_POP() - ]) - AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"], - [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"]) + AS_IF([test "${ac_cv_assert}" = "no"], + [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"]) + + BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}" + CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}" + CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}" - AC_CACHE_CHECK([whether it is safe to use -Wlogical-op], - [ac_cv_safe_to_use_Wlogical_op_], - [save_CFLAGS="$CFLAGS" - CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}" - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM( - [[ + AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++], + [ac_cv_safe_to_use_Wmissing_declarations_], + [AC_LANG_PUSH(C++) + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [[ #include - ]], [[]]) - ], - [ac_cv_safe_to_use_Wlogical_op_=yes], - [ac_cv_safe_to_use_Wlogical_op_=no]) - CFLAGS="$save_CFLAGS"]) - AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"], - [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"]) - - AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++], - [ac_cv_safe_to_use_Wredundant_decls_], - [AC_LANG_PUSH(C++) - save_CXXFLAGS="${CXXFLAGS}" - CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([ + ]], [[]]) + ], + [ac_cv_safe_to_use_Wmissing_declarations_=yes], + [ac_cv_safe_to_use_Wmissing_declarations_=no]) + CXXFLAGS="$save_CXXFLAGS" + AC_LANG_POP() + ]) + AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"], + [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"]) + + AC_CACHE_CHECK([whether it is safe to use -Wlogical-op], + [ac_cv_safe_to_use_Wlogical_op_], + [save_CFLAGS="$CFLAGS" + CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [[ +#include + ]], [[]]) + ], + [ac_cv_safe_to_use_Wlogical_op_=yes], + [ac_cv_safe_to_use_Wlogical_op_=no]) + CFLAGS="$save_CFLAGS"]) + AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"], + [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"]) + + AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++], + [ac_cv_safe_to_use_Wredundant_decls_], + [AC_LANG_PUSH(C++) + save_CXXFLAGS="${CXXFLAGS}" + CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ template struct C { void foo(); }; template void C::foo() { } template <> void C::foo(); - AC_INCLUDES_DEFAULT])], - [ac_cv_safe_to_use_Wredundant_decls_=yes], - [ac_cv_safe_to_use_Wredundant_decls_=no]) - CXXFLAGS="${save_CXXFLAGS}" - AC_LANG_POP()]) - AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"], - [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"], - [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"]) - - NO_REDUNDANT_DECLS="-Wno-redundant-decls" - PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow" - + AC_INCLUDES_DEFAULT])], + [ac_cv_safe_to_use_Wredundant_decls_=yes], + [ac_cv_safe_to_use_Wredundant_decls_=no]) + CXXFLAGS="${save_CXXFLAGS}" + AC_LANG_POP()]) + AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"], + [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"], + [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"]) + + NO_REDUNDANT_DECLS="-Wno-redundant-decls" + PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow" + + ]) ]) AS_IF([test "$SUNCC" = "yes"],[ @@ -229,6 +239,7 @@ template <> void C::foo(); m4_if(PW_LESS_WARNINGS, [no],[ CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}" + CXX_WARNINGS_FULL="-erroff=inllargeuse" ],[ CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR" CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"