#include <msp/io/print.h>
#include <msp/strings/format.h>
#include <msp/strings/utils.h>
-#include <msp/time/units.h>
+#include <msp/time/timedelta.h>
#include <msp/time/utils.h>
#include "binarypackage.h"
#include "builder.h"
{
// Package source not found - create a binary package
string flags_str = run_pkgconfig(name, "flags");
- vector<string> flags = split(flags_str);
- Package *pkg = BinaryPackage::from_flags(builder, name, flags);
+ BinaryPackage::Flags flags = split(flags_str);
+ flags_str = run_pkgconfig(name, "staticflags");
+ BinaryPackage::Flags static_flags = split(flags_str);
+ Package *pkg = BinaryPackage::from_flags(builder, name, flags, static_flags);
packages.insert(PackageMap::value_type(name, pkg));
return pkg;
}
catch(...)
{
- builder.problem(name, "not found");
not_found.insert(name);
return 0;
}
string PackageManager::run_pkgconfig(const string &pkg, const string &what)
{
+#ifndef _WIN32
if(!env_set)
{
const FS::Path &prefix = builder.get_prefix();
argv.push_back("pkg-config");
if(what=="cflags" || what=="libs")
argv.push_back("--"+what);
- else if(what=="flags")
+ else if(what=="flags" || what=="staticflags")
{
argv.push_back("--cflags");
argv.push_back("--libs");
+ if(what=="staticflags")
+ argv.push_back("--static");
}
else
argv.push_back("--variable="+what);
builder.get_logger().log("auxcommands", format("Running %s", join(argv.begin(), argv.end())));
return ExternalTask::run_and_capture_output(argv);
+#else
+ (void)pkg;
+ (void)what;
+ return string();
+#endif
}
FS::Path PackageManager::get_package_location(const string &name)