*** pgsql/configure.in 2003/10/22 04:16:39 1.297 --- pgsql/configure.in 2003/10/25 15:32:11 1.298 *************** *** 1,5 **** dnl Process this file with autoconf to produce a configure script. ! dnl $Header: /projects/cvsroot/pgsql/configure.in,v 1.297 2003/10/22 04:16:39 pgsql Exp $ dnl dnl Developers, please strive to achieve this order: dnl --- 1,5 ---- dnl Process this file with autoconf to produce a configure script. ! dnl $Header: /projects/cvsroot/pgsql/configure.in,v 1.298 2003/10/25 15:32:11 petere Exp $ dnl dnl Developers, please strive to achieve this order: dnl *************** AC_SUBST(enable_rpath) *** 203,209 **** # Spinlocks # PGAC_ARG_BOOL(enable, spinlocks, yes, ! [ --disable-spinlocks do not use Spinlocks]) # # --enable-debug adds -g to compiler flags --- 203,209 ---- # Spinlocks # PGAC_ARG_BOOL(enable, spinlocks, yes, ! [ --disable-spinlocks do not use spinlocks]) # # --enable-debug adds -g to compiler flags *************** esac *** 229,267 **** AC_PROG_CC([$pgac_cc_list]) # # Read the template # . "$srcdir/src/template/$template" || exit ! # The template may have supplied a default setting for CFLAGS. ! # Override this if CFLAGS was set in the original environment. if test "$ac_env_CFLAGS_set" = set; then CFLAGS=$ac_env_CFLAGS_value else ! # autoconf already set the default CFLAGS for gcc to be -O2, but we ! # need to specify -fno-strict-aliasing too in case it's gcc 3.3 or later. ! if test "$GCC" = yes; then ! CFLAGS="$CFLAGS -fno-strict-aliasing" ! fi fi # supply -g if --enable-debug if test "$enable_debug" = yes -a "$ac_cv_prog_cc_g" = yes; then CFLAGS="$CFLAGS -g" fi ! # default to -O rather than empty CFLAGS; this path will not be taken for ! # gcc (since autoconf supplies -O2), nor if --enable-debug (because -O -g ! # doesn't work on most non-gcc compilers), nor if the template provided ! # some CFLAGS. ! if test "$ac_env_CFLAGS_set" != set -a x"$CFLAGS" = x""; then ! CFLAGS="-O" ! fi AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) # We already have this in Makefile.win32, but configure needs it too ! if test "$PORTNAME" = "win32" ! then ! CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32" fi # Check if the compiler still works with the template settings --- 229,270 ---- AC_PROG_CC([$pgac_cc_list]) + pgac_CFLAGS_before_template=$CFLAGS + # # Read the template # . "$srcdir/src/template/$template" || exit ! # CFLAGS are selected so: ! # If the user specifies something in the environment, that is used. ! # else: If the template file set something, that is used. ! # else: If the compiler is GCC, then we use -O2. ! # else: If the compiler is something else, then we use -0. ! if test "$ac_env_CFLAGS_set" = set; then CFLAGS=$ac_env_CFLAGS_value + elif test "$pgac_CFLAGS_before_template" != "$CFLAGS"; then + : # (keep what template set) + elif test "$GCC" = yes; then + CFLAGS="-O2" else ! CFLAGS="-O" fi + + # Need to specify -fno-strict-aliasing too in case it's gcc 3.3 or later. + PGAC_PROG_CC_NO_STRICT_ALIASING + # supply -g if --enable-debug if test "$enable_debug" = yes -a "$ac_cv_prog_cc_g" = yes; then CFLAGS="$CFLAGS -g" fi ! AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) # We already have this in Makefile.win32, but configure needs it too ! if test "$PORTNAME" = "win32"; then ! CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32" fi # Check if the compiler still works with the template settings