*/
#include <msp/fs/dir.h>
+#include <msp/fs/stat.h>
#include <msp/fs/utils.h>
#include "archive.h"
#include "builder.h"
FS::Path lpath=lib.get_path();
if(!builder.get_dry_run())
+ {
FS::mkpath(FS::dirname(lpath), 0755);
+ if(FS::exists(lib.get_path()))
+ FS::unlink(lib.get_path());
+ }
announce(comp.get_package().get_name(), tool, relative(lpath, work_dir).str());
{
FS::mkpath(FS::dirname(copy.dest), 0755);
- try
- {
- // Remove old file. Not doing this would cause Bad Stuff when installing libraries.
- unlink(copy.dest);
- }
- catch(const SystemError &e)
+ // Remove old file. Not doing this would cause Bad Stuff when installing libraries.
+ if(FS::exists(copy.dest))
{
- if(e.get_error_code()!=ENOENT)
+ try
+ {
+ unlink(copy.dest);
+ }
+ catch(const Exception &e)
{
IO::print(IO::cerr, "%s\n", e.what());
done=error=true;
config.add_option("optimize", "0", "Apply compiler optimizations");
config.add_option("strip", "0", "Strip symbols from programs");
config.add_option("debug", "0", "Produce debugging symbols");
- config.add_option("cpu", "auto", "CPU type to optimize for");
+ config.add_option("cpu", "none", "CPU type to optimize for");
config.add_option("staticlibs", "local", "Use static libraries");
for(FeatureList::iterator i=features.begin(); i!=features.end(); ++i)
build_info.cflags.push_back("-O"+optimize);
build_info.ldflags.push_back("-O"+optimize);
string cpu=config.get_option("cpu").value;
- if(cpu!="auto")
+ if(cpu!="none")
build_info.cflags.push_back("-march="+cpu);
}