From 734e6e7ef9a93bc9e263a2884f607a34229b95b5 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 5 Nov 2018 19:45:16 +0100 Subject: [PATCH] More verbose errors about BOOST_DIR --- xs/Build.PL | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xs/Build.PL b/xs/Build.PL index 89acbd0bf..20923de9a 100644 --- a/xs/Build.PL +++ b/xs/Build.PL @@ -93,11 +93,16 @@ if (defined $ENV{BOOST_INCLUDEDIR}) { } elsif (defined $ENV{BOOST_DIR}) { # User might have provided a path relative to the Build.PL in the main directory foreach my $subdir ($ENV{BOOST_DIR}, "../$ENV{BOOST_DIR}", "$ENV{BOOST_DIR}/include", "../$ENV{BOOST_DIR}/include") { + next if $subdir =~ m{^\.\.//}; + printf "Checking %s: ", $subdir; if (-d $subdir) { push @boost_include, $subdir; + print "found\n"; + } else { + print "not found\n"; } } - die "Invalid BOOST_DIR: no such directory\n" if !@boost_include; + die "Invalid BOOST_DIR: could not find Boost headers\n" if !@boost_include; } else { # Boost library was not defined by the environment. # Try to guess at some default paths. @@ -123,11 +128,16 @@ if (defined $ENV{BOOST_LIBRARYPATH}) { } elsif (defined $ENV{BOOST_DIR}) { # User might have provided a path relative to the Build.PL in the main directory foreach my $subdir ("$ENV{BOOST_DIR}/stage/lib", "../$ENV{BOOST_DIR}/stage/lib") { + next if $subdir =~ m{^\.\.//}; + printf "Checking %s: ", $subdir; if (-d $subdir) { push @boost_libs, $subdir; + print "found\n"; + } else { + print "not found\n"; } } - die "Invalid BOOST_DIR: no such directory\n" if !@boost_libs; + die "Invalid BOOST_DIR: could not find Boost libs\n" if !@boost_libs; } else { # Boost library was not defined by the environment. # Try to guess at some default paths.