]> git.lyx.org Git - features.git/commitdiff
I'm speeding up...
authorAngus Leeming <leeming@lyx.org>
Sun, 27 Jul 2003 20:17:31 +0000 (20:17 +0000)
committerAngus Leeming <leeming@lyx.org>
Sun, 27 Jul 2003 20:17:31 +0000 (20:17 +0000)
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

src/lyx_main.C
src/support/ChangeLog
src/support/Makefile.am
src/support/filetools.C
src/support/path_defines.C.in
src/support/path_defines.h

index 8374a021043a93b5d8a6811123e1225dfad33e45..ffd285402f9f53de57ea2c97076381f84a5a8cff 100644 (file)
@@ -65,7 +65,6 @@ extern void QuitLyX();
 extern LyXServer * lyxserver;
 
 extern string system_lyxdir;
-extern string build_lyxdir;
 extern string user_lyxdir;
 
 DebugStream lyxerr;
index 57fa3627be4bf312f87f35f389431da1e826ddac..bdbe452cdc2ee461f70d4d12fa44abbc1cc48f1e 100644 (file)
@@ -1,6 +1,13 @@
 2003-07-27  Angus Leeming  <leeming@lyx.org>
 
-       * 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  <leeming@lyx.org>
+
+       * path_defines.{h,C.in}: new files. Store/set the various lyx
        paths, lyx_dir, top_srcdir, localedir, system_lyxdir, build_lyxdir
        user_lyxdir.
        
index 55d486b7d1818466882b372bb38dd94648d10d07..f118de12d23619d27a211042f211ed195f4ebabd 100644 (file)
@@ -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 \
index ed1875f482a9ce08eb15ac3d81e22ee2047e54cf..29a8858a2b6fa827ba1df2569f1d116d3915e83a 100644 (file)
@@ -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;
 
index c55d577677a7be00a53545bf81917668b0e720b1..69f382ec1179ace472d060baeeb7614c81916007 100644 (file)
@@ -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()
 {
        //
index 0ad829afaeaac888da6d8d604a80e35405e78d44..8fd568d7a994fb324c04f79836c55748617a6630 100644 (file)
 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.
  */