the enable switches

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9440 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2005-01-05 18:17:28 +00:00
parent 9f0f152071
commit 2a434cc53a
2 changed files with 60 additions and 23 deletions

View File

@ -1,3 +1,10 @@
2005-01-05 Lars Gullik Bjonnes <larsbj@gullik.net>
* lyxinclude.m4 (enable_stdlib_debug): new switch
(enable_concept_checks): new switch
(enable_pch): new switch
Also some cleanup.
2004-12-28 Jean-Marc Lasgouttes <lasgouttes@lyx.org> 2004-12-28 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lyxinclude.m4 (LYX_CXX_CHEADERS): remove. * lyxinclude.m4 (LYX_CXX_CHEADERS): remove.

View File

@ -178,12 +178,28 @@ fi
### We might want to disable debug ### We might want to disable debug
AC_ARG_ENABLE(debug, AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],[enable debug information]),, AC_HELP_STRING([--enable-debug],[enable debug information]),,
[ if test $lyx_devel_version = yes -o $lyx_prerelease = yes && test $ac_cv_prog_gxx = yes ; then [ if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then
enable_debug=yes; enable_debug=yes;
else else
enable_debug=no; enable_debug=no;
fi;]) fi;])
AC_ARG_ENABLE(stdlib-debug,
AC_HELP_STRING([--enable-stdlib-debug],[enable debug mode in the standard library]),,
[ if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then
enable_stdlib_debug=yes;
else
enable_stdlib_debug=no;
fi;])
AC_ARG_ENABLE(concept-checks,
AC_HELP_STRING([--enable-concept-checks],[enable concept checks]),,
[ if test $lyx_devel_version = yes -o $lyx-prerelease = yes ; then
enable_concept_checks=yes;
else
enable_concept_checks=no;
fi;])
### set up optimization ### set up optimization
AC_ARG_ENABLE(optimization, AC_ARG_ENABLE(optimization,
AC_HELP_STRING([--enable-optimization[=value]],[enable compiler optimisation]),, AC_HELP_STRING([--enable-optimization[=value]],[enable compiler optimisation]),,
@ -194,9 +210,12 @@ case $enable_optimization in
*) lyx_opt=${enable_optimization};; *) lyx_opt=${enable_optimization};;
esac esac
AC_ARG_ENABLE(pch,
AC_HELP_STRING([--enable-pch],[enable precompiled headers]),,
enable_pch=yes;)
lyx_pch_comp=no lyx_pch_comp=no
# set the debug flags correctly. # set the compiler options correctly.
if test x$GXX = xyes; then if test x$GXX = xyes; then
dnl Useful for global version info dnl Useful for global version info
gxx_version=`${CXX} -dumpversion` gxx_version=`${CXX} -dumpversion`
@ -209,40 +228,51 @@ if test x$GXX = xyes; then
2.95.1) CXXFLAGS="$lyx_opt -fpermissive -ftemplate-depth-30";; 2.95.1) CXXFLAGS="$lyx_opt -fpermissive -ftemplate-depth-30";;
2.95.*) CXXFLAGS="$lyx_opt -Wno-non-template-friend -ftemplate-depth-30";; 2.95.*) CXXFLAGS="$lyx_opt -Wno-non-template-friend -ftemplate-depth-30";;
2.96*) CXXFLAGS="$lyx_opt -fno-exceptions -ftemplate-depth-30 -Wno-non-template-friend";; 2.96*) CXXFLAGS="$lyx_opt -fno-exceptions -ftemplate-depth-30 -Wno-non-template-friend";;
3.0*) CXXFLAGS="$lyx_opt";;
3.1*) CXXFLAGS="$lyx_opt -finline-limit=500 -fno-exceptions";; 3.1*) CXXFLAGS="$lyx_opt -finline-limit=500 -fno-exceptions";;
3.2*) CXXFLAGS="$lyx_opt -fno-exceptions";; 3.2*|3.3*) CXXFLAGS="$lyx_opt -fno-exceptions";;
3.3*) CXXFLAGS="$lyx_opt -fno-exceptions";;
3.4*|4.0*) 3.4*|4.0*)
CXXFLAGS="$lyx_opt -fno-exceptions" CXXFLAGS="$lyx_opt -fno-exceptions"
lyx_pch_comp=yes;; test $enable_pch = yes && lyx_pch_comp=yes
;;
*) CXXFLAGS="$lyx_opt";; *) CXXFLAGS="$lyx_opt";;
esac esac
if test x$enable_debug = xyes ; then if test x$enable_debug = xyes ; then
CXXFLAGS="-g $CXXFLAGS"
fi
fi
if test x$enable_stdlib_debug = xyes ; then
case $gxx_version in case $gxx_version in
3.3*) CXXFLAGS="-g $CXXFLAGS" 3.4*|4.0*)
AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS, 1, [libstdc++ concept checking]) lyx_flags="$lyx_flags stdlib-debug"
;;
3.4*|4.0*) CXXFLAGS="-g $CXXFLAGS"
AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS, 1, [libstdc++ concept checking])
AC_DEFINE(_GLIBCXX_DEBUG, 1, [libstdc++ debug mode]) AC_DEFINE(_GLIBCXX_DEBUG, 1, [libstdc++ debug mode])
AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [libstdc++ pedantic debug mode]) AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [libstdc++ pedantic debug mode])
;; ;;
*) CXXFLAGS="-g $CXXFLAGS";;
esac esac
fi fi
if test x$enable_concept_checks = xyes ; then
case $gxx_version in
3.3*)
lyx_flags="$lyx_flags concept-checks"
AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS, 1, [libstdc++ concept checking])
;;
3.4*|4.0*)
lyx_flags="$lyx_flags concept-checks"
AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS, 1, [libstdc++ concept checking])
;;
esac
fi fi
if test x$enable_warnings = xyes ; then if test x$enable_warnings = xyes ; then
case $gxx_version in case $gxx_version in
2.95.*) CPPFLAGS="$CPPFLAGS -W -Wall";; 2.*|3.1*|3.2*|3.3*)
2.96*) CPPFLAGS="$CPPFLAGS -W -Wall";; CPPFLAGS="$CPPFLAGS -W -Wall"
3.1*) CPPFLAGS="$CPPFLAGS -W -Wall";; ;;
3.2*) CPPFLAGS="$CPPFLAGS -W -Wall";; *)
3.3*) CPPFLAGS="$CPPFLAGS -W -Wall";; CPPFLAGS="$CPPFLAGS -Wextra -Wall"
*) CPPFLAGS="$CPPFLAGS -Wextra -Wall";; ;;
esac esac
fi fi
fi fi
test "$lyx_pch_comp" = yes && lyx_flags="$lyx_flags pch"
AM_CONDITIONAL(LYX_BUILD_PCH, test "$lyx_pch_comp" = yes) AM_CONDITIONAL(LYX_BUILD_PCH, test "$lyx_pch_comp" = yes)
])dnl ])dnl