]> git.lyx.org Git - lyx.git/blobdiff - config/lyxinclude.m4
Make the standard paragraph an empty paragraph if its content allows it.
[lyx.git] / config / lyxinclude.m4
index 08dc0f96842b6d84914a7cb0befd9080a34dc451..983397ff99bfa2dadfb6b8d8dac6c49a46bd4376 100644 (file)
@@ -6,11 +6,11 @@ dnl         Allan Rae (rae@lyx.org)
 
 dnl Usage LYX_CHECK_VERSION   Displays version of LyX being built and
 dnl sets variables "lyx_devel_version" and "lyx_prerelease"
-AC_DEFUN(LYX_CHECK_VERSION,[
-changequote(, ) dnl
+AC_DEFUN([LYX_CHECK_VERSION],[
 echo "configuring LyX version $VERSION"
 if echo "$VERSION" | grep 'cvs' >/dev/null ; then
   lyx_devel_version=yes
+  AC_DEFINE(DEVEL_VERSION, 1, [Define if you are building a development version of LyX])
   echo "WARNING: This is a development version. Expect bugs."
 else
   lyx_devel_version=no
@@ -21,18 +21,15 @@ if echo "$VERSION" | grep 'pre' > /dev/null ; then
 else
     lyx_prerelease=no
 fi
-changequote([, ]) dnl
-AC_SUBST(lyx_devel_version)
-if test $lyx_devel_version = yes ; then
-  AC_DEFINE(DEVEL_VERSION, 1, Define if you are building a development version of LyX)
-fi])
+AC_SUBST(lyx_devel_version)])
 
 
 dnl Define the option to set a LyX version on installed executables and directories
 dnl
 dnl
-AC_DEFUN(LYX_VERSION_SUFFIX,[
+AC_DEFUN([LYX_VERSION_SUFFIX],[
 AC_MSG_CHECKING([for install target ... ])
+RPM_VERSION_SUFFIX='""'
 AC_ARG_WITH(version-suffix,
   [  --with-version-suffix[=<version>]  install lyx files as lyx<version>],
   [if test "x$withval" = "xyes";
@@ -41,15 +38,17 @@ AC_ARG_WITH(version-suffix,
      ac_configure_args=`echo $ac_configure_args | sed "s,--with-version-suffix,--with-version-suffix=$withval,"`
    fi
    lyxname="lyx$withval"
-   program_suffix=$withval],
+   program_suffix=$withval
+   RPM_VERSION_SUFFIX="--with-version-suffix=$withval"],
   [lyxname=lyx])
+AC_SUBST(RPM_VERSION_SUFFIX)
 AC_MSG_RESULT([$lyxname])
 ])
 
 
 dnl Usage: LYX_ERROR(message)  Displays the warning "message" and sets the
 dnl flag lyx_error to yes.
-AC_DEFUN(LYX_ERROR,[
+AC_DEFUN([LYX_ERROR],[
 lyx_error_txt="$lyx_error_txt
 ** $1
 "
@@ -58,7 +57,7 @@ lyx_error=yes])
 
 dnl Usage: LYX_WARNING(message)  Displays the warning "message" and sets the
 dnl flag lyx_warning to yes.
-AC_DEFUN(LYX_WARNING,[
+AC_DEFUN([LYX_WARNING],[
 lyx_warning_txt="$lyx_warning_txt
 == $1
 "
@@ -67,14 +66,14 @@ lyx_warning=yes])
 
 dnl Usage: LYX_LIB_ERROR(file,library)  Displays an error message indication
 dnl  that 'file' cannot be found because 'lib' may be uncorrectly installed.
-AC_DEFUN(LYX_LIB_ERROR,[
+AC_DEFUN([LYX_LIB_ERROR],[
 LYX_ERROR([Cannot find $1. Please check that the $2 library
    is correctly installed on your system.])])
 
 
 dnl Usage: LYX_CHECK_ERRORS  Displays a warning message if a LYX_ERROR
 dnl   has occured previously.
-AC_DEFUN(LYX_CHECK_ERRORS,[
+AC_DEFUN([LYX_CHECK_ERRORS],[
 if test x$lyx_error = xyes; then
 cat <<EOF
 **** The following problems have been detected by configure.
@@ -150,7 +149,7 @@ rm -f conftest.C conftest.o conftest.obj || true
 ])
 
 
-AC_DEFUN(LYX_PROG_CXX,
+AC_DEFUN([LYX_PROG_CXX],
 [AC_MSG_CHECKING([for a good enough C++ compiler])
 LYX_SEARCH_PROG(CXX, $CXX $CCC g++ gcc c++ CC cxx xlC cc++, [LYX_PROG_CXX_WORKS])
 
@@ -195,6 +194,8 @@ case $enable_optimization in
     *) lyx_opt=${enable_optimization};;
 esac
 
+lyx_pch_comp=no
+
 # set the debug flags correctly.
 if test x$GXX = xyes; then
   dnl Useful for global version info
@@ -212,28 +213,40 @@ if test x$GXX = xyes; then
       3.1*)    CXXFLAGS="$lyx_opt -finline-limit=500 -fno-exceptions";;
       3.2*)    CXXFLAGS="$lyx_opt -fno-exceptions";;
       3.3*)    CXXFLAGS="$lyx_opt -fno-exceptions";;
-      3.4*)    CXXFLAGS="$lyx_opt -fno-exceptions";;
+      3.4*|3.5*)
+           CXXFLAGS="$lyx_opt -fno-exceptions"
+           lyx_pch_comp=yes;;
       *)       CXXFLAGS="$lyx_opt";;
     esac
     if test x$enable_debug = xyes ; then
-       CXXFLAGS="-g $CXXFLAGS"
+       case $gxx_version in
+           3.4*|3.5*) CXXFLAGS="-g $CXXFLAGS"
+               AC_DEFINE(_GLIBCXX_DEBUG, 1, [libstdc++ debug mode])
+               AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [libstdc++ pedantic debug mode])
+               ;;
+           *)    CXXFLAGS="-g $CXXFLAGS";;
+       esac
     fi
   fi
   if test x$enable_warnings = xyes ; then
     case $gxx_version in
        2.95.*) CXXFLAGS="$CXXFLAGS -W -Wall";;
        2.96*)  CXXFLAGS="$CXXFLAGS -W -Wall";;
-       3.1*)  CXXFLAGS="$CXXFLAGS -W -Wall";;
-       *)      CXXFLAGS="$CXXFLAGS -W -Wall";;
+       3.1*) CXXFLAGS="$CXXFLAGS -W -Wall";;
+       3.2*) CXXFLAGS="$CXXFLAGS -W -Wall";;
+       3.3*) CXXFLAGS="$CXXFLAGS -W -Wall";;
+       *)    CXXFLAGS="$CXXFLAGS -Wextra -Wall";;
     esac
   fi
-fi])dnl
+fi
+AM_CONDITIONAL(LYX_BUILD_PCH, test "$lyx_pch_comp" = yes)
+])dnl
 
 
 dnl NOT USED CURRENTLY*************************************
 dnl Usage: LYX_CXX_RTTI : checks whether the C++ compiler
 dnl   supports RTTI
-AC_DEFUN(LYX_CXX_RTTI,[
+AC_DEFUN([LYX_CXX_RTTI],[
 ### Check whether the compiler supports runtime type information
 AC_CACHE_CHECK(whether the C++ compiler supports RTTI,lyx_cv_rtti,
  [AC_TRY_RUN([
@@ -272,7 +285,7 @@ fi])
 
 dnl Usage: LYX_CXX_EXPLICIT : checks whether the C++ compiler
 dnl   understands the "explicit" directive.
-AC_DEFUN(LYX_CXX_EXPLICIT,[
+AC_DEFUN([LYX_CXX_EXPLICIT],[
 ### Check whether the compiler understands the keyword `explicit'
 AC_CACHE_CHECK(whether the C++ compiler understands explicit,lyx_cv_explicit,
  [AC_TRY_COMPILE([
@@ -291,7 +304,7 @@ fi])
 dnl NOT USED CURRENTLY*************************************
 dnl Usage: LYX_CXX_STL_STACK : checks whether the C++ compiler
 dnl   has a working stl stack template
-AC_DEFUN(LYX_CXX_STL_STACK,[
+AC_DEFUN([LYX_CXX_STL_STACK],[
 AC_CACHE_CHECK(for broken STL stack template,lyx_cv_broken_stack,
  [AC_TRY_COMPILE([
 #include <stack>
@@ -310,7 +323,7 @@ fi])
 
 dnl Usage: LYX_STD_COUNT : checks wherer the C++ library have a conforming
 dnl    count template, if not the old HP version is assumed.
-AC_DEFUN(LYX_STD_COUNT,[
+AC_DEFUN([LYX_STD_COUNT],[
 AC_CACHE_CHECK(for conforming std::count,lyx_cv_std_count,
  [AC_TRY_COMPILE([
 #include <algorithm>
@@ -332,7 +345,7 @@ fi])
 
 dnl Usage: LYX_CXX_STL_MODERN_STREAMS : checks whether the C++ compiler
 dnl   supports modern STL streams
-AC_DEFUN(LYX_CXX_STL_MODERN_STREAMS,[
+AC_DEFUN([LYX_CXX_STL_MODERN_STREAMS],[
 AC_CACHE_CHECK(for modern STL streams,lyx_cv_modern_streams,
  [AC_TRY_COMPILE([
 #include <iostream>
@@ -349,7 +362,7 @@ fi])
 
 dnl Usage: LYX_USE_INCLUDED_BOOST : select if the included boost should
 dnl        be used.
-AC_DEFUN(LYX_USE_INCLUDED_BOOST,[
+AC_DEFUN([LYX_USE_INCLUDED_BOOST],[
        AC_ARG_WITH(included-boost,
            [  --with-included-boost  use the boost lib supplied with LyX],
            [lyx_cv_with_included_boost=$withval
@@ -361,7 +374,7 @@ AC_DEFUN(LYX_USE_INCLUDED_BOOST,[
 
 dnl NOT USED CURRENTLY*************************************
 dnl LYX_CXX_PARTIAL
-AC_DEFUN(LYX_CXX_PARTIAL, [
+AC_DEFUN([LYX_CXX_PARTIAL], [
     AC_REQUIRE([AC_PROG_CXX])
     AC_CACHE_CHECK([if C++ compiler supports partial specialization],
        [lyx_cv_cxx_partial_specialization],
@@ -390,7 +403,7 @@ AC_DEFUN(LYX_CXX_PARTIAL, [
 
 dnl Usage: LYX_CXX_CHEADERS : checks whether the C++ compiler
 dnl   provides wrappers for C headers and use our alternate version otherwise.
-AC_DEFUN(LYX_CXX_CHEADERS,[
+AC_DEFUN([LYX_CXX_CHEADERS],[
 AC_CACHE_CHECK(for C headers wrappers,lyx_cv_cxx_cheaders,
  [AC_TRY_CPP([
 #include <clocale>
@@ -409,7 +422,7 @@ fi])
 
 dnl Usage: LYX_CXX_GLOBAL_CSTD: checks whether C library functions
 dnl   are already in the global namespace
-AC_DEFUN(LYX_CXX_GLOBAL_CSTD,[
+AC_DEFUN([LYX_CXX_GLOBAL_CSTD],[
     AC_CACHE_CHECK(whether C library functions are already in the global namespace,
     lyx_cv_cxx_global_cstd,
     [AC_TRY_COMPILE([
@@ -429,7 +442,7 @@ dnl Usage: LYX_WITH_DIR(dir-name,desc,dir-var-name,default-value,
 dnl                       [default-yes-value])
 dnl  Adds a --with-'dir-name' option (described by 'desc') and puts the
 dnl  resulting directory name in 'dir-var-name'.
-AC_DEFUN(LYX_WITH_DIR,[
+AC_DEFUN([LYX_WITH_DIR],[
   AC_ARG_WITH($1,[  --with-$1        specify $2])
   AC_MSG_CHECKING([for $2])
   if test -z "$with_$3"; then
@@ -444,7 +457,7 @@ AC_DEFUN(LYX_WITH_DIR,[
 dnl Usage: LYX_LOOP_DIR(value,action)
 dnl Executes action for values of variable `dir' in `values'. `values' can
 dnl use ":" as a separator.
-AC_DEFUN(LYX_LOOP_DIR,[
+AC_DEFUN([LYX_LOOP_DIR],[
 IFS="${IFS=    }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 for dir in `eval "echo $1"`; do
   if test ! "$dir" = NONE; then
@@ -458,7 +471,7 @@ IFS=$ac_save_ifs
 
 dnl Usage: LYX_ADD_LIB_DIR(var-name,dir) Adds a -L directive to variable
 dnl var-name.
-AC_DEFUN(LYX_ADD_LIB_DIR,[
+AC_DEFUN([LYX_ADD_LIB_DIR],[
 $1="${$1} -L$2"
 if test "`(uname) 2>/dev/null`" = SunOS &&
     uname -r | grep '^5' >/dev/null; then
@@ -472,7 +485,7 @@ fi])
 
 dnl Usage: LYX_ADD_INC_DIR(var-name,dir) Adds a -I directive to variable
 dnl var-name.
-AC_DEFUN(LYX_ADD_INC_DIR,[$1="${$1} -I$2 "])
+AC_DEFUN([LYX_ADD_INC_DIR],[$1="${$1} -I$2 "])
 
 ### Check for a headers existence and location iff it exists
 ## This is supposed to be a generalised version of LYX_STL_STRING_FWD
@@ -485,7 +498,7 @@ AC_DEFUN(LYX_ADD_INC_DIR,[$1="${$1} -I$2 "])
 ## the config.h.in file so we need to write our own entries there -- one for
 ## each header in the form PATH_HEADER_NAME_H
 ##
-AC_DEFUN(LYX_PATH_HEADER,
+AC_DEFUN([LYX_PATH_HEADER],
 [ AC_CHECK_HEADER($1,[
   ac_tr_safe=PATH_`echo $ac_safe | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
 ### the only remaining problem is getting the second parameter to this
@@ -509,11 +522,11 @@ rm -f conftest*])
 
 ### Check which frontends we want to use. The default is XForms only
 ###
-AC_DEFUN(LYX_USE_FRONTENDS,
+AC_DEFUN([LYX_USE_FRONTENDS],
 [AC_MSG_CHECKING([what frontend should be used for the GUI])
 AC_ARG_WITH(frontend,
   [  --with-frontend=THIS    Use THIS frontend as main GUI:
-                           Possible values: xforms, qt],
+                           Possible values: xforms, qt, gtk(EXPERIMENTAL)],
   [FRONTENDS="$withval"], [FRONTENDS="xforms"])
 AC_MSG_RESULT($FRONTENDS)
 AC_SUBST(FRONTENDS)
@@ -527,7 +540,7 @@ AC_SUBST(FRONTENDS_PROGS)
 ## Find a file (or one of more files in a list of dirs)
 ## ------------------------------------------------------------------------
 ##
-AC_DEFUN(AC_FIND_FILE,
+AC_DEFUN([AC_FIND_FILE],
 [
 $3=NO
 for i in $2;
@@ -543,7 +556,7 @@ done
 ])
 
 dnl just a wrapper to clean up configure.in
-AC_DEFUN(LYX_PROG_LIBTOOL,
+AC_DEFUN([LYX_PROG_LIBTOOL],
 [
 AC_REQUIRE([AC_ENABLE_SHARED])
 AC_REQUIRE([AC_ENABLE_STATIC])