From cdf48ade2588e01c217e23391e356a580657ed47 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 16 Mar 2017 11:10:23 +0100 Subject: [PATCH] Fix a typo in the BOOST_* environment variables and clarify the error message. Also, support GCC 4.6.x. --- xs/Build.PL | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/xs/Build.PL b/xs/Build.PL index 12837630ed..87ba0c1ef6 100644 --- a/xs/Build.PL +++ b/xs/Build.PL @@ -15,13 +15,18 @@ my $mswin = $^O eq 'MSWin32'; # 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 # BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339 -# std=c++11 Enforce usage of C++11 (required now). Minimum compiler supported: gcc 4.9, clang 3.3, MSVC 14.0 -my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE - -std=c++11); +my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE); if ($cpp_guess->is_gcc) { # GCC is pedantic with c++11 std, so undefine strict ansi to get M_PI back push @cflags, qw(-U__STRICT_ANSI__); } +if (`$Config{cc} -v` =~ /gcc version 4\.6\./) { + # Compatibility with GCC 4.6 is not a requirement, but as long as code compiles on it we try to support it. + push @cflags, qw(-std=c++0x); +} else { + # std=c++11 Enforce usage of C++11 (required now). Minimum compiler supported: gcc 4.9, clang 3.3, MSVC 14.0 + push @cflags, qw(-std=c++11); +} my @ldflags = (); if ($^O eq 'darwin') { push @cflags, qw(-stdlib=libc++); @@ -75,8 +80,8 @@ if (defined $ENV{BOOST_INCLUDEDIR}) { } my @boost_libs = (); -if (defined $ENV{BOOST_LIBRARYDIR}) { - push @boost_libs, $ENV{BOOST_LIBRARYDIR} +if (defined $ENV{BOOST_LIBRARYPATH}) { + push @boost_libs, $ENV{BOOST_LIBRARYPATH} } elsif (defined $ENV{BOOST_DIR}) { my $subdir = $ENV{BOOST_DIR} . ($mswin ? '\stage\lib' : '/stage/lib'); if (-d $subdir) { @@ -154,12 +159,12 @@ 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: +path through the BOOST_INCLUDEPATH and BOOST_LIBRARYPATH environment variables: - BOOST_DIR=/path/to/boost perl Build.PL + BOOST_INCLUDEPATH=/usr/local/include BOOST_LIBRARYPATH=/usr/lib perl Build.PL -Or you may specify BOOST_INCLUDEPATH and BOOST_LIBRARYPATH separatly, which -is handy, if you have built Boost libraries with mutliple settings. +If you just compiled Boost in its source directory without installing it in the +system you can just provide the BOOST_DIR variable pointing to that directory. EOF