Commit e94f297b authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* m4/gccoptim.m4: Compute optimization flags for CXX too.

parent 50ed9f8c
2004-08-09 Alexandre Duret-Lutz <adl@src.lip6.fr> 2004-08-09 Alexandre Duret-Lutz <adl@src.lip6.fr>
* m4/gccoptim.m4: Compute optimization flags for CXX too.
* m4/ndebug.m4: Update CPPFLAGS, not CFLAGS. * m4/ndebug.m4: Update CPPFLAGS, not CFLAGS.
* src/tgbaalgos/ltl2tgba_fm.hh (ltl_to_tgba_fm): Document all * src/tgbaalgos/ltl2tgba_fm.hh (ltl_to_tgba_fm): Document all
......
...@@ -3,7 +3,7 @@ AC_DEFUN([ad_GCC_OPTIM], ...@@ -3,7 +3,7 @@ AC_DEFUN([ad_GCC_OPTIM],
[AC_ARG_ENABLE([optimizations], [AC_ARG_ENABLE([optimizations],
[AC_HELP_STRING([--disable-optimizations], [AC_HELP_STRING([--disable-optimizations],
[turn off aggressive optimizations])]) [turn off aggressive optimizations])])
if test -n "$GCC" -a "${enable_optimizations-yes}" = "yes"; then if test -n "$GCC" && test "${enable_optimizations-yes}" = "yes"; then
AC_CACHE_CHECK([for gcc optimization options], ac_cv_prog_gcc_opt_flags, AC_CACHE_CHECK([for gcc optimization options], ac_cv_prog_gcc_opt_flags,
[changequote(,)dnl [changequote(,)dnl
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
...@@ -25,9 +25,33 @@ EOF ...@@ -25,9 +25,33 @@ EOF
done done
rm -f conftest* rm -f conftest*
CFLAGS="$cf_save_CFLAGS $ac_cv_prog_gcc_opt_flags"]) CFLAGS="$cf_save_CFLAGS $ac_cv_prog_gcc_opt_flags"])
AC_CACHE_CHECK([for g++ optimization options], ac_cv_prog_gxx_opt_flags,
[changequote(,)dnl
cat > conftest.$ac_ext <<EOF
#line __oline__ "configure"
int main(int argc, char *argv[]) { return argv[argc-1] == 0; }
EOF
changequote([,])dnl
AC_LANG_PUSH([C++])
cf_save_CXXFLAGS="$CXXFLAGS"
ac_cv_prog_gxx_opt_flags="-O3"
for cf_opt in \
ffast-math \
fstrict-aliasing \
fomit-frame-pointer
do
CXXFLAGS="$cf_save_CXXFLAGS $ac_cv_prog_gxx_opt_flags -$cf_opt"
if AC_TRY_EVAL([ac_compile]); then
ac_cv_prog_gxx_opt_flags="$ac_cv_prog_gxx_opt_flags -$cf_opt"
fi
done
rm -f conftest*
AC_LANG_POP([C++])
CXXFLAGS="$cf_save_CFLAGS $ac_cv_prog_gxx_opt_flags"])
else else
case $enable_optimizations in case $enable_optimizations in
no) ;; no) ;;
*) CFLAGS="$CFLAGS $enable_optimizations" ;; *) CXXFLAGS="$CXXFLAGS $enable_optimizations"
CFLAGS="$CFLAGS $enable_optimizations" ;;
esac esac
fi]) fi])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment