X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=config%2Flyxinclude.m4;h=eb60d86259197b247b459962d9fbb24d2b66b208;hb=2debd7d78034a4575d19012392de49ef96b256d6;hp=96f37cb2c1cfbf1a7a7cf5c418231bb0c17dffc5;hpb=8bc788c59887a5db23026c5cb5dd8a9f491049e9;p=lyx.git diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 96f37cb2c1..eb60d86259 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -10,14 +10,29 @@ AC_DEFUN([LYX_CHECK_VERSION],[ 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*)lyx_prerelease=yes - echo "WARNING: This is a prerelease. Be careful and backup your documents.";; -esac +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)]) @@ -35,7 +50,7 @@ AC_ARG_WITH(version-suffix, withval="-"AC_PACKAGE_VERSION ac_configure_args=`echo $ac_configure_args | sed "s,--with-version-suffix,--with-version-suffix=$withval,"` fi - version_suffix=$withval + AC_SUBST(version_suffix,$withval) RPM_VERSION_SUFFIX="--with-version-suffix=$withval"]) AC_SUBST(RPM_VERSION_SUFFIX) AC_MSG_RESULT([$withval]) @@ -156,6 +171,7 @@ fi AC_MSG_RESULT($CXX) AC_PROG_CXX +AC_PROG_CXXCPP ### We might want to get or shut warnings. AC_ARG_ENABLE(warnings, @@ -167,9 +183,6 @@ AC_ARG_ENABLE(warnings, fi;]) if test x$enable_warnings = xyes ; then lyx_flags="warnings $lyx_flags" - AC_DEFINE(WITH_WARNINGS, 1, - [Define this if you want to see the warning directives put here and - there by the developpers to get attention]) fi ### We might want to disable debug @@ -218,7 +231,7 @@ esac AC_ARG_ENABLE(pch, AC_HELP_STRING([--enable-pch],[enable precompiled headers]),, - enable_pch=yes;) + enable_pch=no;) lyx_pch_comp=no # set the compiler options correctly. @@ -410,12 +423,13 @@ fi]) dnl Usage: LYX_USE_INCLUDED_BOOST : select if the included boost should dnl be used. AC_DEFUN([LYX_USE_INCLUDED_BOOST],[ + AC_MSG_CHECKING([whether to use boost included library]) AC_ARG_WITH(included-boost, - [ --with-included-boost use the boost lib supplied with LyX], - [lyx_cv_with_included_boost=$withval - AC_MSG_RESULT([$with_included_boost])], + [ --without-included-boost do not use the boost lib supplied with LyX, try to find one in the system directories - compilation will abort if nothing suitable is found], + [lyx_cv_with_included_boost=$withval], [lyx_cv_with_included_boost=yes]) AM_CONDITIONAL(USE_INCLUDED_BOOST, test x$lyx_cv_with_included_boost = xyes) + AC_MSG_RESULT([$lyx_cv_with_included_boost]) ]) @@ -471,7 +485,7 @@ 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_ARG_WITH($1,[ --with-$1 specify $2]) + AC_ARG_WITH($1,[AC_HELP_STRING([--with-$1],[specify $2])]) AC_MSG_CHECKING([for $2]) if test -z "$with_$3"; then AC_CACHE_VAL(lyx_cv_$3, lyx_cv_$3=$4) @@ -555,7 +569,7 @@ AC_DEFUN([LYX_USE_FRONTENDS], AC_ARG_WITH(frontend, [ --with-frontend=THIS Use THIS frontend as main GUI: Possible values: qt4], - [FRONTENDS="$withval"]) + [FRONTENDS="$withval"],[FRONTENDS="qt4"]) if test "x$FRONTENDS" = x ; then AC_MSG_RESULT(none) AC_ERROR("Please select a frontend using --with-frontend") @@ -581,6 +595,7 @@ AC_ARG_WITH(packaging, *) lyx_use_packaging=posix;; esac]) AC_MSG_RESULT($lyx_use_packaging) +lyx_install_macosx=false case $lyx_use_packaging in macosx) AC_DEFINE(USE_MACOSX_PACKAGING, 1, [Define to 1 if LyX should use a MacOS X application bundle file layout]) PACKAGE=LyX${version_suffix} @@ -589,7 +604,8 @@ case $lyx_use_packaging in libdir='${prefix}/Contents/Resources' datadir='${prefix}/Contents/Resources' pkgdatadir='${datadir}' - mandir='${datadir}/man' ;; + mandir='${datadir}/man' + lyx_install_macosx=true ;; windows) AC_DEFINE(USE_WINDOWS_PACKAGING, 1, [Define to 1 if LyX should use a Windows-style file layout]) PACKAGE=LyX${version_suffix} default_prefix="C:/Program Files/${PACKAGE}" @@ -605,6 +621,7 @@ case $lyx_use_packaging in default_prefix=$ac_default_prefix ;; *) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;; esac +AM_CONDITIONAL(INSTALL_MACOSX, $lyx_install_macosx) AC_SUBST(pkgdatadir) AC_SUBST(program_suffix) ]) @@ -672,7 +689,7 @@ fi dnl Set VAR to the canonically resolved absolute equivalent of PATHNAME, -dnl (which may be a relative path, and need not refer to any existing +dnl (which may be a relative path, and need not refer to any existing dnl entity). dnl On Win32-MSYS build hosts, the returned path is resolved to its true @@ -694,3 +711,40 @@ AC_DEFUN([MSYS_AC_CANONICAL_PATH], $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]) + +dnl Extract the single digits from PACKAGE_VERSION and make them available. +dnl Defines LYX_MAJOR_VERSION, LYX_MINOR_VERSION, LYX_RELEASE_LEVEL, and +dnl LYX_RELEASE_PATCH, the latter being possibly equal to 0. +AC_DEFUN([LYX_SET_VERSION_INFO], +[lyx_major=`echo $PACKAGE_VERSION | sed -e 's/[[.]].*//'` + lyx_patch=`echo $PACKAGE_VERSION | sed -e "s/^$lyx_major//" -e 's/^.//'` + lyx_minor=`echo $lyx_patch | sed -e 's/[[.]].*//'` + lyx_patch=`echo $lyx_patch | sed -e "s/^$lyx_minor//" -e 's/^.//'` + lyx_release=`echo $lyx_patch | sed -e 's/[[^0-9]].*//'` + lyx_patch=`echo $lyx_patch | sed -e "s/^$lyx_release//" -e 's/^[[.]]//' -e 's/[[^0-9]].*//'` + test "x$lyx_patch" = "x" && lyx_patch=0 + AC_SUBST(LYX_MAJOR_VERSION,$lyx_major) + AC_SUBST(LYX_MINOR_VERSION,$lyx_minor) + AC_SUBST(LYX_RELEASE_LEVEL,$lyx_release) + AC_SUBST(LYX_RELEASE_PATCH,$lyx_patch) +])