maint: get rid of $perllibdir environment variable hack
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 16 Nov 2012 11:45:59 +0000 (12:45 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 16 Nov 2012 11:45:59 +0000 (12:45 +0100)
That was needed when the automake-$APIVERSION and aclocal-$APIVERSION
wrapper scripts used by the testsuite were shell script, rather than
perl scripts acting as a thin layers.

* aclocal.in (BEGIN): Update @INC based on the contents of the array
'@Aclocal::perl_libdirs', rather than of the environment variable
'perllibdir'.
* t/wrap/aclocal.in (BEGIN): Initialize '@Aclocal::perl_libdirs'
rather than $ENV{'perllibdir'}.
* automake.in (BEGIN): Update @INC based on the contents of the array
'@Automake::perl_libdirs', rather than of the environment variable
'perllibdir'.
* t/wrap/automake.in (BEGIN): Initialize '@Automake::perl_libdirs'
rather than $ENV{'perllibdir'}.
* NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NEWS
aclocal.in
automake.in
t/wrap/aclocal.in
t/wrap/automake.in

diff --git a/NEWS b/NEWS
index 6377234..438ec68 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -85,6 +85,12 @@ New in 1.12.5:
     the error possibly going unnoticed or triggering harder-to-diagnose
     fallout failures in later steps.
 
+* Miscellaneous changes:
+
+  - automake and aclocal no longer honours the 'perllibdir' environment
+    variable.  That had always been intended only as an hack required in
+    the testsuite, not meant for any use beyond that.
+
 Bugs fixed in 1.12.5:
 
 * Long-standing bugs:
index e8855d5..8f02b00 100644 (file)
@@ -27,8 +27,9 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
 
 BEGIN
 {
-  my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
-  unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+  @Aclocal::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
+    unless @Aclocal::perl_libdirs;
+  unshift @INC, @Aclocal::perl_libdirs;
 }
 
 use strict;
index 4c5ed2c..11c670a 100644 (file)
@@ -29,8 +29,9 @@ package Language;
 
 BEGIN
 {
-  my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
-  unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+  @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
+    unless @Automake::perl_libdirs;
+  unshift @INC, @Automake::perl_libdirs;
 
   # Override SHELL.  This is required on DJGPP so that system() uses
   # bash, not COMMAND.COM which doesn't quote arguments properly.
index a3defa9..ea3819a 100644 (file)
 BEGIN
 {
   use strict;
-  my $libdir;
-  $libdir = '@abs_top_srcdir@/lib';
-  $libdir = '@abs_top_builddir@/lib' . '@PATH_SEPARATOR@' . $libdir
+  @Aclocal::perl_libdirs = ('@abs_top_srcdir@/lib');
+  unshift @Aclocal::perl_libdirs, '@abs_top_builddir@/lib'
     if '@srcdir@' ne '.';
-  $ENV{perllibdir} = $libdir;
   unshift @ARGV,
     '--automake-acdir=@abs_top_srcdir@/m4',
     '--system-acdir=@abs_top_srcdir@/m4/acdir';
index 8417360..3302b3f 100644 (file)
 BEGIN
 {
   use strict;
-  my $libdir;
-  $libdir = '@abs_top_srcdir@/lib';
-  $libdir = '@abs_top_builddir@/lib' . '@PATH_SEPARATOR@' . $libdir
+  @Automake::perl_libdirs = ('@abs_top_srcdir@/lib');
+  unshift @Automake::perl_libdirs, '@abs_top_builddir@/lib'
     if '@srcdir@' ne '.';
-  $ENV{perllibdir} = $libdir;
   unshift @ARGV, '--libdir=@abs_top_srcdir@/lib';
 }
 require '@abs_top_builddir@/automake';