From 2ac4582fb843e76e7b6a2e7e53d093ca580234e7 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Tue, 24 Dec 2013 12:07:01 +0100 Subject: [PATCH] don't parse gdal-config --- Makefile.PL | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index b8a5f87..795a31c 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -54,36 +54,11 @@ if ($config eq '../../apps/gdal-config') { print "Building against GDAL defined in $config\n"; } -my $gdal_version; +chomp(my $gdal_version = `gdal-config --version`); +chomp($LIB = `gdal-config --libs`); +chomp($INC = `gdal-config --cflags`); + my $pm_version; -my $fh; -if (open($fh, $config)) { - for (<$fh>) { - ($gdal_version) = /(\d+\.\d+\.\d+)/ if /^CONFIG_VERSION/; - if (/^CONFIG_LIBS/) { - s/^CONFIG_LIBS="//; - s/"\s*$//; - if ($_ =~ /\.la$/) { - # parse a libtool library file - $LIB .= parse_libtool_library_file_for_l($_); - } else { - $LIB .= $_; - } - $LIB .= ' '; - } - if (/^CONFIG_DEP_LIBS/) { - s/^CONFIG_DEP_LIBS="//; - s/"\s*$//; - $LIB .= $_; - } - if (/^CONFIG_CFLAGS/) { - s/^CONFIG_CFLAGS="//; - s/"\s*$//; - $INC .= $_; - } - } - close $fh; -} if (open($fh, "lib/Geo/GDAL.pm")) { for (<$fh>) { ($pm_version) = /(\d+\.\d+\.\d+)/ if /GDAL_VERSION/; -- 1.7.10.4