From: Angus Leeming Date: Sun, 27 Jul 2003 20:17:31 +0000 (+0000) Subject: I'm speeding up... X-Git-Tag: 1.6.10~16436 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d75728c527425de9f423af4fa4c2088e00f74914;p=features.git I'm speeding up... build_lyxdir is now a function, not a global variable. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7395 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/lyx_main.C b/src/lyx_main.C index 8374a02104..ffd285402f 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -65,7 +65,6 @@ extern void QuitLyX(); extern LyXServer * lyxserver; extern string system_lyxdir; -extern string build_lyxdir; extern string user_lyxdir; DebugStream lyxerr; diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 57fa3627be..bdbe452cdc 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,6 +1,13 @@ 2003-07-27 Angus Leeming - * path_defines.{h,C.in}, : new files. Store/set the various lyx + * path_defines.{h,C.in} (build_lyxdir): is now a function, not a + global var. + + * Makefile.am: set build_lyxdir at make time. + +2003-07-27 Angus Leeming + + * path_defines.{h,C.in}: new files. Store/set the various lyx paths, lyx_dir, top_srcdir, localedir, system_lyxdir, build_lyxdir user_lyxdir. diff --git a/src/support/Makefile.am b/src/support/Makefile.am index 55d486b7d1..f118de12d2 100644 --- a/src/support/Makefile.am +++ b/src/support/Makefile.am @@ -88,8 +88,10 @@ path_defines.C: build_path_defines build_path_defines: path_defines.C.in @rm -f tmp_path_defines ;\ ABS_SRCDIR=`cd $(top_srcdir) && pwd` ;\ + ABS_BUILDDIR=`cd ../.. && pwd` ;\ sed "s,%LYX_DIR%,$(pkgdatadir), ;\ s,%LOCALEDIR%,$(datadir)/locale, ;\ + s,%BUILDDIR%,$${ABS_BUILDDIR}, ;\ s,%TOP_SRCDIR%,$${ABS_SRCDIR}," \ $(srcdir)/path_defines.C.in > tmp_path_defines ;\ if cmp -s tmp_path_defines path_defines.C ; then \ diff --git a/src/support/filetools.C b/src/support/filetools.C index ed1875f482..29a8858a2b 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -30,7 +30,8 @@ #include "filetools.h" #include "lstrings.h" #include "FileInfo.h" -#include "support/path.h" // I know it's OS/2 specific (SMiyata) +#include "path.h" +#include "path_defines.h" #include "gettext.h" #include "lyxlib.h" #include "os.h" @@ -80,7 +81,6 @@ using std::vector; using std::getline; extern string system_lyxdir; -extern string build_lyxdir; extern string user_lyxdir; namespace lyx { @@ -297,8 +297,8 @@ string const LibFileSearch(string const & dir, string const & name, if (!fullname.empty()) return fullname; - if (!build_lyxdir.empty()) - fullname = FileSearch(AddPath(build_lyxdir, dir), name, ext); + if (!build_lyxdir().empty()) + fullname = FileSearch(AddPath(build_lyxdir(), dir), name, ext); if (!fullname.empty()) return fullname; diff --git a/src/support/path_defines.C.in b/src/support/path_defines.C.in index c55d577677..69f382ec11 100644 --- a/src/support/path_defines.C.in +++ b/src/support/path_defines.C.in @@ -27,7 +27,6 @@ using std::endl; -string build_lyxdir; string system_lyxdir; string user_lyxdir; @@ -35,7 +34,7 @@ string user_lyxdir; namespace { /* The absolute path to the system-level lyx support files. - * (Compile-time value.) + * (Make-time value.) */ string const & lyx_dir() { @@ -45,7 +44,7 @@ string const & lyx_dir() /* The absolute path to the top of the lyx build tree. - * (Compile-time value.) + * (Make-time value.) */ string const & lyx_top_srcdir() { @@ -55,7 +54,7 @@ string const & lyx_top_srcdir() /* The absolute path to the system-level lyx locale directory. - * (Compile-time value.) + * (Make-time value.) */ string const & lyx_localedir() { @@ -69,6 +68,13 @@ string const & lyx_localedir() namespace lyx { namespace support { +string const & build_lyxdir() +{ + static string const bl = "%BUILDDIR%"; + return bl; +} + + bool setLyxPaths() { // diff --git a/src/support/path_defines.h b/src/support/path_defines.h index 0ad829afae..8fd568d7a9 100644 --- a/src/support/path_defines.h +++ b/src/support/path_defines.h @@ -17,6 +17,11 @@ namespace lyx { namespace support { +/* The absolute path to the lyx build directory. + * (Make-time value.) + */ +string const & build_lyxdir(); + /** \returns true if the user lyx dir existed already and did not need * to be created afresh. */