From a7714398d98b4ede4aaf7218bd1c811174bb1cef Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 13 Oct 2005 14:45:12 +0000 Subject: [PATCH] fix PACKAGE handling for MacOS and Windows git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10550 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 5 +++++ config/ChangeLog | 6 ++++++ config/lyxinclude.m4 | 14 +++++++------- configure.ac | 11 +++++------ src/support/ChangeLog | 5 +++++ src/support/package.C.in | 6 ++---- 6 files changed, 30 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c6efa5af4..cda83989cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-12 Jean-Marc Lasgouttes + + * configure.ac: call LYX_USE_PACKAGING early. Sanitize PACKAGE + setting. + 2005-09-30 Angus Leeming * configure.ac: check for NewAPIs.h. If found, define the diff --git a/config/ChangeLog b/config/ChangeLog index 529aa318ad..82d90a8590 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,9 @@ +2005-10-12 Jean-Marc Lasgouttes + + * lyxinclude.m4 (LYX_USE_PACKAGING): set PACKAGE depending on + packaging setting. + (LYX_VERSION_SUFFIX): honor PACKAGE value. + 2005-09-29 Angus Leeming * lyxinclude.m4: add a new MSYS_AC_CANONICAL_PATH macro that diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 13f632a0a1..40400e0c21 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -28,7 +28,7 @@ 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 install target]) RPM_VERSION_SUFFIX='""' AC_ARG_WITH(version-suffix, [ --with-version-suffix[=] install lyx files as lyx], @@ -37,12 +37,11 @@ AC_ARG_WITH(version-suffix, withval="-$VERSION" ac_configure_args=`echo $ac_configure_args | sed "s,--with-version-suffix,--with-version-suffix=$withval,"` fi - lyxname="lyx$withval" + PACKAGE="$PACKAGE$withval" program_suffix=$withval - RPM_VERSION_SUFFIX="--with-version-suffix=$withval"], - [lyxname=lyx]) + RPM_VERSION_SUFFIX="--with-version-suffix=$withval"]) 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) 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 + PACKAGE=LyX default_prefix="/Applications/LyX.app" bindir='${prefix}/Contents/MacOS' libdir='${prefix}/Contents/Resources' datadir='${prefix}/Contents/Resources' mandir='${prefix}/Contents/Resources/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 + PACKAGE=LyX default_prefix="C:/Program Files/LyX" bindir='${prefix}/bin' libdir='${prefix}/Resources' datadir='${prefix}/Resources' 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 default_prefix=$ac_default_prefix ;; *) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;; esac diff --git a/configure.ac b/configure.ac index 0e22032ade..338a6aa5f5 100644 --- a/configure.ac +++ b/configure.ac @@ -7,9 +7,12 @@ AM_CONFIG_HEADER([src/config.h]) AC_CONFIG_AUX_DIR(config) -PACKAGE=lyx${program_suffix} +# first the version VERSION="1.4.0cvs" 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 if test "${enable_maintainer_mode+set}" != set; then @@ -18,9 +21,7 @@ fi AM_MAINTAINER_MODE AC_CANONICAL_TARGET -LYX_VERSION_SUFFIX - -AM_INIT_AUTOMAKE($lyxname, $VERSION) +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) ### Set the execute permissions of the various scripts correctly 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 done -### Check how the files should be packaged -LYX_USE_PACKAGING # fix the value of the prefixes. test "x$prefix" = xNONE && prefix=$default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' diff --git a/src/support/ChangeLog b/src/support/ChangeLog index a399cb254e..4cf9cc87d1 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2005-10-12 Jean-Marc Lasgouttes + + * package.C.in (get_default_user_support_dir): do not play tricks + with PACKAGE value. + 2005-09-30 Angus Leeming * os_win32.h: new file, providing a public and portable interface diff --git a/src/support/package.C.in b/src/support/package.C.in index 1ddcb1f4a4..7c553006ed 100644 --- a/src/support/package.C.in +++ b/src/support/package.C.in @@ -591,9 +591,8 @@ string const get_default_user_support_dir(string const & home_dir) #if defined (USE_WINDOWS_PACKAGING) (void)home_dir; // Silence warning about unused variable. - string const user_dir = (string(PACKAGE) == "lyx") ? "LyX" : PACKAGE; 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) (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) return string(); - string const user_dir = (string(PACKAGE) == "lyx") ? "LyX" : PACKAGE; - return AddPath(reinterpret_cast(store), user_dir); + return AddPath(reinterpret_cast(store), PACKAGE); #else // USE_POSIX_PACKAGING return AddPath(home_dir, string(".") + PACKAGE); -- 2.39.5