diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/configure b/configure index e076bc43c5e..118562c4973 100755 --- a/configure +++ b/configure @@ -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 |