summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2003-11-01 20:48:51 +0000
committerPeter Eisentraut <peter_e@gmx.net>2003-11-01 20:48:51 +0000
commit801427abc2924195b35be19abe4f64dbbea82263 (patch)
tree80fa9c8c1d3a902959d82457f22a23a4ecea0a8f /configure
parent0543af2f12ce921074815e16f6b3a4168f41533b (diff)
downloadpostgresql-801427abc2924195b35be19abe4f64dbbea82263.tar.gz
Unset CFLAGS before reading template. This should be more robust.
When --enable-debug is used, then the default CFLAGS for non-GCC is just -g without -O. Backpatch enhancement of Autoconf inline test that detects problems with the HP C compiler.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure14
1 files changed, 9 insertions, 5 deletions
diff --git a/configure b/configure
index 992e289fbe..e7f93a27cc 100755
--- a/configure
+++ b/configure
@@ -2384,7 +2384,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-pgac_CFLAGS_before_template=$CFLAGS
+unset CFLAGS
#
# Read the template
@@ -2399,12 +2399,15 @@ pgac_CFLAGS_before_template=$CFLAGS
if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$ac_env_CFLAGS_value
-elif test "$pgac_CFLAGS_before_template" != "$CFLAGS"; then
+elif test "${CFLAGS+set}" = set; then
: # (keep what template set)
elif test "$GCC" = yes; then
CFLAGS="-O2"
else
- CFLAGS="-O"
+ # if the user selected debug mode, don't use -O
+ if test "$enable_debug" != yes; then
+ CFLAGS="-O"
+ fi
fi
# Need to specify -fno-strict-aliasing too in case it's gcc 3.3 or later.
@@ -2473,7 +2476,7 @@ if test "$ac_env_CFLAGS_set" != set; then
fi
# supply -g if --enable-debug
-if test "$enable_debug" = yes -a "$ac_cv_prog_cc_g" = yes; then
+if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g"
fi
@@ -9314,7 +9317,8 @@ for ac_kw in inline __inline__ __inline; do
#line $LINENO "configure"
#include "confdefs.h"
#ifndef __cplusplus
-static $ac_kw int static_foo () {return 0; }
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
$ac_kw int foo () {return 0; }
#endif