From a54edf8fbc1104cc01d4dca9ea04e2442af9c1b0 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 11 Apr 2016 22:14:12 +0200 Subject: [PATCH] Support static linking of the Boost libs --- xs/Build.PL | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xs/Build.PL b/xs/Build.PL index 3254dbeae06..6145777c7be 100644 --- a/xs/Build.PL +++ b/xs/Build.PL @@ -55,7 +55,7 @@ $have_boost = 1 lib => [ map "boost_${_}", @boost_libraries ], ); -if ($have_boost) { +if (!$ENV{SLIC3R_STATIC} && $have_boost) { push @LIBS, map "-lboost_${_}", @boost_libraries; } else { foreach my $path (@boost_libs) { @@ -71,7 +71,11 @@ if ($have_boost) { ) 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", @boost_libraries); + if ($ENV{SLIC3R_STATIC}) { + push @LIBS, map "$path/libboost_$_$suffix.a", @boost_libraries; + } else { + push @LIBS, " -L$path", (map " -lboost_$_$suffix", @boost_libraries); + } $have_boost = 1; last; }