[perl-Glib-Object-Introspection] Fix build on MinGW with dmake



commit ebc3a3932fe732ccef1b832e8257299d75c8a2e8
Author: Martin Schlemmer <Martin Schlemmer nwu ac za>
Date:   Fri Mar 22 15:39:49 2013 +0200

    Fix build on MinGW with dmake
    
    Add gmodule-2.0 to required libraries, as its used by GObjectIntrospection.xs.
    
    Add a workaround for DMAKE to postamble().

 Makefile.PL |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.PL b/Makefile.PL
index f74e93c..51f82e9 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -35,6 +35,7 @@ my %CONFIG_REQ_PM = (
 
 my %BUILD_REQ = (
   'gobject-introspection-1.0' => '0.10.0',
+  'gmodule-2.0'               => '2.0.0',
   'libffi'                    => '3.0.0',
 );
 
@@ -111,6 +112,18 @@ if (!$cfg_success) {
 }
 
 $cfg_success = eval {
+  my %cfg_gmod = ExtUtils::PkgConfig->find (
+    "gmodule-2.0 >= $BUILD_REQ{'gmodule-2.0'}");
+  $cfg{cflags} .= " $cfg_gmod{cflags}";
+  $cfg{libs} .= " $cfg_gmod{libs}";
+  1;
+};
+if (!$cfg_success) {
+  warn $@;
+  exit 0;
+}
+
+$cfg_success = eval {
   my %cfg_ffi = ExtUtils::PkgConfig->find (
     "libffi >= $BUILD_REQ{'libffi'}");
   $cfg{cflags} .= " $cfg_ffi{cflags}";
@@ -286,5 +299,9 @@ sub test {
 
 sub postamble {
   my $additional_deps = "\n\n\$(OBJECT) : gperl-i11n-*.c\n\n";
+  if ($^O eq 'MSWin32') {
+    # FIXME: Might need tweaking for nmake...
+    $additional_deps = "\n\n\$(OBJECT) : \$(wildcard gperl-i11n-*.c)\n\n";
+  }
   return Glib::MakeHelper->postamble_clean () . $additional_deps;
 }


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