aboutsummaryrefslogtreecommitdiff
path: root/package/perl-gd/0001-gdlib-config-is-now-configurable.patch
blob: 294279acd30328563b5c8b8b2c5c79e919b93f54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From f417f38929fe558d388b9a9343da9b2c0e6984aa Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@openwide.fr>
Date: Sat, 20 Dec 2014 23:22:41 +0100
Subject: [PATCH] Makefile.PL: gdlib-config is now configurable

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
 Makefile.PL | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/Makefile.PL b/Makefile.PL
index dfe8ad7..0fa6ef3 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -21,7 +21,7 @@ END
 my (@INC,@LIBPATH,@LIBS,$LIBGD_VERSION);
 my $AUTOCONFIG = 0;      # global set by try_to_autoconfigure() below
 
-my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_path,$lib_zlib_path,$force);
+my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_path,$lib_zlib_path,$force,$gdlib_config_path);
 
 use Getopt::Long;
 my $result = GetOptions("ignore_missing_gd" => \$force,
@@ -32,6 +32,7 @@ my $result = GetOptions("ignore_missing_gd" => \$force,
 			"lib_jpeg_path=s" => \$lib_jpeg_path,
 			"lib_xpm_path=s"  => \$lib_xpm_path,
 			"lib_zlib_path=s" => \$lib_zlib_path,
+			"gdlib_config_path=s" => \$gdlib_config_path,
 		       );
 
 unless (try_to_autoconfigure(\$options,\$lib_gd_path,\@INC,\@LIBPATH,\@LIBS) || $force) {
@@ -75,6 +76,7 @@ Configure GD module.
      -lib_xpm_path  path            path to libxpm
      -lib_zlib_path path            path to libpng
      -ignore_missing_gd             Ignore missing or old libgd installations and try to compile anyway
+     -gdlib_config_path path        path to gdlib-config
 
 If no options are passed on the command line.  The program will
 attempt to autoconfigure itself with the gdlib-config program (present
@@ -121,6 +123,15 @@ if( defined($lib_zlib_path) )
     @INC     = ("-I$lib_zlib_path/include", @INC);
     @LIBPATH = ("-L$lib_zlib_path/lib", @LIBPATH); 
 }
+if( defined($gdlib_config_path) )
+{
+    print "gdlib-config used:          $gdlib_config_path\n";
+}
+else
+{
+    $gdlib_config_path = "gdlib-config";
+    print "$gdlib_config_path used from the PATH\n";
+}
 #############################################################################################
 
 if ($^O eq 'VMS'){
@@ -289,7 +300,7 @@ sub try_to_autoconfigure {
   my ($prefix) = $$lib_gd_path ? ($$lib_gd_path =~ m|(^.*)/lib|) : "";
   my $bindir = $prefix ? "$prefix/bin/" : "";
   my $config = `${bindir}gdlib-config --all` if -e "${bindir}gdlib-config";
-  $config = `gdlib-config --all` if !$config;
+  $config = `$gdlib_config_path --all` if !$config;
   unless ($config) {
       my %config;
       require ExtUtils::PkgConfig;
-- 
1.9.3