One more fix for BOOST_DIR

This commit is contained in:
Alessandro Ranellucci 2017-04-21 15:42:36 +02:00
parent cff79b6555
commit f24fc2c675

View File

@ -67,15 +67,13 @@ my @boost_include = ();
if (defined $ENV{BOOST_INCLUDEDIR}) { if (defined $ENV{BOOST_INCLUDEDIR}) {
push @boost_include, $ENV{BOOST_INCLUDEDIR} push @boost_include, $ENV{BOOST_INCLUDEDIR}
} elsif (defined $ENV{BOOST_DIR}) { } elsif (defined $ENV{BOOST_DIR}) {
my $subdir = $ENV{BOOST_DIR} . (($mswin == 1) ? '\include' : '/include'); # User might have provided a path relative to the Build.PL in the main directory
if (-d $subdir) { foreach my $subdir ($ENV{BOOST_DIR}, "../$ENV{BOOST_DIR}", "$ENV{BOOST_DIR}/include", "../$ENV{BOOST_DIR}/include") {
push @boost_include, $subdir; if (-d $subdir) {
} elsif (-d "../$subdir") { push @boost_include, $subdir;
# User might have provided a path relative to the Build.PL in the main directory }
push @boost_include, "../$subdir";
} else {
push @boost_include, $ENV{BOOST_DIR};
} }
die "Invalid BOOST_DIR: no such directory\n" if !@boost_include;
} else { } else {
# Boost library was not defined by the environment. # Boost library was not defined by the environment.
# Try to guess at some default paths. # Try to guess at some default paths.
@ -99,15 +97,13 @@ my @boost_libs = ();
if (defined $ENV{BOOST_LIBRARYPATH}) { if (defined $ENV{BOOST_LIBRARYPATH}) {
push @boost_libs, $ENV{BOOST_LIBRARYPATH} push @boost_libs, $ENV{BOOST_LIBRARYPATH}
} elsif (defined $ENV{BOOST_DIR}) { } elsif (defined $ENV{BOOST_DIR}) {
my $subdir = $ENV{BOOST_DIR} . ($mswin ? '\stage\lib' : '/stage/lib'); # User might have provided a path relative to the Build.PL in the main directory
if (-d $subdir) { foreach my $subdir ("$ENV{BOOST_DIR}/stage/lib", "../$ENV{BOOST_DIR}/stage/lib") {
push @boost_libs, $subdir; if (-d $subdir) {
} elsif (-d "../$subdir") { push @boost_libs, $subdir;
# User might have provided a path relative to the Build.PL in the main directory }
push @boost_libs, "../$subdir";
} else {
push @boost_libs, $ENV{BOOST_DIR};
} }
die "Invalid BOOST_DIR: no such directory\n" if !@boost_libs;
} else { } else {
# Boost library was not defined by the environment. # Boost library was not defined by the environment.
# Try to guess at some default paths. # Try to guess at some default paths.