]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Cope with absent Perl modules threads and Thread::Queue.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 6 Nov 2008 20:06:01 +0000 (21:06 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 6 Nov 2008 20:41:21 +0000 (21:41 +0100)
* automake.in: Instead of `use threads', use `require threads;
import threads' inside a BEGIN section.  Likewise for
Thread::Queue.
* lib/Automake/ChannelDefs.pm (Automake::ChannelDefs): Likewise.
* lib/Automake/tests/Condition-t.pl: Likewise.
* lib/Automake/tests/DisjConditions-t.pl: Likewise.
* configure.ac: Likewise, use `require' and `import'.
Report by Eric Blake, fix suggested by Ben Pfaff.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
automake.in
configure
configure.ac
lib/Automake/ChannelDefs.pm
lib/Automake/tests/Condition-t.pl
lib/Automake/tests/DisjConditions-t.pl

index c5ed954a920b3d584805a1931eb12efac9242773..abbe03501ed0f4cd081eaa08cf93ea2112672fe6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-11-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Cope with absent Perl modules threads and Thread::Queue.
+       * automake.in: Instead of `use threads', use `require threads;
+       import threads' inside a BEGIN section.  Likewise for
+       Thread::Queue.
+       * lib/Automake/ChannelDefs.pm (Automake::ChannelDefs): Likewise.
+       * lib/Automake/tests/Condition-t.pl: Likewise.
+       * lib/Automake/tests/DisjConditions-t.pl: Likewise.
+       * configure.ac: Likewise, use `require' and `import'.
+       Report by Eric Blake, fix suggested by Ben Pfaff.
+
 2008-11-04  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Multiple 'make uninstall' should not fail even for TEXINFOS.
index 147c4c37e7cfc56053f82551ab34237e4df03a89..5ae09c76c7dba6fa5a4a9206d05f3573cffb0e9b 100755 (executable)
@@ -128,11 +128,16 @@ package Automake;
 
 use strict;
 use Automake::Config;
-if ($perl_threads)
-  {
-    use threads;
-    use Thread::Queue;
-  }
+BEGIN
+{
+  if ($perl_threads)
+    {
+      require threads;
+      import threads;
+      require Thread::Queue;
+      import Thread::Queue;
+    }
+}
 use Automake::General;
 use Automake::XFile;
 use Automake::Channels;
index 9452a620fcd493b4bde4ffac85c9f05923493e0a..73994bd03e235c3843485ab370814ee6c327de5d 100755 (executable)
--- a/configure
+++ b/configure
@@ -2390,8 +2390,10 @@ else
     use Config;
     if ($Config{useithreads})
       {
-       use threads;
-       use Thread::Queue;
+       require threads;
+       import threads;
+       require Thread::Queue;
+       import Thread::Queue;
        exit 0;
       }
     exit 1;' >&5 2>&1
index 2bec317a56146367fde90d51f5ce48264c40f91c..664a2605e733757c9f4067a1cbbe9f0552e39e1a 100644 (file)
@@ -67,8 +67,10 @@ AC_CACHE_CHECK([whether $PERL supports ithreads], [am_cv_prog_PERL_ithreads],
     use Config;
     if ($Config{useithreads})
       {
-       use threads;
-       use Thread::Queue;
+       require threads;
+       import threads;
+       require Thread::Queue;
+       import Thread::Queue;
        exit 0;
       }
     exit 1;' >&AS_MESSAGE_LOG_FD 2>&1
index afd701e1e968f7e263e914941de156c9ea41896d..15362b514fbc2ced2fa4ae77fc6128c8b508081f 100644 (file)
 package Automake::ChannelDefs;
 
 use Automake::Config;
-if ($perl_threads)
-  {
-    use threads;
-  }
+BEGIN
+{
+  if ($perl_threads)
+    {
+      require threads;
+      import threads;
+    }
+}
 use Automake::Channels;
 
 =head1 NAME
index 8b632fa8f8896c45b9919aaedc8a33f5d726ccbd..eb93396b2f707731a049ad5b38d4b98ac69ffc2b 100644 (file)
@@ -20,7 +20,8 @@ BEGIN {
   if (eval { require 5.007_002; }      # for CLONE support
       && $Config{useithreads})
     {
-      use threads;
+      require threads;
+      import threads;
     }
   else
     {
index 2b8ca3e3b139669767d4f34b2b5fb39271db3d3c..c30b5e292384992b4a99671f705c7ebb1bb915a9 100644 (file)
@@ -20,7 +20,8 @@ BEGIN {
   if (eval { require 5.007_002; }      # for CLONE support
       && $Config{useithreads})
     {
-      use threads;
+      require threads;
+      import threads;
     }
   else
     {