diff options
author | Eli Zaretskii <eliz@gnu.org> | 2013-05-01 20:47:50 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-05-01 20:47:50 +0300 |
commit | b1cb82edff21abfefd68af18370dddfd8cc1fec0 (patch) | |
tree | fd8d8a1e1d99af024b52158a471457fc796238bc /configure.ac | |
parent | 10f81f3ac90f98160f611787e20dcad96bb500e9 (diff) | |
parent | 2640d52e4e7873e41b0f0f1144177f84c345917e (diff) | |
download | emacs-b1cb82edff21abfefd68af18370dddfd8cc1fec0.tar.gz |
Merge from trunk.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 4130662e8e7..ce99f086a42 100644 --- a/configure.ac +++ b/configure.ac @@ -623,10 +623,10 @@ AC_DEFUN([gl_THREADLIB]) dnl Amongst other things, this sets AR and ARFLAGS. gl_EARLY -# It's helpful to have C macros available to GDB, so prefer -g3 to -g -# if -g3 works and the user does not specify CFLAGS. -# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. if test "$ac_test_CFLAGS" != set; then + # It's helpful to have C macros available to GDB, so prefer -g3 to -g + # if -g3 works and the user does not specify CFLAGS. + # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. case $CFLAGS in '-g') emacs_g3_CFLAGS='-g3';; @@ -642,16 +642,32 @@ if test "$ac_test_CFLAGS" != set; then [emacs_cv_prog_cc_g3], [AC_LINK_IFELSE([AC_LANG_PROGRAM()], [emacs_cv_prog_cc_g3=yes], - [emacs_cv_prog_cc_g3=no])]) - if test $emacs_cv_prog_cc_g3 = yes; then - CFLAGS=$emacs_g3_CFLAGS - else + [emacs_cv_prog_cc_g3=no])]) + if test $emacs_cv_prog_cc_g3 != yes; then CFLAGS=$emacs_save_CFLAGS fi if test $opsys = mingw32; then CFLAGS="$CFLAGS -gdwarf-2" fi fi + + case $CFLAGS in + *-O*) ;; + *) + # No optimization flag was inferred for this non-GCC compiler. + # Try -O. This is needed for xlc on AIX; see Bug#14258. + emacs_save_CFLAGS=$CFLAGS + test -z "$CFLAGS" || CFLAGS="$CFLAGS " + CFLAGS=${CFLAGS}-O + AC_CACHE_CHECK([whether $CC accepts -O], + [emacs_cv_prog_cc_o], + [AC_LINK_IFELSE([AC_LANG_PROGRAM()], + [emacs_cv_prog_cc_o=yes], + [emacs_cv_prog_cc_o=no])]) + if test $emacs_cv_prog_cc_o != yes; then + CFLAGS=$emacs_save_CFLAGS + fi ;; + esac fi AC_ARG_ENABLE([gcc-warnings], |