automake
[Top][All Lists]
Advanced

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

perl ithreads support: why hardcode at configure time ?


From: Mike Frysinger
Subject: perl ithreads support: why hardcode at configure time ?
Date: Thu, 10 Jan 2013 23:07:07 -0500
User-agent: KMail/1.13.7 (Linux/3.7.1; KDE/4.6.5; x86_64; ; )

i can't imagine this is a big runtime penalty, so why does configure check for 
the perl's thread settings and then hardcode that in the generated automake ?  
it means if you change your perl config or deploy an automake package on a 
system that has threads disabled, you get errors when trying to run automake.

patch below turns it into a dynamic check using the same logic that's in 
configure.ac already.
-mike

--- a/Makefile.am
+++ b/Makefile.am
@@ -78,7 +78,6 @@ do_subst = sed \
   -e 's,address@hidden@],$(PACKAGE_URL),g' \
   -e 's,address@hidden@],$(PATH_SEPARATOR),g' \
   -e 's,address@hidden@],$(PERL),g' \
-  -e 's,address@hidden@],$(PERL_THREADS),g' \
   -e 's,address@hidden@],$(SHELL),g' \
   -e 's,address@hidden@],$(am_AUTOCONF),g' \
   -e 's,address@hidden@],$(am_AUTOM4TE),g' \
--- a/bootstrap
+++ b/bootstrap
@@ -35,7 +35,6 @@ export AUTOM4TE  # ditto
 VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
 PACKAGE=automake
 datadir=.
-PERL_THREADS=0
 
 # Override SHELL.  This is required on DJGPP so that Perl's system()
 # uses bash, not COMMAND.COM which doesn't quote arguments properly.
@@ -80,7 +79,6 @@ dosubst ()
   sed -e "address@hidden@%$APIVERSION%g" \
       -e "address@hidden@%$PACKAGE%g" \
       -e "address@hidden@%$PERL%g" \
-      -e "address@hidden@%$PERL_THREADS%g" \
       -e "address@hidden@%$BOOTSTRAP_SHELL%g" \
       -e "address@hidden@%$VERSION%g" \
       -e "address@hidden@%$datadir%g" \
--- a/configure.ac
+++ b/configure.ac
@@ -77,32 +77,6 @@ installed, select the one Automake should use using
   ./configure PERL=/path/to/perl])
 }
 
-# We require ithreads support, and version 5.7.2 for CLONE.
-AC_CACHE_CHECK([whether $PERL supports ithreads], [am_cv_prog_PERL_ithreads],
-[if $PERL -e '
-    require 5.007_002;
-    use Config;
-    if ($Config{useithreads})
-      {
-       require threads;
-       import threads;
-       require Thread::Queue;
-       import Thread::Queue;
-       exit 0;
-      }
-    exit 1;' >&AS_MESSAGE_LOG_FD 2>&1
-then
-  am_cv_prog_PERL_ithreads=yes
-else
-  am_cv_prog_PERL_ithreads=no
-fi])
-if test $am_cv_prog_PERL_ithreads = yes; then
-  PERL_THREADS=1;
-else
-  PERL_THREADS=0;
-fi
-AC_SUBST([PERL_THREADS])
-
 # The test suite will skip some tests if tex is absent.
 AC_CHECK_PROG([TEX], [tex], [tex])
 # Save details about the selected TeX program in config.log.
--- a/lib/Automake/Config.in
+++ b/lib/Automake/Config.in
@@ -32,7 +32,9 @@ our $PACKAGE = '@PACKAGE@';
 our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
 our $VERSION = '@VERSION@';
 our $libdir = '@datadir@/@address@hidden@APIVERSION@';
-our $perl_threads = @PERL_THREADS@;
+
+use Config;
+our $perl_threads = $Config{useithreads};
 
 1;
 
--- a/lib/Automake/Makefile.am
+++ b/lib/Automake/Makefile.am
@@ -50,7 +50,6 @@ do_subst = in=`echo $@ | sed 's/\.[^.]*$$//'`; sed \
   -e 's,address@hidden@],$(PACKAGE),g' \
   -e 's,address@hidden@],$(PACKAGE_BUGREPORT),g' \
   -e 's,address@hidden@],$(PERL),g' \
-  -e 's,address@hidden@],$(PERL_THREADS),g' \
   -e 's,address@hidden@],$(SHELL),g' \
   -e 's,address@hidden@],$(VERSION),g' \
   -e "s,address@hidden@],Generated from $$in.in; do not edit by hand.,g" 
\

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]