From bb9dfbde44523d07a840f02e966f299568ad07f3 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Thu, 6 Nov 2008 21:06:01 +0100 Subject: [PATCH] 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. Signed-off-by: Ralf Wildenhues --- ChangeLog | 12 ++++++++++++ automake.in | 15 ++++++++++----- configure | 6 ++++-- configure.ac | 6 ++++-- lib/Automake/ChannelDefs.pm | 12 ++++++++---- lib/Automake/tests/Condition-t.pl | 3 ++- lib/Automake/tests/DisjConditions-t.pl | 3 ++- 7 files changed, 42 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5ed954a9..abbe03501 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-11-06 Ralf Wildenhues + + 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 Multiple 'make uninstall' should not fail even for TEXINFOS. diff --git a/automake.in b/automake.in index 147c4c37e..5ae09c76c 100755 --- a/automake.in +++ b/automake.in @@ -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; diff --git a/configure b/configure index 9452a620f..73994bd03 100755 --- 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 diff --git a/configure.ac b/configure.ac index 2bec317a5..664a2605e 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm index afd701e1e..15362b514 100644 --- a/lib/Automake/ChannelDefs.pm +++ b/lib/Automake/ChannelDefs.pm @@ -16,10 +16,14 @@ package Automake::ChannelDefs; use Automake::Config; -if ($perl_threads) - { - use threads; - } +BEGIN +{ + if ($perl_threads) + { + require threads; + import threads; + } +} use Automake::Channels; =head1 NAME diff --git a/lib/Automake/tests/Condition-t.pl b/lib/Automake/tests/Condition-t.pl index 8b632fa8f..eb93396b2 100644 --- a/lib/Automake/tests/Condition-t.pl +++ b/lib/Automake/tests/Condition-t.pl @@ -20,7 +20,8 @@ BEGIN { if (eval { require 5.007_002; } # for CLONE support && $Config{useithreads}) { - use threads; + require threads; + import threads; } else { diff --git a/lib/Automake/tests/DisjConditions-t.pl b/lib/Automake/tests/DisjConditions-t.pl index 2b8ca3e3b..c30b5e292 100644 --- a/lib/Automake/tests/DisjConditions-t.pl +++ b/lib/Automake/tests/DisjConditions-t.pl @@ -20,7 +20,8 @@ BEGIN { if (eval { require 5.007_002; } # for CLONE support && $Config{useithreads}) { - use threads; + require threads; + import threads; } else { -- 2.47.2