]> git.lyx.org Git - lyx.git/blobdiff - src/support/package.h
hopefully fix tex2lyx linking.
[lyx.git] / src / support / package.h
index cfe1828c41b4099f440d26c2e855bdc7f2133c8c..6b70605c56833447d3169be96820f0c47da7eb44 100644 (file)
@@ -22,6 +22,16 @@ namespace support {
 
 class Package;
 
+/** When run in-place <build-dir>/src/lyx is one level up from
+ *  the <build-dir> whilst <build-dir>/src/tex2lyx/tex2lyx is
+ *  two levels up.
+ */
+enum exe_build_dir_to_top_build_dir {
+       top_build_dir_is_one_level_up,
+       top_build_dir_is_two_levels_up
+};
+
+
 /** Initialise package() with the command line data.
  *  This data is exactly as it was passed in the argv[] array.
  *
@@ -36,7 +46,8 @@ class Package;
  */
 void init_package(std::string const & command_line_arg0,
                  std::string const & command_line_system_support_dir,
-                 std::string const & command_line_user_support_dir);
+                 std::string const & command_line_user_support_dir,
+                 exe_build_dir_to_top_build_dir);
 
 /** Accessor to the global data.
  *  Asserts that init_package() has been called first.
@@ -53,14 +64,14 @@ public:
         */
        Package(std::string const & command_line_arg0,
                std::string const & command_line_system_support_dir,
-               std::string const & command_line_user_support_dir);
+               std::string const & command_line_user_support_dir,
+               exe_build_dir_to_top_build_dir);
 
        /** The directory containing the LyX executable.
         */
        std::string const & binary_dir() const;
 
        /** The top of the LyX source code tree.
-        *  Used by the GTK frontend when searching for .glade files.
         */
        std::string const & top_srcdir() const;
 
@@ -80,7 +91,7 @@ public:
 
        /** The user_support directory was set explicitly using either
         *  the -userdir command line switch or
-        *  the LYX_USERDIR_13x environment variable.
+        *  the LYX_USERDIR_14x environment variable.
         */
        bool explicit_user_support() const;
 
@@ -101,12 +112,15 @@ public:
 
        /** Used when setting the user_support directory.
         *  Used also when expanding "~/" or contracting to "~/". (filetools.C)
-        *  Used by the XForms file dialog.
         *  Used in emergencyWrite (bufferlist.C) as one possible location
         *  for the dump.
+        *  This may be empty (e. g. when run under a CGI environment)
         */
        std::string const & home_dir() const;
 
+       /// Command to run the configure script
+       std::string const & configure_command() const;
+
 private:
        std::string binary_dir_;
        std::string system_support_dir_;
@@ -116,6 +130,7 @@ private:
        mutable std::string document_dir_;
        mutable std::string temp_dir_;
        std::string home_dir_;
+       std::string configure_command_;
        bool explicit_user_support_dir_;
 };
 
@@ -177,6 +192,12 @@ std::string const & Package::home_dir() const
        return home_dir_;
 }
 
+inline
+std::string const & Package::configure_command() const
+{
+       return configure_command_;
+}
+
 } // namespace support
 } // namespace lyx