X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=m4%2Fpandora_optimize.m4;h=dcee0648e4bce1d094a8bffd3763593e8f14cfb0;hb=200c86aa00265dbc1c6ae8dfe4fb5d77480e4dbe;hp=c255f2586abcd2b17b8402e717db866d60f64307;hpb=ba35cd77a343901f61e4fc5279328b571e51604e;p=m6w6%2Flibmemcached diff --git a/m4/pandora_optimize.m4 b/m4/pandora_optimize.m4 index c255f258..dcee0648 100644 --- a/m4/pandora_optimize.m4 +++ b/m4/pandora_optimize.m4 @@ -1,14 +1,12 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems +dnl Copyright (C) 2009 Sun Microsystems, Inc. +dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, 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"],[ - - AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux]) + 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 @@ -20,17 +18,23 @@ AC_DEFUN([PANDORA_OPTIMIZE],[ ;; esac - 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=gnu99" + AM_CPPFLAGS="-ggdb ${AM_CPPFLAGS}" - AM_CPPFLAGS="-ggdb3 ${AM_CPPFLAGS}" + DEBUG_CFLAGS="-O0" + DEBUG_CXXFLAGS="-O0" + + OPTIMIZE_CFLAGS="-O2" + OPTIMIZE_CXXFLAGS="-O2" + ]) + AS_IF([test "$INTELCC" = "yes"],[ + AM_CPPFLAGS="-g ${AM_CPPFLAGS}" DEBUG_CFLAGS="-O0" DEBUG_CXXFLAGS="-O0" - OPTIMIZE_CFLAGS="-O3" - OPTIMIZE_CXXFLAGS="-O3" + OPTIMIZE_CFLAGS="-xHOST -O2 -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 @@ -39,12 +43,15 @@ AC_DEFUN([PANDORA_OPTIMIZE],[ CXX="${CXX} -xlang=c99" AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}" - AM_CXXFLAGS="-g -mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}" + AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -library=Crun -template=no%extdef ${AM_CXXFLAGS}" + + DEBUG_CXXFLAGS="-g" dnl TODO: Make a test for -xO4 usability here OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend -xbuiltin" OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS}" - OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}" + OPTIMIZE_CXXFLAGS="-g0 ${OPTIMIZE_FLAGS}" + ]) AC_ARG_WITH([debug], @@ -56,9 +63,11 @@ AC_DEFUN([PANDORA_OPTIMIZE],[ # Debugging. No optimization. AM_CFLAGS="${AM_CFLAGS} ${DEBUG_CFLAGS} -DDEBUG" AM_CXXFLAGS="${AM_CXXFLAGS} ${DEBUG_CXXFLAGS} -DDEBUG" + AC_DEFINE(DEBUG, [ 1 ], [Define to 1 to enable debugging code.]) ],[ # Optimized version. No debug AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}" AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}" + AC_DEFINE(DEBUG, [ 0 ], [Define to 1 to enable debugging code.]) ]) ])