automake-patches
[Top][All Lists]
Advanced

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

[FYI] maint: get rid of $perllibdir environment variable hack


From: Stefano Lattarini
Subject: [FYI] maint: get rid of $perllibdir environment variable hack
Date: Fri, 16 Nov 2012 13:02:12 +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 <address@hidden>
---
 NEWS               | 6 ++++++
 aclocal.in         | 5 +++--
 automake.in        | 5 +++--
 t/wrap/aclocal.in  | 6 ++----
 t/wrap/automake.in | 6 ++----
 5 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/NEWS b/NEWS
index 6377234..438ec68 100644
--- 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:
diff --git a/aclocal.in b/aclocal.in
index e8855d5..8f02b00 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -27,8 +27,9 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S 
"$0" "$@";; esac'
 
 BEGIN
 {
-  my $perllibdir = $ENV{'perllibdir'} || 
'@datadir@/@address@hidden@APIVERSION@';
-  unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+  @Aclocal::perl_libdirs = ('@datadir@/@address@hidden@APIVERSION@')
+    unless @Aclocal::perl_libdirs;
+  unshift @INC, @Aclocal::perl_libdirs;
 }
 
 use strict;
diff --git a/automake.in b/automake.in
index 4c5ed2c..11c670a 100644
--- a/automake.in
+++ b/automake.in
@@ -29,8 +29,9 @@ package Language;
 
 BEGIN
 {
-  my $perllibdir = $ENV{'perllibdir'} || 
'@datadir@/@address@hidden@APIVERSION@';
-  unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+  @Automake::perl_libdirs = ('@datadir@/@address@hidden@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.
diff --git a/t/wrap/aclocal.in b/t/wrap/aclocal.in
index a3defa9..ea3819a 100644
--- a/t/wrap/aclocal.in
+++ b/t/wrap/aclocal.in
@@ -19,11 +19,9 @@
 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,
     'address@hidden@/m4',
     'address@hidden@/m4/acdir';
diff --git a/t/wrap/automake.in b/t/wrap/automake.in
index 8417360..3302b3f 100644
--- a/t/wrap/automake.in
+++ b/t/wrap/automake.in
@@ -19,11 +19,9 @@
 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, 'address@hidden@/lib';
 }
 require '@abs_top_builddir@/automake';
-- 
1.8.0.150.gb0b00a3




reply via email to

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