[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],