Commit dabe8979 authored by Peter Eisentraut's avatar Peter Eisentraut

If CFLAGS was specified in the environment, use that, not what the template

says.
parent 4aa1aabd
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -251,6 +251,13 @@ PGAC_ARG_BOOL(enable, rpath, yes, ...@@ -251,6 +251,13 @@ PGAC_ARG_BOOL(enable, rpath, yes,
AC_SUBST(enable_rpath) AC_SUBST(enable_rpath)
#
# --enable-debug adds -g to compiler flags
#
PGAC_ARG_BOOL(enable, debug, no,
[ --enable-debug build with debugging symbols (-g)])
# #
# C compiler # C compiler
# #
...@@ -263,9 +270,20 @@ PGAC_ARG_REQ(with, CC, [], [CC=$with_CC]) ...@@ -263,9 +270,20 @@ PGAC_ARG_REQ(with, CC, [], [CC=$with_CC])
# On AIX, default compiler to xlc. # On AIX, default compiler to xlc.
if test "$template" = aix && test -z "$CC" ; then CC=xlc; fi if test "$template" = aix && test -z "$CC" ; then CC=xlc; fi
# Save CFLAGS from the environment
has_environ_CFLAGS="${CFLAGS+yes}"
save_CFLAGS=$CFLAGS
AC_PROG_CC AC_PROG_CC
# Read the template # Read the template
. "$srcdir/src/template/$template" || exit . "$srcdir/src/template/$template" || exit
if test "$has_environ_CFLAGS" = yes; then
CFLAGS=$save_CFLAGS
fi
if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g"
fi
echo "using CFLAGS=$CFLAGS" echo "using CFLAGS=$CFLAGS"
# Check if the compiler still works with the template settings # Check if the compiler still works with the template settings
AC_PROG_CC_WORKS AC_PROG_CC_WORKS
...@@ -291,13 +309,6 @@ PGAC_ARG_BOOL(enable, depend, no, [ --enable-depend turn on automatic d ...@@ -291,13 +309,6 @@ PGAC_ARG_BOOL(enable, depend, no, [ --enable-depend turn on automatic d
AC_SUBST(autodepend) AC_SUBST(autodepend)
#
# --enable-debug adds -g to compiler flags
#
PGAC_ARG_BOOL(enable, debug, no, [ --enable-debug build with debugging symbols (-g)],
[CFLAGS="$CFLAGS -g"])
# #
# Enable assert checks # Enable assert checks
# #
...@@ -548,9 +559,9 @@ PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++ ...@@ -548,9 +559,9 @@ PGAC_ARG_OPTARG(with, CXX, [ --with-CXX build C++ modules (libpq++
# If the user has specified CXXFLAGS in the environment, leave it # If the user has specified CXXFLAGS in the environment, leave it
# alone, else use a default. # alone, else use a default.
has_cmdline_CXXFLAGS="${CXXFLAGS+yes}" has_environ_CXXFLAGS="${CXXFLAGS+yes}"
AC_PROG_CXX AC_PROG_CXX
if test "$has_cmdline_CXXFLAGS" != yes; then if test "$has_environ_CXXFLAGS" != yes; then
if test "$GXX" = yes; then if test "$GXX" = yes; then
CXXFLAGS=-O2 CXXFLAGS=-O2
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment