2013-06-22 15:16:45 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
2014-11-26 21:30:25 +00:00
|
|
|
use Devel::CheckLib;
|
2014-04-28 17:23:29 +00:00
|
|
|
use ExtUtils::CppGuess;
|
2013-06-22 15:16:45 +00:00
|
|
|
use Module::Build::WithXSpp;
|
|
|
|
|
2017-03-23 14:06:22 +00:00
|
|
|
# Link boost & TBB statically by default on Windows & OSX.
|
|
|
|
$ENV{SLIC3R_STATIC} = 1 if ($^O eq 'MSWin32' || $^O eq 'darwin') && (! defined($ENV{SLIC3R_DYNAMIC}) || $ENV{SLIC3R_DYNAMIC} != 1);
|
|
|
|
|
2016-08-21 19:46:17 +00:00
|
|
|
my $cpp_guess = ExtUtils::CppGuess->new;
|
|
|
|
my $mswin = $^O eq 'MSWin32';
|
2017-03-07 15:33:36 +00:00
|
|
|
my $lib_ext = $ENV{SLIC3R_STATIC} ? ($cpp_guess->is_msvc ? '.lib' : '.a') : ${$cpp_guess}{config}{lib_ext};
|
2016-08-21 19:46:17 +00:00
|
|
|
|
2017-03-07 12:03:14 +00:00
|
|
|
# Library paths to search for boost, thread building blocks and such.
|
|
|
|
# On Windows, there is really no standard. On Unices, this is a bit better.
|
|
|
|
my @library_path_prefixes = ();
|
|
|
|
if ($mswin) {
|
|
|
|
@library_path_prefixes = ("C:\\", "C:\\dev\\", "C:\\local\\", "D:\\", "D:\\dev\\", "D:\\local\\");
|
|
|
|
} else {
|
|
|
|
@library_path_prefixes = qw(/opt/local/ /usr/local/ /opt/ /usr/);
|
|
|
|
}
|
|
|
|
|
2014-04-28 17:23:29 +00:00
|
|
|
# _GLIBCXX_USE_C99 : to get the long long type for g++
|
|
|
|
# HAS_BOOL : stops Perl/lib/CORE/handy.h from doing "# define bool char" for MSVC
|
|
|
|
# NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
|
2015-11-19 12:17:52 +00:00
|
|
|
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
|
2016-09-14 14:31:26 +00:00
|
|
|
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE -DGLEW_STATIC);
|
2015-12-04 20:25:45 +00:00
|
|
|
my @ldflags = ();
|
|
|
|
if ($^O eq 'darwin') {
|
|
|
|
push @ldflags, qw(-framework IOKit -framework CoreFoundation);
|
|
|
|
}
|
2016-08-21 19:46:17 +00:00
|
|
|
if ($mswin) {
|
|
|
|
# In case windows.h is included, we don't want the min / max macros to be active.
|
|
|
|
# If <math.h> is included, we want the #defines to be active (M_PI etc.)
|
2016-09-14 14:31:26 +00:00
|
|
|
push @cflags, qw(-D_WIN32 -DNOMINMAX -D_USE_MATH_DEFINES);
|
2016-08-21 19:46:17 +00:00
|
|
|
}
|
2016-11-16 12:00:36 +00:00
|
|
|
if (! $cpp_guess->is_msvc) {
|
|
|
|
# Don't use the version flag on MS Visual Studio, as it starts to recognize them up to 2015 and it uses different syntax.
|
|
|
|
push @cflags, qw(-std=c++11);
|
|
|
|
}
|
2014-11-26 21:30:25 +00:00
|
|
|
|
2016-09-12 14:25:15 +00:00
|
|
|
my @early_includes = ();
|
2017-03-29 16:19:57 +00:00
|
|
|
my @INC = qw(-Isrc/libslic3r -Isrc/glew/include -Isrc/eigen);
|
2016-08-21 19:46:17 +00:00
|
|
|
my @LIBS = $cpp_guess->is_msvc ? qw(-LIBPATH:src/libslic3r) : qw(-Lsrc/libslic3r);
|
2016-09-14 14:31:26 +00:00
|
|
|
|
2017-03-23 14:06:22 +00:00
|
|
|
$ENV{SLIC3R_GUI} = 1 if ! defined($ENV{SLIC3R_NOGUI}) || $ENV{SLIC3R_NOGUI} != 1;
|
2017-03-16 13:09:42 +00:00
|
|
|
|
2017-02-26 20:46:33 +00:00
|
|
|
if ($ENV{SLIC3R_GUI} || $ENV{SLIC3R_PRUS})
|
2016-09-12 14:25:15 +00:00
|
|
|
{
|
|
|
|
print "Slic3r will be built with GUI support\n";
|
|
|
|
require Alien::wxWidgets;
|
|
|
|
Alien::wxWidgets->load;
|
|
|
|
push @INC, Alien::wxWidgets->include_path;
|
2017-02-26 20:46:33 +00:00
|
|
|
push @cflags, qw(-DSLIC3R_GUI) if $ENV{SLIC3R_GUI};
|
|
|
|
push @cflags, qw(-DSLIC3R_PRUS -DUNICODE), Alien::wxWidgets->defines, Alien::wxWidgets->c_flags;
|
|
|
|
my $alienwx_libraries = Alien::wxWidgets->libraries($ENV{SLIC3R_GUI} ? qw(gl html) : qw(base));
|
2016-09-12 14:25:15 +00:00
|
|
|
$alienwx_libraries =~ s/-L/-LIBPATH:/g if ($cpp_guess->is_msvc);
|
|
|
|
push @ldflags, Alien::wxWidgets->link_flags, $alienwx_libraries;
|
|
|
|
# push @early_includes, qw(slic3r/GUI/wxinit.h);
|
|
|
|
}
|
2014-11-26 21:30:25 +00:00
|
|
|
|
2016-11-16 21:10:04 +00:00
|
|
|
if ($ENV{SLIC3R_PROFILE})
|
|
|
|
{
|
|
|
|
print "Slic3r will be built with a Shiny invasive profiler\n";
|
|
|
|
push @cflags, qw(-DSLIC3R_PROFILE);
|
|
|
|
}
|
|
|
|
|
2016-11-08 09:49:32 +00:00
|
|
|
if ($ENV{SLIC3R_HAS_BROKEN_CROAK})
|
|
|
|
{
|
|
|
|
# Some Strawberry Perl builds (mainly the latest 64bit builds) have a broken mechanism
|
|
|
|
# for emiting Perl exception after handling a C++ exception. Perl interpreter
|
|
|
|
# simply hangs. Better to show a message box in that case and stop the application.
|
|
|
|
push @cflags, qw(-DSLIC3R_HAS_BROKEN_CROAK)
|
|
|
|
}
|
|
|
|
|
2015-11-06 10:03:45 +00:00
|
|
|
# search for Boost in a number of places
|
2016-08-21 19:46:17 +00:00
|
|
|
my @boost_include = ();
|
|
|
|
if (defined $ENV{BOOST_INCLUDEDIR}) {
|
|
|
|
push @boost_include, $ENV{BOOST_INCLUDEDIR}
|
|
|
|
} elsif (defined $ENV{BOOST_DIR}) {
|
|
|
|
my $subdir = $ENV{BOOST_DIR} . (($mswin == 1) ? '\include' : '/include');
|
|
|
|
if (-d $subdir) {
|
|
|
|
push @boost_include, $subdir;
|
2014-11-26 21:30:25 +00:00
|
|
|
} else {
|
2015-11-06 10:03:45 +00:00
|
|
|
push @boost_include, $ENV{BOOST_DIR};
|
2014-11-26 21:30:25 +00:00
|
|
|
}
|
|
|
|
} else {
|
2016-09-12 11:26:17 +00:00
|
|
|
# Boost library was not defined by the environment.
|
|
|
|
# Try to guess at some default paths.
|
|
|
|
if ($mswin) {
|
2017-03-07 12:03:14 +00:00
|
|
|
for my $path (map glob($_ . 'boost*\include'), @library_path_prefixes) {
|
2015-11-06 10:03:45 +00:00
|
|
|
push @boost_include, $path;
|
2015-11-05 10:02:12 +00:00
|
|
|
}
|
2016-08-21 19:46:17 +00:00
|
|
|
if (! @boost_include) {
|
|
|
|
# No boost\include. Try to include the boost root.
|
2017-03-07 12:03:14 +00:00
|
|
|
for my $path (map glob($_ . 'boost*'), @library_path_prefixes) {
|
2016-08-21 19:46:17 +00:00
|
|
|
push @boost_include, $path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2017-03-07 12:03:14 +00:00
|
|
|
@boost_include = grep { -d $_ . '/boost' } map { $_ . 'include' } @library_path_prefixes;
|
2016-08-21 19:46:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
my @boost_libs = ();
|
|
|
|
if (defined $ENV{BOOST_LIBRARYDIR}) {
|
2017-03-07 12:03:14 +00:00
|
|
|
push @boost_libs, $ENV{BOOST_LIBRARYDIR};
|
2016-08-21 19:46:17 +00:00
|
|
|
} elsif (defined $ENV{BOOST_DIR}) {
|
|
|
|
my $subdir = $ENV{BOOST_DIR} . ($mswin ? '\stage\lib' : '/stage/lib');
|
|
|
|
if (-d $subdir) {
|
|
|
|
push @boost_libs, $subdir;
|
|
|
|
} else {
|
|
|
|
push @boost_libs, $ENV{BOOST_DIR};
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
# Boost library was not defined by the environment.
|
|
|
|
# Try to guess at some default paths.
|
|
|
|
if ($mswin) {
|
2017-03-07 12:03:14 +00:00
|
|
|
for my $path (map (glob($_ . 'boost*\lib'), glob($_ . 'boost*\stage\lib')), @library_path_prefixes) {
|
2016-08-21 19:46:17 +00:00
|
|
|
push @boost_libs, $path;
|
|
|
|
}
|
|
|
|
} else {
|
2017-03-07 12:03:14 +00:00
|
|
|
push @boost_libs, grep { -d $_ } map $_ . 'lib', @library_path_prefixes;
|
2015-11-05 10:02:12 +00:00
|
|
|
}
|
2014-11-26 21:30:25 +00:00
|
|
|
}
|
|
|
|
|
2015-11-06 10:03:45 +00:00
|
|
|
# In order to generate the -l switches we need to know how Boost libraries are named
|
2015-11-06 09:43:11 +00:00
|
|
|
my $have_boost = 0;
|
2017-08-03 15:31:31 +00:00
|
|
|
my @boost_libraries = qw(system thread filesystem locale log); # we need these
|
2015-11-19 14:30:27 +00:00
|
|
|
|
2016-12-14 15:51:27 +00:00
|
|
|
if (!$ENV{SLIC3R_STATIC}) {
|
|
|
|
# Dynamic linking of boost libraries.
|
2017-08-03 15:31:31 +00:00
|
|
|
push @cflags, qw(-DBOOST_LOG_DYN_LINK -DBOOST_LOCALE_DYN_LINK);
|
2016-12-14 15:51:27 +00:00
|
|
|
if (! $mswin) {
|
|
|
|
# Check without explicit lib path (works on Linux and OSX).
|
|
|
|
$have_boost = 1
|
|
|
|
if check_lib(
|
|
|
|
lib => [ map "boost_${_}", @boost_libraries ],
|
|
|
|
);
|
|
|
|
}
|
2016-08-21 19:46:17 +00:00
|
|
|
}
|
2015-11-19 14:30:27 +00:00
|
|
|
|
2016-12-14 14:43:26 +00:00
|
|
|
if ($have_boost) {
|
2016-08-21 19:46:17 +00:00
|
|
|
# The boost library was detected by check_lib on Linux.
|
2015-12-18 12:49:22 +00:00
|
|
|
push @LIBS, map "-lboost_${_}", @boost_libraries;
|
2015-11-19 16:02:01 +00:00
|
|
|
} else {
|
2016-08-21 19:46:17 +00:00
|
|
|
# Either static linking, or check_lib could not be used to find the boost libraries.
|
|
|
|
my $lib_prefix = 'libboost_';
|
|
|
|
PATH: foreach my $path (@boost_libs) {
|
|
|
|
# Try to find the boost system library.
|
|
|
|
my @files = glob "$path/${lib_prefix}system*$lib_ext";
|
2015-11-19 14:30:27 +00:00
|
|
|
next if !@files;
|
2016-11-28 19:28:50 +00:00
|
|
|
if ($files[0] =~ /\Q${lib_prefix}system\E([^.]*)\Q$lib_ext\E$/) {
|
2016-08-21 19:46:17 +00:00
|
|
|
# Suffix contains the version number, the build type etc.
|
2015-11-19 14:30:27 +00:00
|
|
|
my $suffix = $1;
|
2016-08-21 19:46:17 +00:00
|
|
|
# Verify existence of all required boost libraries at $path.
|
|
|
|
for my $lib (map "${lib_prefix}${_}${suffix}${lib_ext}", @boost_libraries) {
|
|
|
|
# If the library file does not exist, try next library path.
|
|
|
|
-f "$path/$lib" or next PATH;
|
|
|
|
}
|
|
|
|
if (! $cpp_guess->is_msvc) {
|
|
|
|
# Test the correctness of boost libraries by linking them to a minimal C program.
|
|
|
|
check_lib(
|
|
|
|
lib => [ map "boost_${_}${suffix}", @boost_libraries ],
|
|
|
|
INC => join(' ', map "-I$_", @INC, @boost_include),
|
|
|
|
LIBS => "-L$path",
|
|
|
|
) or next;
|
|
|
|
}
|
2015-11-19 14:30:27 +00:00
|
|
|
push @INC, (map " -I$_", @boost_include); # TODO: only use the one related to the chosen lib path
|
2016-08-21 19:46:17 +00:00
|
|
|
if ($ENV{SLIC3R_STATIC} || $cpp_guess->is_msvc) {
|
|
|
|
push @LIBS, map "${path}/${lib_prefix}$_${suffix}${lib_ext}", @boost_libraries;
|
2016-04-11 20:14:12 +00:00
|
|
|
} else {
|
|
|
|
push @LIBS, " -L$path", (map " -lboost_$_$suffix", @boost_libraries);
|
|
|
|
}
|
2015-11-19 14:30:27 +00:00
|
|
|
$have_boost = 1;
|
|
|
|
last;
|
|
|
|
}
|
2015-11-06 10:03:45 +00:00
|
|
|
}
|
2014-11-26 21:30:25 +00:00
|
|
|
}
|
2015-11-06 10:03:45 +00:00
|
|
|
die <<'EOF' if !$have_boost;
|
|
|
|
Slic3r requires the Boost libraries. Please make sure they are installed.
|
|
|
|
|
|
|
|
If they are installed, this script should be able to locate them in several
|
|
|
|
standard locations. If this is not the case, you might want to supply their
|
|
|
|
path through the BOOST_DIR environment variable:
|
|
|
|
|
|
|
|
BOOST_DIR=/path/to/boost perl Build.PL
|
|
|
|
|
2017-03-17 21:49:43 +00:00
|
|
|
Or you may specify BOOST_INCLUDEDIR and BOOST_LIBRARYDIR separatly, which
|
2016-08-21 19:46:17 +00:00
|
|
|
is handy, if you have built Boost libraries with mutliple settings.
|
|
|
|
|
2017-08-03 15:31:31 +00:00
|
|
|
Following boost libraries are needed by Slic3r Prusa Edition: system, filesystem, thread, locale, log.
|
2017-03-23 15:28:23 +00:00
|
|
|
|
|
|
|
On Debian, you need to run
|
2017-08-03 15:31:31 +00:00
|
|
|
sudo apt-get install libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-locale-dev libboost-log-dev
|
2017-03-23 15:28:23 +00:00
|
|
|
|
2015-11-06 10:03:45 +00:00
|
|
|
EOF
|
|
|
|
|
2017-03-07 12:03:14 +00:00
|
|
|
# Search for the Intel Thread Building Blocks.
|
|
|
|
my @tbb_include = ();
|
|
|
|
if (defined $ENV{TBB_INCLUDEDIR}) {
|
|
|
|
push @tbb_include, $ENV{TBB_INCLUDEDIR}
|
|
|
|
} elsif (defined $ENV{TBB_DIR}) {
|
|
|
|
my $subdir = $ENV{TBB_DIR} . (($mswin == 1) ? '\include' : '/include');
|
|
|
|
push @tbb_include, $subdir if (-d $subdir);
|
|
|
|
} else {
|
|
|
|
# Thread Building Blocks library was not defined by the environment.
|
|
|
|
# Try to guess at some default paths.
|
|
|
|
if ($mswin) {
|
|
|
|
for my $path (map glob($_ . 'tbb*\include'), @library_path_prefixes) {
|
|
|
|
push @tbb_include, $path;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
@tbb_include = grep { -d $_ . '/tbb' } map { $_ . 'include' } @library_path_prefixes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
my @tbb_libs = ();
|
|
|
|
if (defined $ENV{TBB_LIBRARYDIR}) {
|
|
|
|
push @tbb_libs, $ENV{TBB_LIBRARYDIR}
|
|
|
|
} elsif (defined $ENV{TBB_DIR}) {
|
|
|
|
my $subdir = $ENV{TBB_DIR} . ($mswin ? '\lib' : '/lib');
|
|
|
|
push @tbb_libs, $subdir if (-d $subdir);
|
|
|
|
} else {
|
|
|
|
# Thread Building Blocks library was not defined by the environment.
|
|
|
|
# Try to guess at some default paths.
|
|
|
|
if ($mswin) {
|
|
|
|
for my $path (map { glob($_ . 'tbb*\lib') } @library_path_prefixes) {
|
|
|
|
push @tbb_libs, $path;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
@tbb_libs = grep { -d $_ } map { $_ . 'lib' } @library_path_prefixes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# In order to generate the -l switches we need to know how Thread Building Blocks libraries are named
|
|
|
|
my $have_tbb = 0;
|
|
|
|
#my @tbb_libraries = qw(tbb tbbmalloc tbbmalloc_proxy); # we need these
|
|
|
|
my @tbb_libraries = qw(tbb); # we need these
|
|
|
|
|
|
|
|
if (!$ENV{SLIC3R_STATIC}) {
|
|
|
|
# Dynamic linking of Thread Building Blocks libraries.
|
|
|
|
if (! $mswin) {
|
|
|
|
# Check without explicit lib path (works on Linux and OSX).
|
|
|
|
$have_tbb = 1
|
|
|
|
if check_lib(
|
|
|
|
lib => [ @tbb_libraries ],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($have_tbb) {
|
|
|
|
# The Thread Building Blocks library was detected by check_lib on Linux.
|
|
|
|
push @LIBS, map "-l${_}", @tbb_libraries;
|
|
|
|
} else {
|
|
|
|
# Either static linking, or check_lib could not be used to find the Thread Building Blocks libraries.
|
|
|
|
my $lib_prefix = $cpp_guess->is_msvc ? '' : 'lib';
|
|
|
|
PATH: foreach my $path (@tbb_libs) {
|
|
|
|
# Try to find the Thread Building Blocks system library.
|
|
|
|
my @files = glob "$path/${lib_prefix}tbb*$lib_ext";
|
|
|
|
next if !@files;
|
|
|
|
if ($files[0] =~ /\Q${lib_prefix}tbb\E([^.]*)\Q$lib_ext\E$/) {
|
|
|
|
# Suffix contains the version number, the build type etc.
|
|
|
|
my $suffix = $1;
|
|
|
|
# Verify existence of all required TBB libraries at $path.
|
|
|
|
for my $lib (map "${lib_prefix}${_}${suffix}${lib_ext}", @tbb_libraries) {
|
|
|
|
# If the library file does not exist, try next library path.
|
|
|
|
-f "$path/$lib" or next PATH;
|
|
|
|
}
|
|
|
|
if (! $cpp_guess->is_msvc) {
|
|
|
|
# Test the correctness of TBB libraries by linking them to a minimal C program.
|
|
|
|
check_lib(
|
|
|
|
lib => [ map "${_}${suffix}", @tbb_libraries ],
|
|
|
|
INC => join(' ', map "-I$_", @INC, @tbb_include),
|
|
|
|
LIBS => "-L$path",
|
|
|
|
) or next;
|
|
|
|
}
|
|
|
|
push @INC, (map " -I$_", @tbb_include); # TODO: only use the one related to the chosen lib path
|
|
|
|
if ($ENV{SLIC3R_STATIC} || $cpp_guess->is_msvc) {
|
2017-03-07 13:50:32 +00:00
|
|
|
my $lib_prefix = $cpp_guess->is_msvc ? '' : 'lib';
|
|
|
|
push @LIBS, map "${path}/${lib_prefix}${_}_static${lib_ext}", @tbb_libraries;
|
2017-03-07 12:03:14 +00:00
|
|
|
} else {
|
|
|
|
push @LIBS, " -L$path", (map " -l$_$suffix", @tbb_libraries);
|
|
|
|
}
|
|
|
|
$have_tbb = 1;
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
die <<'EOF' if !$have_tbb;
|
|
|
|
Slic3r requires the Intel Thread Building Blocks libraries. Please make sure the library is installed.
|
|
|
|
|
|
|
|
If the Intel Thread Building Blocks library is installed, this script should be able to locate them in several
|
|
|
|
standard locations. If this is not the case, you might want to supply a path to the library
|
|
|
|
through the TBB_DIR environment variable:
|
|
|
|
|
|
|
|
TBB_DIR=/path/to/TBB perl Build.PL
|
|
|
|
|
2017-03-17 21:49:43 +00:00
|
|
|
Or you may specify TBB_INCLUDEDIR and TBB_LIBRARYDIR separatly, which
|
2017-03-07 12:03:14 +00:00
|
|
|
is handy, if you have built the Thread Building Blocks libraries with mutliple settings.
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2016-09-14 14:31:26 +00:00
|
|
|
# Add the OpenGL and GLU libraries.
|
|
|
|
if ($ENV{SLIC3R_GUI}) {
|
|
|
|
if ($mswin) {
|
|
|
|
if ($cpp_guess->is_msvc) {
|
|
|
|
push @LIBS, qw(OpenGL32.Lib GlU32.Lib);
|
|
|
|
} else {
|
|
|
|
push @LIBS, qw(-lopengl32);
|
|
|
|
}
|
2017-03-16 13:26:16 +00:00
|
|
|
} elsif ($^O eq 'darwin') {
|
|
|
|
push @LIBS, qw(-framework OpenGL);
|
2016-09-14 14:31:26 +00:00
|
|
|
} else {
|
2016-11-04 00:06:26 +00:00
|
|
|
push @LIBS, qw(-lGL -lGLU);
|
2016-09-14 14:31:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-28 17:23:29 +00:00
|
|
|
if ($ENV{SLIC3R_DEBUG}) {
|
2014-05-09 12:24:35 +00:00
|
|
|
# only on newer GCCs: -ftemplate-backtrace-limit=0
|
2016-08-21 19:46:17 +00:00
|
|
|
push @cflags, '-DSLIC3R_DEBUG';
|
|
|
|
push @cflags, $cpp_guess->is_msvc ? '-Gd' : '-g';
|
2016-10-20 11:04:23 +00:00
|
|
|
} else {
|
|
|
|
# Disable asserts in the release builds.
|
|
|
|
push @cflags, '-DNDEBUG';
|
2014-04-28 17:23:29 +00:00
|
|
|
}
|
|
|
|
|
2016-12-13 21:46:28 +00:00
|
|
|
print "\n";
|
2017-02-26 20:46:33 +00:00
|
|
|
print 'With @cflags: ', join(', ', map "\"$_\"", @cflags), "\n";
|
|
|
|
print 'With @ldflags: ', join(', ', map "\"$_\"", @ldflags), "\n";
|
2016-12-13 21:46:28 +00:00
|
|
|
print 'With @INC: ', join(', ', map "\"$_\"", @INC), "\n";
|
|
|
|
print 'With @LIBS: ', join(', ', map "\"$_\"", @LIBS), "\n";
|
|
|
|
|
2013-06-22 15:16:45 +00:00
|
|
|
my $build = Module::Build::WithXSpp->new(
|
|
|
|
module_name => 'Slic3r::XS',
|
|
|
|
dist_abstract => 'XS code for Slic3r',
|
|
|
|
build_requires => {qw(
|
2013-06-23 18:05:20 +00:00
|
|
|
ExtUtils::ParseXS 3.18
|
2015-02-13 17:44:22 +00:00
|
|
|
ExtUtils::Typemaps 1.00
|
2014-06-25 12:57:06 +00:00
|
|
|
ExtUtils::Typemaps::Default 1.05
|
2013-06-23 18:05:20 +00:00
|
|
|
ExtUtils::XSpp 0.17
|
2013-06-22 15:16:45 +00:00
|
|
|
Module::Build 0.3601
|
|
|
|
Test::More 0
|
|
|
|
)},
|
|
|
|
configure_requires => {qw(
|
|
|
|
ExtUtils::CppGuess 0.07
|
|
|
|
Module::Build 0.38
|
2013-06-23 18:05:20 +00:00
|
|
|
Module::Build::WithXSpp 0.13
|
2013-06-22 15:16:45 +00:00
|
|
|
)},
|
2014-11-26 21:30:25 +00:00
|
|
|
extra_compiler_flags => [ @INC, @cflags ],
|
2015-12-04 20:25:45 +00:00
|
|
|
extra_linker_flags => [ @LIBS, @ldflags ],
|
2013-06-22 15:16:45 +00:00
|
|
|
|
|
|
|
# Provides extra C typemaps that are auto-merged
|
|
|
|
extra_typemap_modules => {
|
2014-11-22 21:20:28 +00:00
|
|
|
'ExtUtils::Typemaps::Basic' => '1.05',
|
2013-06-22 15:16:45 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
# for MSVC builds
|
|
|
|
early_includes => [qw(
|
|
|
|
cstring
|
|
|
|
cstdlib
|
|
|
|
ostream
|
2015-11-06 09:43:11 +00:00
|
|
|
sstream
|
|
|
|
libslic3r/GCodeSender.hpp
|
2016-09-12 14:25:15 +00:00
|
|
|
), @early_includes]
|
2013-06-22 15:16:45 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$build->create_build_script;
|
|
|
|
|
|
|
|
__END__
|