Fix compilation with GCC

This commit is contained in:
Alessandro Ranellucci 2015-12-18 13:40:57 +01:00
parent 44825d91af
commit b8f0391934
2 changed files with 15 additions and 16 deletions

View file

@ -47,17 +47,16 @@ if (defined $ENV{BOOST_DIR}) {
# In order to generate the -l switches we need to know how Boost libraries are named
my $have_boost = 0;
my @boost_libraries = qw(system thread); # we need these
# check without explicit lib path (works on Linux)
$have_boost = 1
if check_lib(
lib => "boost_system",
INC => join(' ', map "-I$_", @INC, @boost_include),
LIBS => join(' ', map "-L$_", @INC, @boost_libs),
lib => [ map "boost_${_}", @boost_libraries ],
);
if ($have_boost) {
push @LIBS, '-lboost_system', '-lboost_thread';
push @LIBS, map "-l$_", @boost_libraries;
} else {
foreach my $path (@boost_libs) {
my @files = glob "$path/libboost_system*";
@ -66,13 +65,13 @@ if ($have_boost) {
if ($files[0] =~ /libboost_system([^.]+)/) {
my $suffix = $1;
check_lib(
lib => "boost_system$suffix",
lib => [ map "boost_${_}${suffix}", @boost_libraries ],
INC => join(' ', map "-I$_", @INC, @boost_include),
LIBS => "-L$path",
) or next;
push @INC, (map " -I$_", @boost_include); # TODO: only use the one related to the chosen lib path
push @LIBS, " -L$path", (map " -lboost_$_$suffix", qw(thread system)); # we need these
push @LIBS, " -L$path", (map " -lboost_$_$suffix", @boost_libraries);
$have_boost = 1;
last;
}

View file

@ -74,8 +74,8 @@ class ConfigOptionVector : public ConfigOptionVectorBase
class ConfigOptionFloat : public ConfigOptionSingle<double>
{
public:
ConfigOptionFloat() : ConfigOptionSingle(0) {};
ConfigOptionFloat(double _value) : ConfigOptionSingle(_value) {};
ConfigOptionFloat() : ConfigOptionSingle<double>(0) {};
ConfigOptionFloat(double _value) : ConfigOptionSingle<double>(_value) {};
double getFloat() const { return this->value; };
@ -131,8 +131,8 @@ class ConfigOptionFloats : public ConfigOptionVector<double>
class ConfigOptionInt : public ConfigOptionSingle<int>
{
public:
ConfigOptionInt() : ConfigOptionSingle(0) {};
ConfigOptionInt(double _value) : ConfigOptionSingle(_value) {};
ConfigOptionInt() : ConfigOptionSingle<int>(0) {};
ConfigOptionInt(double _value) : ConfigOptionSingle<int>(_value) {};
int getInt() const { return this->value; };
void setInt(int val) { this->value = val; };
@ -189,8 +189,8 @@ class ConfigOptionInts : public ConfigOptionVector<int>
class ConfigOptionString : public ConfigOptionSingle<std::string>
{
public:
ConfigOptionString() : ConfigOptionSingle("") {};
ConfigOptionString(std::string _value) : ConfigOptionSingle(_value) {};
ConfigOptionString() : ConfigOptionSingle<std::string>("") {};
ConfigOptionString(std::string _value) : ConfigOptionSingle<std::string>(_value) {};
std::string serialize() const {
std::string str = this->value;
@ -314,8 +314,8 @@ class ConfigOptionFloatOrPercent : public ConfigOptionPercent
class ConfigOptionPoint : public ConfigOptionSingle<Pointf>
{
public:
ConfigOptionPoint() : ConfigOptionSingle(Pointf(0,0)) {};
ConfigOptionPoint(Pointf _value) : ConfigOptionSingle(_value) {};
ConfigOptionPoint() : ConfigOptionSingle<Pointf>(Pointf(0,0)) {};
ConfigOptionPoint(Pointf _value) : ConfigOptionSingle<Pointf>(_value) {};
std::string serialize() const {
std::ostringstream ss;
@ -383,8 +383,8 @@ class ConfigOptionPoints : public ConfigOptionVector<Pointf>
class ConfigOptionBool : public ConfigOptionSingle<bool>
{
public:
ConfigOptionBool() : ConfigOptionSingle(false) {};
ConfigOptionBool(bool _value) : ConfigOptionSingle(_value) {};
ConfigOptionBool() : ConfigOptionSingle<bool>(false) {};
ConfigOptionBool(bool _value) : ConfigOptionSingle<bool>(_value) {};
bool getBool() const { return this->value; };