This patch adds configure switches for:
     - precompiled headers
     - concept checks
     - libstdc++ debug mode

I'll commit this later today.

Index: config/lyxinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.103
diff -u -p -B -b -w -r1.103 lyxinclude.m4
--- config/lyxinclude.m4	28 Dec 2004 13:48:48 -0000	1.103
+++ config/lyxinclude.m4	4 Jan 2005 01:25:39 -0000
@@ -184,6 +184,18 @@ AC_ARG_ENABLE(debug,
 	enable_debug=no;
     fi;])
 
+AC_ARG_ENABLE(debug-mode,
+  AC_HELP_STRING([--enable-debug-mode],[enable libstdc++ debug mode]),,
+  enable_debug_mode=yes;)
+	
+AC_ARG_ENABLE(concept-checks,
+  AC_HELP_STRING([--enable-concept-checks],[enable concept checks]),,
+  [ if test $lyx_devel_version = yes -o $lyx-prerelease = yes && test $ac_cv_prog_gxx = yes ; then
+	enable_concept_checks=yes;
+    else
+        enable_concept_checks=no;
+    fi;])
+
 ### set up optimization
 AC_ARG_ENABLE(optimization,
   AC_HELP_STRING([--enable-optimization[=value]],[enable compiler optimisation]),,
@@ -194,6 +206,9 @@ case $enable_optimization in
     *) lyx_opt=${enable_optimization};;
 esac
 
+AC_ARG_ENABLE(pch,
+  AC_HELP_STRING([--enable-pch],[enable precompiled headers]),,
+	enable_pch=yes;)
 lyx_pch_comp=no
 
 # set the debug flags correctly.
@@ -215,22 +230,34 @@ if test x$GXX = xyes; then
       3.3*)    CXXFLAGS="$lyx_opt -fno-exceptions";;
       3.4*|4.0*)
 	    CXXFLAGS="$lyx_opt -fno-exceptions"
-	    lyx_pch_comp=yes;;
+	    test $enable_pch = yes && lyx_pch_comp=yes
+	    ;;
       *)       CXXFLAGS="$lyx_opt";;
     esac
     if test x$enable_debug = xyes ; then
+	CXXFLAGS="-g $CXXFLAGS"
+    fi
+  fi
+  if test x$enable_debug_mode = xyes ; then
+    lyx_flags="$lyx_flags debug-mode"	
 	case $gxx_version in
-	    3.3*) CXXFLAGS="-g $CXXFLAGS"
-		AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS, 1, [libstdc++ concept checking])
-		;;
-	    3.4*|4.0*) CXXFLAGS="-g $CXXFLAGS"
-		AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS, 1, [libstdc++ concept checking])
+	3.4*|4.0*)
 		AC_DEFINE(_GLIBCXX_DEBUG, 1, [libstdc++ debug mode])
 		AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [libstdc++ pedantic debug mode])
 		;;
-	    *)    CXXFLAGS="-g $CXXFLAGS";;
+	*) ;;
 	esac
     fi
+  if test x$enable_concept_checks = xyes ; then
+	lyx_flags="$lyx_flags concept-checks"
+	case $gxx_version in
+	    3.3*)
+		AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS, 1, [libstdc++ concept checking])
+		;;
+	    3.4*|4.0*)
+		AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS, 1, [libstdc++ concept checking])
+		;;
+	esac
   fi
   if test x$enable_warnings = xyes ; then
     case $gxx_version in
@@ -243,6 +270,7 @@ if test x$GXX = xyes; then
     esac
   fi
 fi
+test "$lyx_pch_comp" = yes && lyx_flags="$lyx_flags pch"
 AM_CONDITIONAL(LYX_BUILD_PCH, test "$lyx_pch_comp" = yes)
 ])dnl
 
-- 
        Lgb

Reply via email to