X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=config%2Flyxinclude.m4;h=4eb93d755b4b0a6095fc36f5cf10406265494660;hb=e54ae72e5fac6f750c3f7972c74bb42b57f3a049;hp=a1681c71e4ed7ec71b5c17217eb1afaae3ddf917;hpb=e5ae321dabe6069a0bd6423006e7c5f100a00860;p=lyx.git diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index a1681c71e4..4eb93d755b 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -7,20 +7,17 @@ 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],[ -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 -fi -if echo "$VERSION" | grep 'pre' > /dev/null ; then - lyx_prerelease=yes - echo "WARNING: This is a prerelease. Be careful and backup your documents." -else - lyx_prerelease=no -fi +echo "configuring LyX version" AC_PACKAGE_VERSION +lyx_devel_version=no +lyx_prerelease=no +case AC_PACKAGE_VERSION in + *svn*) lyx_devel_version=yes + AC_DEFINE(DEVEL_VERSION, 1, [Define if you are building a development version of LyX]) + LYX_DATE="not released yet" + echo "WARNING: This is a development version. Expect bugs.";; + *pre*|*alpha*|*beta*|*rc*) lyx_prerelease=yes + echo "WARNING: This is a prerelease. Be careful and backup your documents.";; +esac AC_SUBST(lyx_devel_version)]) @@ -28,21 +25,20 @@ dnl Define the option to set a LyX version on installed executables and director dnl dnl AC_DEFUN([LYX_VERSION_SUFFIX],[ -AC_MSG_CHECKING([for install target ... ]) +AC_MSG_CHECKING([for version suffix]) +dnl We need the literal double quotes in the rpm spec file RPM_VERSION_SUFFIX='""' AC_ARG_WITH(version-suffix, [ --with-version-suffix[=] install lyx files as lyx], [if test "x$withval" = "xyes"; then - withval="-$VERSION" + withval="-"AC_PACKAGE_VERSION ac_configure_args=`echo $ac_configure_args | sed "s,--with-version-suffix,--with-version-suffix=$withval,"` fi - lyxname="lyx$withval" - program_suffix=$withval - RPM_VERSION_SUFFIX="--with-version-suffix=$withval"], - [lyxname=lyx]) + AC_SUBST(version_suffix,$withval) + RPM_VERSION_SUFFIX="--with-version-suffix=$withval"]) AC_SUBST(RPM_VERSION_SUFFIX) -AC_MSG_RESULT([$lyxname]) +AC_MSG_RESULT([$withval]) ]) @@ -74,6 +70,14 @@ LYX_ERROR([Cannot find $1. Please check that the $2 library dnl Usage: LYX_CHECK_ERRORS Displays a warning message if a LYX_ERROR dnl has occured previously. AC_DEFUN([LYX_CHECK_ERRORS],[ +if test x$lyx_warning = xyes; then +cat </dev/null; cd / && pwd -W ) | grep ':' >/dev/null && + ac_pwd_w="pwd -W" || ac_pwd_w=pwd + until ac_val=`exec 2>/dev/null; cd "$ac_dir" && $ac_pwd_w` + do + ac_dir=`AS_DIRNAME(["$ac_dir"])` + done + ac_dir=`echo "$ac_dir" | sed 's?^[[./]]*??'` + ac_val=`echo "$ac_val" | sed 's?/*$[]??'` + $1=`echo "$2" | sed "s?^[[./]]*$ac_dir/*?$ac_val/?"' + s?/*$[]??'` +]) + +dnl this is used by the macro blow to general a proper config.h.in entry +m4_define([LYX_AH_CHECK_DECL], +[AH_TEMPLATE(AS_TR_CPP(HAVE_DECL_$1), + [Define if you have the prototype for function `$1'])]) + +dnl Check things are declared in headers to avoid errors or warnings. +dnl Called like LYX_CHECK_DECL(function, header1 header2...) +dnl Defines HAVE_DECL_{FUNCTION} +AC_DEFUN([LYX_CHECK_DECL], +[LYX_AH_CHECK_DECL($1) +for ac_header in $2 +do + AC_MSG_CHECKING([if $1 is declared by header $ac_header]) + AC_EGREP_HEADER($1, $ac_header, + [AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_DECL_$1)) + break], + [AC_MSG_RESULT(no)]) +done])