]> git.lyx.org Git - lyx.git/blobdiff - config/lyxinclude.m4
String cosmetics
[lyx.git] / config / lyxinclude.m4
index 914a2a692e84b1818bef19f9c0b3232714d30ea9..20b7f94817feca212ab32d3e47794f009a9bcc3a 100644 (file)
@@ -29,7 +29,7 @@ AC_ARG_ENABLE(build-type,
           build_type=prerelease;;
    esac])
 AC_MSG_RESULT([$build_type])
-if test $lyx_devel_version == yes ; then
+if test $lyx_devel_version = yes ; then
            AC_DEFINE(DEVEL_VERSION, 1, [Define if you are building a development version of LyX])
            LYX_DATE="not released yet"
 fi
@@ -210,9 +210,9 @@ AC_ARG_ENABLE(concept-checks,
         enable_concept_checks=no;
     fi;])
 
-AC_ARG_ENABLE(profiling,
-  AC_HELP_STRING([--enable-profiling],[enable profiling]),,
-  enable_profiling=no;)
+AC_ARG_ENABLE(gprof,
+  AC_HELP_STRING([--enable-gprof],[enable profiling using gprof]),,
+  enable_gprof=no;)
 
 ### set up optimization
 AC_ARG_ENABLE(optimization,
@@ -264,7 +264,7 @@ if test x$GXX = xyes; then
         CFLAGS="-g $CFLAGS"
        CXXFLAGS="-g $CXXFLAGS"
     fi
-    if test x$enable_profiling = xyes ; then
+    if test x$enable_gprof = xyes ; then
         CFLAGS="-pg $CFLAGS"
         CXXFLAGS="-pg $CXXFLAGS"
         LDFLAGS="-pg $LDFLAGS"
@@ -571,6 +571,26 @@ do
       [AC_MSG_RESULT(no)])
 done])
 
+dnl this is used by the macro below to generate a proper config.h.in entry
+m4_define([LYX_AH_CHECK_DEF],
+[AH_TEMPLATE(AS_TR_CPP(HAVE_DEF_$1),
+  [Define to 1 if `$1' is defined in `$2'])])
+
+dnl Check whether name is defined in header by using it in codesnippet.
+dnl Called like LYX_CHECK_DEF(name, header, codesnippet)
+dnl Defines HAVE_DEF_{NAME}
+AC_DEFUN([LYX_CHECK_DEF],
+[LYX_AH_CHECK_DEF($1, $2)
+ AC_MSG_CHECKING([whether $1 is defined by header $2])
+ AC_TRY_COMPILE([#include <$2>], [$3],
+     lyx_have_def_name=yes,
+     lyx_have_def_name=no)
+ AC_MSG_RESULT($lyx_have_def_name)
+ if test "x$lyx_have_def_name" = xyes; then
+   AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_DEF_$1))
+ fi
+])
+
 dnl Extract the single digits from PACKAGE_VERSION and make them available.
 dnl Defines LYX_MAJOR_VERSION, LYX_MINOR_VERSION, LYX_RELEASE_LEVEL,
 dnl LYX_RELEASE_PATCH (possibly equal to 0), LYX_DIR_VER, and LYX_USERDIR_VER.