From: Jakob Ilves Date: Mon, 30 Nov 2009 23:12:55 +0000 (+0100) Subject: In instantiation of GSLBuilder in Build.PL, the value for the parameter include_dirs... X-Git-Url: https://repo.or.cz/w/Math-GSL.git/commitdiff_plain/589487844e5fb87773fbae2207241c488a7366c3 In instantiation of GSLBuilder in Build.PL, the value for the parameter include_dirs were corrected to an anonymous empty array, instead of an empty string. There were a build failure where gcc gets confused and 'loses' one of the supplied -I flags (the one specifying the directory containing the core perl header files), resulting in gcc not finding a number of very fundamental header files for perl modules. This is caused by a single '-I' flag appearing before the 'lost' -I flag. That lone '-I' flag is the result of trying to use the -I flag to add a directory consisting of the empty string to the list of directories to search for include files. The fix is to prevent that bogus empty string directory to enter the build logic in the first place: In the instantiation of the GSLBuilder class, I changed the value passed for the 'include_dirs' from an empty string to a (reference to) an empty array. This prevents the lone '-I' flag to be passed to gcc, making gcc properly understand the rest of the command line. (The GSLBuilder code can be amended to actually fail when 'include_dirs' is given an empty string, and in that failure, tell that 'include_dirs' should be given an empty list if one wants to state that there should be no include directories) --- diff --git a/Build.PL b/Build.PL index 6067b1b..cc04f0f 100644 --- a/Build.PL +++ b/Build.PL @@ -204,7 +204,7 @@ my $builder = GSLBuilder->new( dist_abstract => 'Interface to the GNU Scientific Library using SWIG', dist_author => 'Jonathan Leto ', dist_version_from => 'lib/Math/GSL.pm', - include_dirs => q{}, + include_dirs => [], extra_linker_flags => '-shared ' . $ldflags, extra_compiler_flags=> "$ccflags " . ($ENV{CC_FLAGS}||''), swig_flags => $swig_flags,