X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=config%2Flyxinclude.m4;h=eb60d86259197b247b459962d9fbb24d2b66b208;hb=2debd7d78034a4575d19012392de49ef96b256d6;hp=d1a657782cf898c50d88e9cfbdfe24778cceb748;hpb=27b4472dfd4a2cb0e6b15c205eb7ecadabb857ae;p=lyx.git diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index d1a657782c..eb60d86259 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -7,19 +7,31 @@ 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 AC_PACKAGE_VERSION | grep 'svn' >/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 AC_PACKAGE_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 +echo "configuring LyX version" AC_PACKAGE_VERSION +lyx_devel_version=no +lyx_prerelease=no +build_type=release +AC_MSG_CHECKING([for build type]) +AC_ARG_ENABLE(build-type, + AC_HELP_STRING([--enable-build-type=TYPE],[set build setting according to TYPE=dev(elopment), rel(ease) or pre(release)]), + [case $enableval in + dev*) lyx_devel_version=yes + build_type=development;; + pre*) lyx_prerelease=yes + build_type=prerelease;; + rel*) ;; + *) AC_ERROR([Bad build type specification \"$enableval\". Please use one of dev(elopment), rel(ease) or pre(release)]);; + esac], + [case AC_PACKAGE_VERSION in + *svn*) lyx_devel_version=yes + build_type=development;; + *pre*|*alpha*|*beta*|*rc*) lyx_prerelease=yes + build_type=prerelease;; + esac]) +AC_MSG_RESULT([$build_type]) +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 AC_SUBST(lyx_devel_version)]) @@ -28,20 +40,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 - PACKAGE="$PACKAGE$withval" - program_suffix=$withval + AC_SUBST(version_suffix,$withval) RPM_VERSION_SUFFIX="--with-version-suffix=$withval"]) AC_SUBST(RPM_VERSION_SUFFIX) -AC_MSG_RESULT([$PACKAGE]) +AC_MSG_RESULT([$withval]) ]) @@ -73,6 +85,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 <