]> git.lyx.org Git - features.git/blobdiff - config/lyxinclude.m4
move and update preference file in LyX.app bundle; do not append version suffix to...
[features.git] / config / lyxinclude.m4
index 13f632a0a1cb8e193bccdbce5c13659f6e3f20a7..63e54ee23612f055b2244cc11770411c9551bc12 100644 (file)
@@ -7,15 +7,15 @@ 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
+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])
   echo "WARNING: This is a development version. Expect bugs."
 else
   lyx_devel_version=no
 fi
-if echo "$VERSION" | grep 'pre' > /dev/null ; then
+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
@@ -28,21 +28,19 @@ 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])
 RPM_VERSION_SUFFIX='""'
 AC_ARG_WITH(version-suffix,
   [  --with-version-suffix[=<version>]  install lyx files as lyx<version>],
   [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])
+   version_suffix=$withval
+   RPM_VERSION_SUFFIX="--with-version-suffix=$withval"])
 AC_SUBST(RPM_VERSION_SUFFIX)
-AC_MSG_RESULT([$lyxname])
+AC_MSG_RESULT([$withval])
 ])
 
 
@@ -587,23 +585,30 @@ AC_ARG_WITH(packaging,
 AC_MSG_RESULT($lyx_use_packaging)
 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])
-          test $PACKAGE = "lyx" && PACKAGE=LyX
-          default_prefix="/Applications/LyX.app"
+          PACKAGE=LyX${version_suffix}
+          default_prefix="/Applications/${PACKAGE}.app"
           bindir='${prefix}/Contents/MacOS'
           libdir='${prefix}/Contents/Resources'
           datadir='${prefix}/Contents/Resources'
-          mandir='${prefix}/Contents/Resources/man' ;;
+          pkgdatadir='${datadir}'
+          mandir='${datadir}/man' ;;
   windows) AC_DEFINE(USE_WINDOWS_PACKAGING, 1, [Define to 1 if LyX should use a Windows-style file layout])
-          test $PACKAGE = "lyx" && PACKAGE=LyX
-          default_prefix="C:/Program Files/LyX"
+          PACKAGE=LyX${version_suffix}
+          program_suffix=$version_suffix
+          default_prefix="C:/Program Files/${PACKAGE}"
           bindir='${prefix}/bin'
           libdir='${prefix}/Resources'
           datadir='${prefix}/Resources'
+          pkgdatadir='${datadir}'
           mandir='${prefix}/Resources/man' ;;
     posix) AC_DEFINE(USE_POSIX_PACKAGING, 1, [Define to 1 if LyX should use a POSIX-style file layout])
+          PACKAGE=lyx${version_suffix}
+          program_suffix=$version_suffix
+          pkgdatadir='${datadir}/${PACKAGE}'
           default_prefix=$ac_default_prefix ;;
     *) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;
 esac
+AC_SUBST(pkgdatadir)
 ])
 
 
@@ -637,7 +642,7 @@ ac_save_cc=$CC
 ac_save_cflags="$CFLAGS"
 CC=$CXX
 CFLAGS="$CXXFLAGS"
-AM_PROG_LIBTOOL dnl for libraries
+AC_PROG_LIBTOOL dnl for libraries
 CC=$ac_save_cc
 CFLAGS="$ac_save_cflags"
 ])