]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Call prepare_build before returning to save package configuration
[builder.git] / source / builder.cpp
index 122e1b901e011d6abafd8ea86789b86e66bb628e..209321224db7c3966195d848cbf712d01211aa50 100644 (file)
@@ -1,5 +1,4 @@
 #include <set>
-#include <cstdlib>
 #include <msp/core/getopt.h>
 #include <msp/datafile/parser.h>
 #include <msp/fs/dir.h>
@@ -188,7 +187,7 @@ Builder::Builder(int argc, char **argv):
                        prefix = (FS::get_home_dir()/"local"/current_arch->get_name()).str();
        }
        else
-               prefix = FS::getcwd()/prfx;
+               prefix = cwd/prfx;
 
        if(!temp_str.empty())
                tempdir = temp_str;
@@ -230,25 +229,6 @@ Builder::~Builder()
 
 int Builder::main()
 {
-       if(prefix.str()!="/usr")
-       {
-               FS::Path pcdir = prefix/"lib"/"pkgconfig";
-               if(const char *pcp = getenv("PKG_CONFIG_PATH"))
-               {
-                       vector<string> path = split(pcp, ':');
-                       bool found = false;
-                       for(vector<string>::const_iterator i=path.begin(); (!found && i!=path.end()); ++i)
-                               found = (*i==pcdir.str());
-                       if(!found)
-                       {
-                               path.push_back(pcdir.str());
-                               setenv("PKG_CONFIG_PATH", join(path.begin(), path.end(), ":").c_str(), true);
-                       }
-               }
-               else
-                       setenv("PKG_CONFIG_PATH", pcdir.str().c_str(), true);
-       }
-
        if(load_build_file(cwd/build_file))
        {
                if(help)
@@ -271,12 +251,12 @@ int Builder::main()
                return 0;
        }
 
-       if(conf_only)
-               return 0;
-
        if(!prepare_build())
                return 1;
 
+       if(conf_only)
+               return 0;
+
        logger.log("environment", format("Building on %s, for %s%s", native_arch.get_name(),
                current_arch->get_name(), (current_arch->is_native() ? " (native)" : "")));
        logger.log("environment", format("Prefix is %s", prefix));