aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
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])
623dnl Amongst other things, this sets AR and ARFLAGS. 623dnl Amongst other things, this sets AR and ARFLAGS.
624gl_EARLY 624gl_EARLY
625 625
626# It's helpful to have C macros available to GDB, so prefer -g3 to -g
627# if -g3 works and the user does not specify CFLAGS.
628# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains.
629if test "$ac_test_CFLAGS" != set; then 626if test "$ac_test_CFLAGS" != set; then
627 # It's helpful to have C macros available to GDB, so prefer -g3 to -g
628 # if -g3 works and the user does not specify CFLAGS.
629 # This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains.
630 case $CFLAGS in 630 case $CFLAGS in
631 '-g') 631 '-g')
632 emacs_g3_CFLAGS='-g3';; 632 emacs_g3_CFLAGS='-g3';;
@@ -642,16 +642,32 @@ if test "$ac_test_CFLAGS" != set; then
642 [emacs_cv_prog_cc_g3], 642 [emacs_cv_prog_cc_g3],
643 [AC_LINK_IFELSE([AC_LANG_PROGRAM()], 643 [AC_LINK_IFELSE([AC_LANG_PROGRAM()],
644 [emacs_cv_prog_cc_g3=yes], 644 [emacs_cv_prog_cc_g3=yes],
645 [emacs_cv_prog_cc_g3=no])]) 645 [emacs_cv_prog_cc_g3=no])])
646 if test $emacs_cv_prog_cc_g3 = yes; then 646 if test $emacs_cv_prog_cc_g3 != yes; then
647 CFLAGS=$emacs_g3_CFLAGS
648 else
649 CFLAGS=$emacs_save_CFLAGS 647 CFLAGS=$emacs_save_CFLAGS
650 fi 648 fi
651 if test $opsys = mingw32; then 649 if test $opsys = mingw32; then
652 CFLAGS="$CFLAGS -gdwarf-2" 650 CFLAGS="$CFLAGS -gdwarf-2"
653 fi 651 fi
654 fi 652 fi
653
654 case $CFLAGS in
655 *-O*) ;;
656 *)
657 # No optimization flag was inferred for this non-GCC compiler.
658 # Try -O. This is needed for xlc on AIX; see Bug#14258.
659 emacs_save_CFLAGS=$CFLAGS
660 test -z "$CFLAGS" || CFLAGS="$CFLAGS "
661 CFLAGS=${CFLAGS}-O
662 AC_CACHE_CHECK([whether $CC accepts -O],
663 [emacs_cv_prog_cc_o],
664 [AC_LINK_IFELSE([AC_LANG_PROGRAM()],
665 [emacs_cv_prog_cc_o=yes],
666 [emacs_cv_prog_cc_o=no])])
667 if test $emacs_cv_prog_cc_o != yes; then
668 CFLAGS=$emacs_save_CFLAGS
669 fi ;;
670 esac
655fi 671fi
656 672
657AC_ARG_ENABLE([gcc-warnings], 673AC_ARG_ENABLE([gcc-warnings],