From 7efbb5b472595607bb760633d133e05338ba44ee Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Thu, 11 Feb 2016 12:01:27 +0100 Subject: [PATCH] Don't use autoconf's default CFLAGS. We just want PosgreSQL's defaults, not autoconf's (-g -O2). Currently, these are wrong when PostgreSQL has been compiled with e.g. -O0. --- configure | 5 ++++- configure.in | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index aaf84be6a..8c418df55 100755 --- a/configure +++ b/configure @@ -1893,7 +1893,9 @@ fi # Allow to overwrite the C compiler, default to the one postgres was -# compiled with +# compiled with. We don't want autoconf's default CFLAGS though, so save +# those. +SAVE_CFLAGS="$CFLAGS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2491,6 +2493,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +CFLAGS="$SAVE_CFLAGS" # check for a number of CFLAGS that make development easier diff --git a/configure.in b/configure.in index 5248f36f5..7ef13e2eb 100644 --- a/configure.in +++ b/configure.in @@ -52,8 +52,11 @@ fi AC_SUBST(vpath_build) # Allow to overwrite the C compiler, default to the one postgres was -# compiled with +# compiled with. We don't want autoconf's default CFLAGS though, so save +# those. +SAVE_CFLAGS="$CFLAGS" AC_PROG_CC([$($PG_CONFIG --cc)]) +CFLAGS="$SAVE_CFLAGS" # check for a number of CFLAGS that make development easier