fix PACKAGE handling for MacOS and Windows

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10550 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2005-10-13 14:45:12 +00:00
parent 0ce45c32b6
commit a7714398d9
6 changed files with 30 additions and 17 deletions

View File

@ -1,3 +1,8 @@
2005-10-12 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* configure.ac: call LYX_USE_PACKAGING early. Sanitize PACKAGE
setting.
2005-09-30 Angus Leeming <leeming@lyx.org> 2005-09-30 Angus Leeming <leeming@lyx.org>
* configure.ac: check for NewAPIs.h. If found, define the * configure.ac: check for NewAPIs.h. If found, define the

View File

@ -1,3 +1,9 @@
2005-10-12 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lyxinclude.m4 (LYX_USE_PACKAGING): set PACKAGE depending on
packaging setting.
(LYX_VERSION_SUFFIX): honor PACKAGE value.
2005-09-29 Angus Leeming <leeming@lyx.org> 2005-09-29 Angus Leeming <leeming@lyx.org>
* lyxinclude.m4: add a new MSYS_AC_CANONICAL_PATH macro that * lyxinclude.m4: add a new MSYS_AC_CANONICAL_PATH macro that

View File

@ -28,7 +28,7 @@ dnl Define the option to set a LyX version on installed executables and director
dnl dnl
dnl dnl
AC_DEFUN([LYX_VERSION_SUFFIX],[ AC_DEFUN([LYX_VERSION_SUFFIX],[
AC_MSG_CHECKING([for install target ... ]) AC_MSG_CHECKING([for install target])
RPM_VERSION_SUFFIX='""' RPM_VERSION_SUFFIX='""'
AC_ARG_WITH(version-suffix, AC_ARG_WITH(version-suffix,
[ --with-version-suffix[=<version>] install lyx files as lyx<version>], [ --with-version-suffix[=<version>] install lyx files as lyx<version>],
@ -37,12 +37,11 @@ AC_ARG_WITH(version-suffix,
withval="-$VERSION" withval="-$VERSION"
ac_configure_args=`echo $ac_configure_args | sed "s,--with-version-suffix,--with-version-suffix=$withval,"` ac_configure_args=`echo $ac_configure_args | sed "s,--with-version-suffix,--with-version-suffix=$withval,"`
fi fi
lyxname="lyx$withval" PACKAGE="$PACKAGE$withval"
program_suffix=$withval program_suffix=$withval
RPM_VERSION_SUFFIX="--with-version-suffix=$withval"], RPM_VERSION_SUFFIX="--with-version-suffix=$withval"])
[lyxname=lyx])
AC_SUBST(RPM_VERSION_SUFFIX) AC_SUBST(RPM_VERSION_SUFFIX)
AC_MSG_RESULT([$lyxname]) AC_MSG_RESULT([$PACKAGE])
]) ])
@ -587,20 +586,21 @@ AC_ARG_WITH(packaging,
AC_MSG_RESULT($lyx_use_packaging) AC_MSG_RESULT($lyx_use_packaging)
case $lyx_use_packaging in 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]) 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 PACKAGE=LyX
default_prefix="/Applications/LyX.app" default_prefix="/Applications/LyX.app"
bindir='${prefix}/Contents/MacOS' bindir='${prefix}/Contents/MacOS'
libdir='${prefix}/Contents/Resources' libdir='${prefix}/Contents/Resources'
datadir='${prefix}/Contents/Resources' datadir='${prefix}/Contents/Resources'
mandir='${prefix}/Contents/Resources/man' ;; mandir='${prefix}/Contents/Resources/man' ;;
windows) AC_DEFINE(USE_WINDOWS_PACKAGING, 1, [Define to 1 if LyX should use a Windows-style file layout]) windows) AC_DEFINE(USE_WINDOWS_PACKAGING, 1, [Define to 1 if LyX should use a Windows-style file layout])
test $PACKAGE = "lyx" && PACKAGE=LyX PACKAGE=LyX
default_prefix="C:/Program Files/LyX" default_prefix="C:/Program Files/LyX"
bindir='${prefix}/bin' bindir='${prefix}/bin'
libdir='${prefix}/Resources' libdir='${prefix}/Resources'
datadir='${prefix}/Resources' datadir='${prefix}/Resources'
mandir='${prefix}/Resources/man' ;; mandir='${prefix}/Resources/man' ;;
posix) AC_DEFINE(USE_POSIX_PACKAGING, 1, [Define to 1 if LyX should use a POSIX-style file layout]) posix) AC_DEFINE(USE_POSIX_PACKAGING, 1, [Define to 1 if LyX should use a POSIX-style file layout])
PACKAGE=lyx
default_prefix=$ac_default_prefix ;; default_prefix=$ac_default_prefix ;;
*) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;; *) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;
esac esac

View File

@ -7,9 +7,12 @@ AM_CONFIG_HEADER([src/config.h])
AC_CONFIG_AUX_DIR(config) AC_CONFIG_AUX_DIR(config)
PACKAGE=lyx${program_suffix} # first the version
VERSION="1.4.0cvs" VERSION="1.4.0cvs"
LYX_CHECK_VERSION LYX_CHECK_VERSION
# Check how the files should be packaged
LYX_USE_PACKAGING
LYX_VERSION_SUFFIX
dnl default maintainer mode to true for development versions dnl default maintainer mode to true for development versions
if test "${enable_maintainer_mode+set}" != set; then if test "${enable_maintainer_mode+set}" != set; then
@ -18,9 +21,7 @@ fi
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
LYX_VERSION_SUFFIX AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AM_INIT_AUTOMAKE($lyxname, $VERSION)
### Set the execute permissions of the various scripts correctly ### Set the execute permissions of the various scripts correctly
for file in config/install-sh config/mkinstalldirs lib/configure ; do for file in config/install-sh config/mkinstalldirs lib/configure ; do
@ -227,8 +228,6 @@ dnl qt build will fail without moc or uic
esac esac
done done
### Check how the files should be packaged
LYX_USE_PACKAGING
# fix the value of the prefixes. # fix the value of the prefixes.
test "x$prefix" = xNONE && prefix=$default_prefix test "x$prefix" = xNONE && prefix=$default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

View File

@ -1,3 +1,8 @@
2005-10-12 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* package.C.in (get_default_user_support_dir): do not play tricks
with PACKAGE value.
2005-09-30 Angus Leeming <leeming@lyx.org> 2005-09-30 Angus Leeming <leeming@lyx.org>
* os_win32.h: new file, providing a public and portable interface * os_win32.h: new file, providing a public and portable interface

View File

@ -591,9 +591,8 @@ string const get_default_user_support_dir(string const & home_dir)
#if defined (USE_WINDOWS_PACKAGING) #if defined (USE_WINDOWS_PACKAGING)
(void)home_dir; // Silence warning about unused variable. (void)home_dir; // Silence warning about unused variable.
string const user_dir = (string(PACKAGE) == "lyx") ? "LyX" : PACKAGE;
os::GetFolderPath win32_folder_path; os::GetFolderPath win32_folder_path;
return AddPath(win32_folder_path(os::GetFolderPath::APPDATA), user_dir); return AddPath(win32_folder_path(os::GetFolderPath::APPDATA), PACKAGE);
#elif defined (USE_MACOSX_PACKAGING) #elif defined (USE_MACOSX_PACKAGING)
(void)home_dir; // Silence warning about unused variable. (void)home_dir; // Silence warning about unused variable.
@ -612,8 +611,7 @@ string const get_default_user_support_dir(string const & home_dir)
if (status_code != 0) if (status_code != 0)
return string(); return string();
string const user_dir = (string(PACKAGE) == "lyx") ? "LyX" : PACKAGE; return AddPath(reinterpret_cast<char const *>(store), PACKAGE);
return AddPath(reinterpret_cast<char const *>(store), user_dir);
#else // USE_POSIX_PACKAGING #else // USE_POSIX_PACKAGING
return AddPath(home_dir, string(".") + PACKAGE); return AddPath(home_dir, string(".") + PACKAGE);