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: only:
- master - master
- stable - 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 # In order to generate the -l switches we need to know how Boost libraries are named
my $have_boost = 0; my $have_boost = 0;
foreach my $path (@boost_libs) {
my @files = glob "$path/libboost_system*";
next if !@files;
if ($files[0] =~ /libboost_system([^.]+)/) { # check without explicit lib path (works on Linux)
my $suffix = $1; $have_boost = 1
check_lib( if check_lib(
lib => "boost_system$suffix", lib => "boost_system",
INC => join(' ', map "-I$_", @INC, @boost_include), INC => join(' ', map "-I$_", @INC, @boost_include),
LIBS => "-L$path", LIBS => join(' ', map "-L$_", @INC, @boost_libs),
) or next; );
push @INC, (map " -I$_", @boost_include); # TODO: only use the one related to the chosen lib path if (!$have_boost) {
push @LIBS, " -L$path", (map " -lboost_$_$suffix", qw(thread system)); # we need these foreach my $path (@boost_libs) {
push @cflags, '-DBOOST_LIBS'; my @files = glob "$path/libboost_system*";
$have_boost = 1; next if !@files;
last;
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; die <<'EOF' if !$have_boost;
Slic3r requires the Boost libraries. Please make sure they are installed. Slic3r requires the Boost libraries. Please make sure they are installed.