Further improvements for compilation (Ubuntu)

Conflicts:

	.travis.yml
This commit is contained in:
Alessandro Ranellucci 2015-11-19 15:31:33 +01:00
parent 624c5e78db
commit c149420d23
2 changed files with 30 additions and 16 deletions

View file

@ -9,4 +9,7 @@ branches:
only:
- master
- stable
before_script:
- sudo add-apt-repository ppa:boost-latest/ppa
- sudo apt-get update -qq
- sudo apt-get install libboost-thread1.55-dev libboost-system1.55-dev

View file

@ -43,25 +43,36 @@ 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;
foreach my $path (@boost_libs) {
my @files = glob "$path/libboost_system*";
next if !@files;
if ($files[0] =~ /libboost_system([^.]+)/) {
my $suffix = $1;
check_lib(
lib => "boost_system$suffix",
INC => join(' ', map "-I$_", @INC, @boost_include),
LIBS => "-L$path",
) or next;
# 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),
);
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 @cflags, '-DBOOST_LIBS';
$have_boost = 1;
last;
if (!$have_boost) {
foreach my $path (@boost_libs) {
my @files = glob "$path/libboost_system*";
next if !@files;
if ($files[0] =~ /libboost_system([^.]+)/) {
my $suffix = $1;
check_lib(
lib => "boost_system$suffix",
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
$have_boost = 1;
last;
}
}
}
push @cflags, '-DBOOST_LIBS' if $have_boost;
die <<'EOF' if !$have_boost;
Slic3r requires the Boost libraries. Please make sure they are installed.