]> git.tdb.fi Git - builder.git/commitdiff
Pass the package path to the stage1 binary
authorMikko Rasa <tdb@tdb.fi>
Thu, 21 Sep 2023 15:38:30 +0000 (18:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 21 Sep 2023 15:38:30 +0000 (18:38 +0300)
bootstrap.sh
source/bootstrap/bootstrap.cpp

index b647568cb0347aa3eb1ab77193ef7581af5fc01b..bffa9e45f6e3bc4a53864ddcef5fd3bb8f05d873 100755 (executable)
@@ -156,4 +156,4 @@ fi
 if [ "$CUSTOM_COMPILER" = "yes" ]; then
        ARGS="$ARGS --compiler=$COMPILER"
 fi
-eval "./builder-stage1 $ARGS"
+eval "./builder-stage1 --package-dir '$LIBPATH' $ARGS"
index c57a793b49a3d0d10867d085c1f44abd85129495..26fefaae8ef4beaf4317606bdc168a52e13ea3fa 100644 (file)
@@ -2,6 +2,7 @@
 #include <msp/builder/tool.h>
 #include <msp/core/getopt.h>
 #include <msp/fs/dir.h>
+#include <msp/io/print.h>
 #include "plugins/base/baseplugin.h"
 #include "plugins/gnu/gnuplugin.h"
 
@@ -12,16 +13,21 @@ Bootstrap::Bootstrap(int argc, char **argv)
 {
        string compiler;
        string prefix;
+       vector<string> package_path;
 
        GetOpt getopt;
        getopt.add_option("compiler", compiler, GetOpt::REQUIRED_ARG).set_help("Use CMD instead of gcc as compiler.", "CMD");
        getopt.add_option("prefix", prefix, GetOpt::REQUIRED_ARG).set_help("Install things to DIR.", "DIR");
+       getopt.add_option("package-dir", package_path, GetOpt::REQUIRED_ARG).set_help("Look for source packages in DIR.", "DIR");
        getopt(argc, argv);
 
        logger.enable_channel("tasks");
        builder.set_logger(&logger);
        builder.load_plugins<BasePlugin, GnuPlugin>();
 
+       for(const string &p: package_path)
+               builder.get_package_manager().append_package_path(p);
+
        if(!prefix.empty())
                builder.set_prefix(FS::getcwd()/prefix);