mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Do not let external specification of CFLAGS stop us from adding
-fno-strict-aliasing.
This commit is contained in:
67
configure
vendored
67
configure
vendored
@ -2437,6 +2437,73 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
if test "$ac_env_CFLAGS_set" = set; then
|
||||
CFLAGS=$ac_env_CFLAGS_value
|
||||
fi
|
||||
|
||||
# Need to specify -fno-strict-aliasing too in case it's gcc 3.3 or later.
|
||||
echo "$as_me:$LINENO: checking how to turn off strict aliasing in $CC" >&5
|
||||
echo $ECHO_N "checking how to turn off strict aliasing in $CC... $ECHO_C" >&6
|
||||
if test "${pgac_cv_prog_cc_no_strict_aliasing+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
pgac_save_CFLAGS=$CFLAGS
|
||||
if test "$GCC" = yes; then
|
||||
pgac_try="-fno-strict-aliasing"
|
||||
else
|
||||
# Maybe fill in later...
|
||||
pgac_try=
|
||||
fi
|
||||
|
||||
for pgac_flag in $pgac_try; do
|
||||
CFLAGS="$pgac_save_CFLAGS $pgac_flag"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
#line $LINENO "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#ifdef F77_DUMMY_MAIN
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int F77_DUMMY_MAIN() { return 1; }
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -s conftest.$ac_objext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
pgac_cv_prog_cc_no_strict_aliasing=$pgac_try
|
||||
break
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
fi
|
||||
rm -f conftest.$ac_objext conftest.$ac_ext
|
||||
done
|
||||
|
||||
CFLAGS=$pgac_save_CFLAGS
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_no_strict_aliasing" >&5
|
||||
echo "${ECHO_T}$pgac_cv_prog_cc_no_strict_aliasing" >&6
|
||||
|
||||
if test x"$pgac_cv_prog_cc_no_strict_aliasing" != x""; then
|
||||
CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing"
|
||||
fi
|
||||
|
||||
# supply -g if --enable-debug
|
||||
if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
|
||||
CFLAGS="$CFLAGS -g"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user