Jean-Marc Lasgouttes wrote:
> Angus> Any help?
>
> Well, I guess this needs experimenting on a mingw host, which I do not
> have...
>
> All I can say is that you need to pass `echo ${datadir}` to evaluate
> the ${prefix} part.
Got it!
The attached patch adds these entries to config.h
+/* define this to the absolute path to the data directory used by the
+ installed LyX */
+#define LYX_ABS_INSTALLED_DATADIR /usr/local/share/lyx-1.4.0cvs
+
+/* define this to the absolute path to the locale directory used by the
+ installed LyX */
+#define LYX_ABS_INSTALLED_LOCALEDIR /usr/local/share/locale
+
+/* define this to the absolute path to the top of the LyX source tree */
+#define LYX_ABS_TOP_SRCDIR /home/angus/lyx/devel
Doing this would allow us to remove the package.C.in special casing from
src/support/Makefile.am and to store package.C in the repository.
Alternatively, I could add AC_SUBST entries to configure.ac and modify the
Makefile.am appropriately.
Which strategy do you prefer?
--
Angus
Index: configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.60
diff -u -p -r1.60 configure.ac
--- configure.ac 14 Sep 2005 07:53:05 -0000 1.60
+++ configure.ac 27 Sep 2005 11:30:32 -0000
@@ -306,7 +306,6 @@ AC_CHECK_FUNCS(fcntl,, [lyx_client_subdi
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 @@ ${FRONTEND_INFO}\
LyX binary dir: ${real_bindir}\n\
LyX files dir: ${real_datadir}\n"
+MSYS_AC_CANONICAL_PATH(lyx_canonical_srcdir, ${srcdir})
+AC_DEFINE_UNQUOTED(LYX_ABS_TOP_SRCDIR,${lyx_canonical_srcdir},
+ [define this to the absolute path to the top of the LyX source tree])
+real_localedir=`eval "echo \`eval \"echo ${datadir}/locale\"\`"`
+MSYS_AC_CANONICAL_PATH(lyx_canonical_localedir, ${real_localedir})
+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])
+MSYS_AC_CANONICAL_PATH(lyx_canonical_datadir, ${real_datadir})
+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)
Index: config/lyxinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.115
diff -u -p -r1.115 lyxinclude.m4
--- config/lyxinclude.m4 26 Sep 2005 09:08:41 -0000 1.115
+++ config/lyxinclude.m4 27 Sep 2005 11:30:33 -0000
@@ -4,6 +4,31 @@ dnl Lars Gullik Bjønnes (larsbj@
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],[