extern LyXServer * lyxserver;
extern string system_lyxdir;
-extern string build_lyxdir;
extern string user_lyxdir;
DebugStream lyxerr;
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.
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 \
#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"
using std::getline;
extern string system_lyxdir;
-extern string build_lyxdir;
extern string user_lyxdir;
namespace lyx {
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;
using std::endl;
-string build_lyxdir;
string system_lyxdir;
string user_lyxdir;
namespace {
/* The absolute path to the system-level lyx support files.
- * (Compile-time value.)
+ * (Make-time value.)
*/
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()
{
/* The absolute path to the system-level lyx locale directory.
- * (Compile-time value.)
+ * (Make-time value.)
*/
string const & lyx_localedir()
{
namespace lyx {
namespace support {
+string const & build_lyxdir()
+{
+ static string const bl = "%BUILDDIR%";
+ return bl;
+}
+
+
bool setLyxPaths()
{
//
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.
*/