Jean-Marc,

have we decided on how best to proceed with this?

The patch does two, orthogonal things.

1. It defines LYX_ABS_TOP_SRCDIR, LYX_ABS_INSTALLED_LOCALEDIR and
LYX_ABS_INSTALLED_DATADIR in a fashion that "makes sense" on Windows
and passes these definitions to package.C through the compiler by
modifying src/support/Makefile. I think that this part of the patch
is "ready to go" now. Agree?

2 "Somehow" we need to compile
    boost/libs/filesystem/src/operations_posix_windows.cpp
    src/support/os_win32.C
with the preprocessor macros
    WANT_GETLONGPATHNAME_WRAPPER
    WANT_GETFILEATTRIBUTESEX_WRAPPER
    WINVER 0x0500
being defined. To me that means that we should add these macros to
config.h but I'd like to protect their definition with a
--enable-win95-support configure switch.

I'm perfectly happy to write the code, but I'd like agreement on the
overall approach first.

-- 
Angus
Index: configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.60
diff -u -a -u -r1.60 configure.ac
--- configure.ac	14 Sep 2005 07:53:05 -0000	1.60
+++ configure.ac	27 Sep 2005 12:21:50 -0000
@@ -306,7 +306,6 @@
 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,16 @@
   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_DEFINE_UNQUOTED(LYX_ABS_TOP_SRCDIR,${lyx_canonical_srcdir},
+#  [define this to the absolute path to the top of the LyX source tree])
+#AC_DEFINE_UNQUOTED(LYX_ABS_INSTALLED_LOCALEDIR,${lyx_canonical_localedir},
+#  [define this to the absolute path to the locale directory used by the installed LyX])
+#AC_DEFINE_UNQUOTED(LYX_ABS_INSTALLED_DATADIR,${lyx_canonical_datadir},
+#  [define this to the absolute path to the data directory used by the installed LyX])
 
 AC_SUBST(VERSION_INFO)
 AC_SUBST(RPM_FRONTEND)
@@ -335,6 +344,9 @@
 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
 
@@ -399,6 +411,15 @@
 
 #ifdef __CYGWIN__
 #define BOOST_POSIX 1
+#endif
+
+#if defined (_WIN32) || defined (__CYGWIN__)
+#define WANT_GETLONGPATHNAME_WRAPPER 1
+#endif
+
+#if defined (_WIN32)
+#define WINVER 0x0500
+#define WANT_GETFILEATTRIBUTESEX_WRAPPER 1
 #endif
 
 #endif
Index: config/lyxinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.115
diff -u -a -u -r1.115 lyxinclude.m4
--- config/lyxinclude.m4	26 Sep 2005 09:08:41 -0000	1.115
+++ config/lyxinclude.m4	27 Sep 2005 11:57:36 -0000
@@ -4,6 +4,31 @@
 dnl         Allan Rae ([EMAIL PROTECTED])
 
 
+# Set VAR to the canonically resolved absolute equivalent of PATHNAME,
+# (which may be a relative path, and need not refer to any existing 
+# entity).
+#
+# On Win32-MSYS build hosts, the returned path is resolved to its true
+# native Win32 path name, (but with slashes, not backslashes).
+#
+# On any other system, it is simply the result which would be obtained
+# if PATHNAME represented an existing directory, and the pwd command was
+# 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?/*$[]??'`
+])
+
 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],[
Index: src/support/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/Makefile.am,v
retrieving revision 1.95
diff -u -a -u -r1.95 Makefile.am
--- src/support/Makefile.am	10 Sep 2005 15:48:17 -0000	1.95
+++ src/support/Makefile.am	27 Sep 2005 11:57:36 -0000
@@ -84,11 +85,9 @@
 # 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 ;\

Reply via email to