[perl-Champlain] Better handling of the detection of libmemphis



commit 9ee2fee95aa7b2169848331590a40522fd896015
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Tue May 18 21:47:03 2010 +0200

    Better handling of the detection of libmemphis
    
    Now both the .pc file and the Perl library are detected.

 Makefile.PL |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.PL b/Makefile.PL
index beff99b..93a031f 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -44,14 +44,19 @@ sub main {
 	
 	# If libchamplain was compiled with memphis support
 	eval {
+		# We build the bindigns with memphis support if we find the .pc file and
+		# load the perl module successfully.
 		my %conf = ExtUtils::PkgConfig->find("champlain-memphis-$champlain_version");
+		my $version = '0.01';
+		eval "use Memphis $version; 1;" or die "$@";
+
+		$requires{Memphis} = $version;
 		$pkgconfig{cflags} .= $conf{cflags} . ' -DCHAMPLAINPERL_MEMPHIS';
 		$pkgconfig{libs} .= $conf{libs};
 
 		push @XS_FILES, Glib::MakeHelper->read_source_list_file('xs-memphis');
 		push @typemaps, 'maps-memphis';
 		push @deps, 'Memphis';
-		$requires{Memphis} = '0.01';
 	};
 	if (my $error = $@) {
 		warn "Ignoring the Memphis bindings ($error)";



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]