]> git.lyx.org Git - lyx.git/blobdiff - config/lyxinclude.m4
Fix the following sort of crash, reported on the list. This is also
[lyx.git] / config / lyxinclude.m4
index 914a2a692e84b1818bef19f9c0b3232714d30ea9..549eb6058657bacf2ce45e19aa7e971e4a2c2eac 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
@@ -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.