]> git.lyx.org Git - features.git/commitdiff
Portable hard-coded paths on Windows.
authorAngus Leeming <leeming@lyx.org>
Thu, 29 Sep 2005 13:26:41 +0000 (13:26 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 29 Sep 2005 13:26:41 +0000 (13:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10496 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
config/ChangeLog
config/lyxinclude.m4
configure.ac
src/support/ChangeLog
src/support/Makefile.am

index 39e7279eae9452dca3056774ce90da955d23d78a..229dd985c0d4425381e87155f54ff2eec2fcfc88 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-29  Angus Leeming  <leeming@lyx.org>
+
+       * configure.ac: Use the new MSYS_AC_CANONICAL_PATH to generate
+       path strings that make sense on Windows as well as on Unix boxes.
+       Insert these strings into the generated Makefiles.
+
 2005-09-22  Bennett Helm  <bennett.helm@fandm.edu>
 
        * INSTALL.MacOSX: update to reflect simplified procedure.
index 355f8cca9d6c451af9b402b2d82da85b2e295ed7..529aa318ad1f757d569720b237c6c5171fcb98db 100644 (file)
@@ -1,3 +1,10 @@
+2005-09-29  Angus Leeming  <leeming@lyx.org>
+
+       * lyxinclude.m4: add a new MSYS_AC_CANONICAL_PATH macro that
+       generates a Windows native path on Windows boxes and unix native
+       path on *nix boxes. With thanks to Keith Marshall. Details can
+       be found here: http://thread.gmane.org/gmane.comp.gnu.mingw.msys/2937
+
 2005-09-22  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * lyxinclude.m4 (LYX_PROG_CXX): do not enable stdlib-debug for
index 987b91f81a79b16976215354d90406b3fda6ff42..13f632a0a1cb8e193bccdbce5c13659f6e3f20a7 100644 (file)
@@ -666,3 +666,28 @@ if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then
             [Define if mkdir takes only one argument.])
 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 entity).
+
+dnl On Win32-MSYS build hosts, the returned path is resolved to its true
+dnl native Win32 path name, (but with slashes, not backslashes).
+
+dnl On any other system, it is simply the result which would be obtained
+dnl if PATHNAME represented an existing directory, and the pwd command was
+dnl executed in that directory.
+AC_DEFUN([MSYS_AC_CANONICAL_PATH],
+[ac_dir="$2"
+ ( exec 2>/dev/null; cd / && pwd -W ) | grep ':' >/dev/null &&
+    ac_pwd_w="pwd -W" || ac_pwd_w=pwd
+ until ac_val=`exec 2>/dev/null; cd "$ac_dir" && $ac_pwd_w`
+ do
+   ac_dir=`AS_DIRNAME(["$ac_dir"])`
+ done
+ ac_dir=`echo "$ac_dir" | sed 's?^[[./]]*??'`
+ ac_val=`echo "$ac_val" | sed 's?/*$[]??'`
+ $1=`echo "$2" | sed "s?^[[./]]*$ac_dir/*?$ac_val/?"'
+   s?/*$[]??'`
+])
index ac2ebfcb5ffe7ff6c0749ef26860c46a10f5f5e5..2281d12caf5e1be53e1c5a9e3cc35543276bb419 100644 (file)
@@ -306,7 +306,6 @@ AC_CHECK_FUNCS(fcntl,, [lyx_client_subdir=false])
 AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir)
 AC_LANG_POP(C)
 
-
 AC_FUNC_SELECT_ARGTYPES
 
 ### Some information on what just happened
@@ -328,6 +327,10 @@ ${FRONTEND_INFO}\
   LyX binary dir:                 ${real_bindir}\n\
   LyX files dir:                  ${real_datadir}\n"
 
+real_localedir=`eval "echo \`eval \"echo ${datadir}/locale\"\`"`
+MSYS_AC_CANONICAL_PATH(LYX_ABS_TOP_SRCDIR, ${srcdir})
+MSYS_AC_CANONICAL_PATH(LYX_ABS_INSTALLED_LOCALEDIR, ${real_localedir})
+MSYS_AC_CANONICAL_PATH(LYX_ABS_INSTALLED_DATADIR, ${real_datadir})
 
 AC_SUBST(VERSION_INFO)
 AC_SUBST(RPM_FRONTEND)
@@ -335,6 +338,9 @@ AC_SUBST(AM_CPPFLAGS)
 AC_SUBST(AM_CXXFLAGS)
 AC_SUBST(AM_CFLAGS)
 AC_SUBST(AM_LDFLAGS)
+AC_SUBST(LYX_ABS_TOP_SRCDIR)
+AC_SUBST(LYX_ABS_INSTALLED_LOCALEDIR)
+AC_SUBST(LYX_ABS_INSTALLED_DATADIR)
 
 ## Some config.h stuff
 
index 4c03fd727faf580ae444a5a977c4289b457ee71a..7b23d465dec0ae641fc9a9cc6136f298fde42da7 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-29  Angus Leeming  <leeming@lyx.org>
+
+       * Makefile.am: use the Windows-friendly LYX_ABS_INSTALLED_LOCALEDIR
+       et al rather than the unix-centric $(localedir) when compiling
+       package.C.in.
+
 2005-09-10  Angus Leeming  <leeming@lyx.org>
 
        * Makefile.am (EXTRA_DIST): add os_cygwin.C to the distribution.
index b47361c5ccb5311850aedb764248d328ca0dcf3b..1e9187d75301e14a913f86e3b9b6dc2fabc73c5e 100644 (file)
@@ -84,11 +84,9 @@ package.C: build_package
 # Solaris sed does not like spaces bewteen the ;-delimited commands
 build_package: package.C.in
        @rm -f tmp_package ;\
-       ABS_SRCDIR=`cd $(top_srcdir) && pwd` ;\
-       ABS_BUILDDIR=`cd ../.. && pwd` ;\
-       sed "s,%LYX_DIR%,$(pkgdatadir),;\
-s,%LOCALEDIR%,$(datadir)/locale,;\
-s,%TOP_SRCDIR%,$${ABS_SRCDIR}," \
+       sed "s,%LYX_DIR%,$(LYX_ABS_INSTALLED_DATADIR),;\
+s,%LOCALEDIR%,$(LYX_ABS_INSTALLED_LOCALEDIR),;\
+s,%TOP_SRCDIR%,$(LYX_ABS_TOP_SRCDIR)," \
                $(srcdir)/package.C.in > tmp_package ;\
        if cmp -s tmp_package package.C ; then \
                rm -f tmp_package ;\