In 1.3.x, we use the compiler to pass LOCALEDIR to main.C and to pass
LYX_DIR and TOP_SRCDIR to lyx_main.C:

g++ -DHAVE_CONFIG_H -I. -I../../src -I. -I../../boost -I/usr/include 
-isystem /usr/X11R6/include  -g -O -W -Wall
-DLOCALEDIR=\"/usr/local/share/locale\" -c ../../src/main.C

g++ -DHAVE_CONFIG_H -I. -I../../src -I. -I../../boost -I/usr/include 
-isystem /usr/X11R6/include  -g -O -W -Wall
-DLYX_DIR=\"/usr/local/share/lyx-1.3.6cvs\" \
  -DTOP_SRCDIR=\"../..\" -c ../../src/lyx_main.C

In 1.4.x, we take a different approach, using the configuration step to
generate support/path_defines.C from support/path_defines.C.in.

-       static string const ld = "%LYX_DIR%";
+       static string const ld = "/usr/local/share/lyx-1.4.0cvs";

-       static string const lts = "%TOP_SRCDIR%";
+       static string const lts = "/home/angus/lyx/devel";

-       static string const ll = "%LOCALEDIR%";
+       static string const ll = "/usr/local/share/locale";

-       static string const bl = "%BUILDDIR%";
+       static string const bl = "/home/angus/lyx/devel/build";

Should I do the same with support/package.C? Ie, pass it LOCALEDIR, LYX_DIR
and TOP_SRCDIR through the compiler in 1.3.x and generate it from
support/package.C.in in 1.4.x.?

Incidentally, "%BUILDDIR%" (returned by build_dir() in 1.4.x) isn't
actually used:
$ grep -r 'build_dir()' lyx/devel/src
lyx/devel/src/support/path_defines.C.in:string const & build_dir()

-- 
Angus

Reply via email to