mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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.
This commit is contained in:
14
configure
vendored
14
configure
vendored
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user