added timeout to sqlite health check because some buggy versions of sqlite just hang
[dbsrgits/DBIx-Class.git] / Makefile.PL
index 1f044f6..1a3466f 100644 (file)
@@ -1,6 +1,7 @@
 use inc::Module::Install 0.67;
 use strict;
 use warnings;
+use POSIX ();
 
 use 5.006001; # delete this line if you want to send patches for earlier.
 
@@ -29,7 +30,8 @@ requires 'Sub::Name'                 => 0.04;
 # Perl 5.8.0 doesn't have utf8::is_utf8()
 requires 'Encode'                    => 0 if ($] <= 5.008000);  
 
-test_requires 'DBD::SQLite'         => 1.14;
+configure_requires 'DBD::SQLite'         => 1.14;
+
 test_requires 'Test::Builder'       => 0.33;
 test_requires 'Test::Warn'          => 0.11;
 test_requires 'Test::Exception'     => 0;
@@ -117,9 +119,14 @@ EOW
       exit 0;
   }
   else {
-      wait();
+      eval {
+          local $SIG{ALRM} = sub { die "timeout\n" };
+          alarm 5;
+          wait();
+          alarm 0;
+      };
       my $sig = $? & 127;
-      if ($sig == 11) {
+      if ($@ || $sig == POSIX::SIGSEGV) {
           warn (<<EOE);
 
 ############################### WARNING #################################
@@ -145,7 +152,7 @@ EOE
 }
 
 
-WriteAll;
+WriteAll();
 
 
 if ($Module::Install::AUTHOR) {