dnl sets variables "lyx_devel_version" and "lyx_prerelease"
AC_DEFUN([LYX_CHECK_VERSION],[
echo "configuring LyX version" AC_PACKAGE_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])
- LYX_DATE="not released yet"
- 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
-fi
+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)])
AC_ARG_ENABLE(concept-checks,
AC_HELP_STRING([--enable-concept-checks],[enable concept checks]),,
- [ if test $lyx_devel_version = yes -o $lyx-prerelease = yes ; then
+ [ if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then
enable_concept_checks=yes;
else
enable_concept_checks=no;
[AC_MSG_CHECKING([what frontend should be used for the GUI])
AC_ARG_WITH(frontend,
[ --with-frontend=THIS Use THIS frontend as main GUI:
- Possible values: qt3, qt4, gtk],
- [FRONTENDS="$withval"])
+ Possible values: qt4],
+ [FRONTENDS="$withval"],[FRONTENDS="qt4"])
if test "x$FRONTENDS" = x ; then
AC_MSG_RESULT(none)
AC_ERROR("Please select a frontend using --with-frontend")
*) 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}
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}"
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)
])
$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])