- Makefile.PL now checks the directories specified by $Config{locincpth}
authorTony Cook <tony@develop=help.com>
Thu, 23 Dec 2004 01:05:44 +0000 (01:05 +0000)
committerTony Cook <tony@develop=help.com>
Thu, 23 Dec 2004 01:05:44 +0000 (01:05 +0000)
  and $Config{loclibpth} for includes and libraries respectively.
  Resolves: https://rt.cpan.org/Ticket/Display.html?id=2942

Changes
Makefile.PL

diff --git a/Changes b/Changes
index 00f61640388345ea5d60523c9d73c22768b1cf7b..07267d5f9cc35dd60e7e7a411c82f9908f03b860 100644 (file)
--- a/Changes
+++ b/Changes
@@ -962,9 +962,11 @@ Revision history for Perl extension Imager.
 - document that you don't want the FT2 freetype.h in the include path
 
 0.44_01
-
 - the plugins Makefile has long produced an error after all tests were
   complete on Win32, finally tracked down why
+- Makefile.PL now checks the directories specified by $Config{locincpth}
+  and $Config{loclibpth} for includes and libraries respectively.
+  Resolves: https://rt.cpan.org/Ticket/Display.html?id=2942
 
 =================================================================
 
index 69f807190cd5102ffa65dfe0af92a81cb79fc94d..48fc7d6730084a0a5187beb80fa35d089f547e64 100644 (file)
@@ -3,9 +3,6 @@ use ExtUtils::MakeMaker;
 use Cwd;
 use Config;
 
-$lext=$Config{'so'};   # Get extensions of libraries
-$aext=$Config{'_a'};
-
 #
 # IM_INCPATH      colon seperated list of paths to extra include paths
 # IM_LIBPATH      colon seperated list of paths to extra library paths
@@ -115,7 +112,7 @@ EOF
 
   <STDIN>; # eat one return
 
-  for $frm(sort { $formats{$b}{order} <=> $formats{$a}{order} } keys %formats) {
+  for my $frm(sort { $formats{$b}{order} <=> $formats{$a}{order} } keys %formats) {
   SWX:
     if ($formats{$frm}{docs}) { print "\n",$formats{$frm}{docs},"\n\n"; }
     print "Enable $frm support: ";
@@ -219,6 +216,7 @@ sub gd {
 
 sub checkformat {
   my $frm=shift;
+
   my $libchk=$formats{$frm}{'libcheck'};
   my $incchk=$formats{$frm}{'inccheck'};
 
@@ -273,17 +271,27 @@ sub pathcheck {
 sub init {
 
   @definc{'/usr/include'}=();
-  @incs=(split(/\Q$Config{path_sep}/, $INCPATH), 
-         qw(/sw/include 
-            /usr/include/freetype2
-            /usr/local/include/freetype2
-            /usr/local/include/freetype1/freetype
-            /usr/include /usr/local/include /usr/include/freetype 
-            /usr/local/include/freetype));
-  @libs=(split(/\Q$Config{path_sep}/,$LIBPATH), 
-         qw(/sw/lib),  split(/ /, $Config{'libpth'}));
+  @incs=(split(/\Q$Config{path_sep}/, $INCPATH));
+  if ($Config{locincpth}) {
+    push @incs, split ' ', $Config{locincpth};
+  }
   if ($^O =~ /win32/i && $Config{cc} =~ /\bcl\b/i) {
     push(@incs, split /;/, $ENV{INCLUDE}) if exists $ENV{INCLUDE};
+  }
+  push @incs,
+      qw(/sw/include 
+         /usr/include/freetype2
+         /usr/local/include/freetype2
+         /usr/local/include/freetype1/freetype
+         /usr/include /usr/local/include /usr/include/freetype 
+         /usr/local/include/freetype);
+
+  @libs= split(/\Q$Config{path_sep}/,$LIBPATH);
+  if ($Config{loclibpth}) {
+    push @libs, split ' ', $Config{loclibpth};
+  }
+  push @libs, qw(/sw/lib),  split(/ /, $Config{'libpth'});
+  if ($^O =~ /win32/i && $Config{cc} =~ /\bcl\b/i) {
     push(@libs, split /;/, $ENV{LIB}) if exists $ENV{LIB};
   }
   if ($^O eq 'cygwin') {
@@ -291,6 +299,9 @@ sub init {
     push(@incs, '/usr/include/w32api') if -d '/usr/lib/w32api';
   }
 
+  my $lext=$Config{'so'};   # Get extensions of libraries
+  my $aext=$Config{'_a'};
+
   $formats{'jpeg'}={
                    order=>'21',
                    def=>'HAVE_LIBJPEG',