]> git.lyx.org Git - lyx.git/blobdiff - src/support/Package.cpp
CMake: fix merged build, seems GCC could not handle the namespaces correctly
[lyx.git] / src / support / Package.cpp
index 7cd1fe099e96627be5e713a6ebb819fedf516197..138f06b9eefb0a89733a062bab5e50195e7ac7b5 100644 (file)
@@ -120,12 +120,7 @@ Package::Package(string const & command_line_arg0,
        document_dir_ = get_document_dir(home_dir_);
 
        FileName const abs_binary = abs_path_from_binary_name(command_line_arg0);
-       string const bdir = onlyPath(abs_binary.absFilename());
-       // We may be using libtools
-       if (suffixIs(bdir, ".libs/"))
-               binary_dir_ = FileName(addPath(bdir, "../"));
-       else
-               binary_dir_ = FileName(bdir);
+       binary_dir_ = FileName(onlyPath(abs_binary.absFilename()));
 
        // Is LyX being run in-place from the build tree?
        buildDirs(abs_binary, top_build_dir_location,
@@ -146,7 +141,7 @@ Package::Package(string const & command_line_arg0,
 
        FileName const configure_script(addName(system_support().absFilename(), "configure.py"));
        configure_command_ = os::python() + ' ' +
-                       quoteName(configure_script.toFilesystemEncoding()) +
+                       quoteName(configure_script.toFilesystemEncoding(), quote_python) +
                        with_version_suffix();
 
        LYXERR(Debug::INIT, "<package>\n"
@@ -276,9 +271,6 @@ void buildDirs(FileName const & abs_binary,
        while (true) {
                // Try and find "lyxrc.defaults".
                string binary_dir = onlyPath(binary.absFilename());
-               // We may be using libtools with static linking.
-               if (suffixIs(binary_dir, ".libs/"))
-                       binary_dir = addPath(binary_dir, "../");
                build_support_dir = buildSupportDir(binary_dir, top_build_dir_location);
                if (!fileSearch(build_support_dir.absFilename(), "Makefile").empty()) {
                        // Try and find "chkconfig.ltx".
@@ -374,8 +366,7 @@ FileName const abs_path_from_command_line(string const & command_line)
                return FileName();
 
        string const str_path = fix_dir_name(command_line);
-       FileName path(str_path);
-       return path.isAbsolute() ? path : makeAbsPath(str_path);
+       return makeAbsPath(str_path);
 }
 
 
@@ -392,9 +383,8 @@ FileName const get_binary_path(string const & exe)
 #else
        string const exe_path = os::internal_path(exe);
 #endif
-       FileName exepath(exe_path);
-       if (exepath.isAbsolute())
-               return exepath;
+       if (FileName::isAbsolute(exe_path))
+               return FileName(exe_path);
 
        // Two possibilities present themselves.
        // 1. The binary is relative to the CWD.