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.
pull/340/head
Andres Freund 2016-02-11 12:01:27 +01:00 committed by Jason Petersen
parent 0a1c8723c4
commit 7efbb5b472
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
2 changed files with 8 additions and 2 deletions

5
configure vendored
View File

@ -1893,7 +1893,9 @@ fi
# Allow to overwrite the C compiler, default to the one postgres was # 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_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 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_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
CFLAGS="$SAVE_CFLAGS"
# check for a number of CFLAGS that make development easier # check for a number of CFLAGS that make development easier

View File

@ -52,8 +52,11 @@ fi
AC_SUBST(vpath_build) AC_SUBST(vpath_build)
# Allow to overwrite the C compiler, default to the one postgres was # 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)]) AC_PROG_CC([$($PG_CONFIG --cc)])
CFLAGS="$SAVE_CFLAGS"
# check for a number of CFLAGS that make development easier # check for a number of CFLAGS that make development easier