summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-07-23 11:58:49 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-07-23 11:58:49 +0000
commit5cf1d1f16c1401220ecaa7b3127343c7c6c095d2 (patch)
tree54b9a35ecbdce7afc4cae82642d6de2a4a7e0d11
parentc1f7b11a6702e2397d89f7692c76fed567098176 (diff)
downloadperl-5cf1d1f16c1401220ecaa7b3127343c7c6c095d2.tar.gz
Introduce $Config{ldlibpthname} which contains
the name of the environment variable holding the dynamic library search path, often LD_LIBRARY_PATH. Use this new feature all over. Also removed remnants of admonition "add LD_LIBRARY_PATH before running make" because Makefile.SH does this for you. p4raw-id: //depot/cfgperl@3725
-rwxr-xr-xConfigure26
-rw-r--r--Makefile.SH35
-rw-r--r--ext/DynaLoader/DynaLoader_pm.PL13
-rw-r--r--hints/aix.sh4
-rw-r--r--hints/beos.sh4
-rw-r--r--hints/cygwin32.sh4
-rw-r--r--hints/dgux.sh5
-rw-r--r--hints/epix.sh9
-rw-r--r--hints/esix4.sh9
-rw-r--r--hints/hpux.sh6
-rw-r--r--hints/next_4.sh14
-rw-r--r--hints/os2.sh4
-rw-r--r--hints/rhapsody.sh5
-rw-r--r--hints/svr4.sh9
-rw-r--r--jpl/JNI/JNI.pm2
-rwxr-xr-xjpl/install-jpl16
-rw-r--r--utils/perlbug.PL8
17 files changed, 88 insertions, 85 deletions
diff --git a/Configure b/Configure
index da92f7b28a..04f7db3393 100755
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Thu Jul 22 22:55:08 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Fri Jul 23 13:08:17 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
@@ -693,6 +693,7 @@ d_stat64=''
d_telldir64=''
d_truncate64=''
libc=''
+ldlibpthname=''
libperl=''
shrpenv=''
useshrplib=''
@@ -5370,16 +5371,7 @@ EOM
. ./myread
case "$ans" in
true|$define|[Yy]*)
- useshrplib='true'
- # Why does next4 have to be so different?
- case "${osname}${osvers}" in
- next4*|rhapsody*)
- xxx='DYLD_LIBRARY_PATH' ;;
- os2*) xxx='' ;; # Nothing special needed.
- beos*) xxx='' ;;
- *) xxx='LD_LIBRARY_PATH' ;;
- esac
- ;;
+ useshrplib='true' ;;
*) useshrplib='false' ;;
esac
;;
@@ -5526,13 +5518,20 @@ EOM
;;
esac
fi
+# Fix ccdlflags in AIX for building external extensions.
+# (For building Perl itself bare -bE:perl.exp is needed,
+# Makefile.SH takes care of this.)
case "$osname" in
-aix*) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
+aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
esac
# Respect a hint or command-line value.
case "$shrpenv" in
'') shrpenv="$tmp_shrpenv" ;;
esac
+case "$ldlibpthname" in
+'') ldlibpthname=LD_LIBRARY_PATH ;;
+none) ldlibpthname='' ;;
+esac
: determine where manual pages go
set man1dir man1dir none
@@ -11012,7 +11011,7 @@ if eval $compile_ok; then
echo "You have EBCDIC." >&4
val="$define"
else
- echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
+ echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
fi
else
echo "I'm unable to compile the test program." >&4
@@ -13433,6 +13432,7 @@ large='$large'
ld='$ld'
lddlflags='$lddlflags'
ldflags='$ldflags'
+ldlibpthname='$ldlibpthname'
less='$less'
lib_ext='$lib_ext'
libc='$libc'
diff --git a/Makefile.SH b/Makefile.SH
index 267a5334c1..79953c7709 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -29,29 +29,20 @@ ldlibpth=''
case "$useshrplib" in
true)
# Prefix all runs of 'miniperl' and 'perl' with
- # $ldlibpth so that ./perl finds *this* libperl.so.
+ # $ldlibpth so that ./perl finds *this* shared libperl.
ldlibpth="LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH"
pldlflags="$cccdlflags"
- # NeXT-4 specific stuff. Can't we do this in the hint file?
case "${osname}${osvers}" in
next4*)
ld=libtool
lddlflags="-dynamic -undefined warning -framework System \
-compatibility_version 1 -current_version $patchlevel \
-prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
- # NeXT uses a different name.
- ldlibpth="DYLD_LIBRARY_PATH=`pwd`:$DYLD_LIBRARY_PATH"
;;
- rhapsody*)
- ldlibpth="DYLD_LIBRARY_PATH=`pwd`/Perl:$DYLD_LIBRARY_PATH"
- ;;
- cygwin*) ldlibpth="PATH='`pwd`:$PATH'"
+ cygwin*)
linklibperl="-lperl"
;;
- os2*) # OS/2 doesn't need anything special for LD_LIBRARY_PATH.
- ldlibpth=''
- ;;
sunos*)
linklibperl="-lperl"
;;
@@ -68,15 +59,27 @@ true)
esac
shrpldflags="$shrpldflags $ldflags $libs $cryptlib"
linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
- ldlibpth="LIBPATH=`pwd`:${LIBPATH}"
;;
hpux*)
linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
- ldlibpth="SHLIB_PATH=`pwd`:${SHLIB_PATH}"
- ;;
- beos*) ldlibpth="LIBRARY_PATH=`pwd`:$LIBRARY_PATH"
;;
esac
+ case "$ldlibpthname" in
+ '') ;;
+ *)
+ case "$osname" in
+ os2)
+ ldlibpth=''
+ ;;
+ rhapsody)
+ eval "ldlibpth=\"$ldlibpthname=`pwd`/Perl:\$$ldlibpthname\""
+ ;;
+ *)
+ eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
+ ;;
+ esac
+ ;;
+ esac
;;
*) pldlflags=''
;;
@@ -152,7 +155,7 @@ LLIBPERL= $linklibperl
SHRPENV = $shrpenv
# The following is used to include the current directory in
-# LD_LIBRARY_PATH if you are building a shared libperl.so.
+# the dynamic loader path you are building a shared libperl.
LDLIBPTH = $ldlibpth
dynamic_ext = $dynamic_list
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 96c9962708..3e30698f87 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -93,12 +93,15 @@ print OUT "push(\@dl_library_path, split(' ', ",
print OUT <<'EOT';
-# Add to @dl_library_path any extra directories we can gather from
-# environment variables. So far LD_LIBRARY_PATH is the only known
-# variable used for this purpose. Others may be added later.
+# Add to @dl_library_path any extra directories we can gather
+# from environment variables.
+push(@dl_library_path, split(/:/, $ENV{$Config::Config{ldlibpthname}}))
+ if exists $Config::Config{ldlibpthname} &&
+ $Config::Config{ldlibpthname} ne '' &&
+ exists $ENV{$Config::Config{ldlibpthname}} ;;
+# E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH.
push(@dl_library_path, split(/:/, $ENV{LD_LIBRARY_PATH}))
- if $ENV{LD_LIBRARY_PATH};
-
+ if exists $ENV{LD_LIBRARY_PATH};
# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
diff --git a/hints/aix.sh b/hints/aix.sh
index 0f255a73f6..2bd092da11 100644
--- a/hints/aix.sh
+++ b/hints/aix.sh
@@ -100,6 +100,10 @@ esac
# the required -bE:$installarchlib/CORE/perl.exp is added by
# libperl.U (Configure) later.
+case "$ldlibpthname" in
+'') ldlibpthname=LIBPATH ;;
+esac
+
# The first 3 options would not be needed if dynamic libs. could be linked
# with the compiler instead of ld.
# -bI:$(PERL_INC)/perl.exp Read the exported symbols from the perl binary
diff --git a/hints/beos.sh b/hints/beos.sh
index 8d76bc5146..8017dce9cc 100644
--- a/hints/beos.sh
+++ b/hints/beos.sh
@@ -51,3 +51,7 @@ ld='gcc'
# Of course, this may also change with R5.
export PATH="$PATH:$PWD/beos"
+
+case "$ldlibpthname" in
+'') ldlibpthname=LIBRARY_PATH ;;
+esac
diff --git a/hints/cygwin32.sh b/hints/cygwin32.sh
index 14fb300020..7d68892f39 100644
--- a/hints/cygwin32.sh
+++ b/hints/cygwin32.sh
@@ -30,3 +30,7 @@ dlext='dll'
man1dir=/usr/local/man/man1
man3dir=/usr/local/man/man3
sitelib=/usr/local/lib/perl5/site_perl
+
+case "$ldlibpthname" in
+'') ldlibpthname=PATH ;;
+esac
diff --git a/hints/dgux.sh b/hints/dgux.sh
index 03b285dbd4..9a6f7a4879 100644
--- a/hints/dgux.sh
+++ b/hints/dgux.sh
@@ -14,13 +14,8 @@
# as it would suck to try to get support if the vendor learned that you
# were physically replacing the system binaries.
#
-# Be aware that if you opt to use dynamic loading you'll need to set
-# your $LD_LIBRARY_PATH to include the source directory when you build,
-# test and install the software.
-#
# -Roderick Schertler <roderick@argon.org>
-
# Here are the things from some old DGUX hints files which are different
# from what's in here now. I don't know the exact reasons that most of
# these settings were in the hints files, presumably they can be chalked
diff --git a/hints/epix.sh b/hints/epix.sh
index b91537a202..03d5be536c 100644
--- a/hints/epix.sh
+++ b/hints/epix.sh
@@ -64,12 +64,3 @@ lddlflags="-G $ldflags" # Probably needed for dynamic loading
# We _do_ want the -L paths in ldflags, but we don't want the -non_shared.
lddlflags=`echo $lddlflags | sed 's/-non_shared//'`
-cat <<'EOM' >&4
-
-If you wish to use dynamic linking, you must use
- LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
-or
- setenv LD_LIBRARY_PATH `pwd`
-before running make.
-
-EOM
diff --git a/hints/esix4.sh b/hints/esix4.sh
index 3d3145d255..695f8b870f 100644
--- a/hints/esix4.sh
+++ b/hints/esix4.sh
@@ -30,12 +30,3 @@ EOM
rm -f /tmp/esix$$
fi
-cat <<'EOM' >&4
-
-If you wish to use dynamic linking, you must use
- LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
-or
- setenv LD_LIBRARY_PATH `pwd`
-before running make.
-
-EOM
diff --git a/hints/hpux.sh b/hints/hpux.sh
index b215335c72..8240b3ed2c 100644
--- a/hints/hpux.sh
+++ b/hints/hpux.sh
@@ -186,6 +186,12 @@ case "$d_dosuid" in
'') d_dosuid="$undef" ;;
esac
+# HP-UX 11 groks also LD_LIBRARY_PATH but SHLIB_PATH
+# is recommended for compatibility.
+case "$ldlibpthname" in
+'') ldlibpthname=SHLIB_PATH ;;
+esac
+
# Date: Fri, 6 Sep 96 23:15:31 CDT
# From: "Daniel S. Lewart" <d-lewart@uiuc.edu>
# I looked through the gcc.info and found this:
diff --git a/hints/next_4.sh b/hints/next_4.sh
index 8bc623a9e4..ba096ac9fd 100644
--- a/hints/next_4.sh
+++ b/hints/next_4.sh
@@ -1,13 +1,3 @@
-######################################################################
-#
-# IMPORTANT: before you run 'make', you need to enter one of these two
-# lines (depending on your shell):
-# DYLD_LIBRARY_PATH=`pwd`; export DYLD_LIBRARY_PATH
-# or
-# setenv DYLD_LIBRARY_PATH `pwd`
-#
-######################################################################
-
# Posix support has been removed from NextStep
#
useposix='undef'
@@ -106,3 +96,7 @@ clocktype='int'
# running ranlib. The '5' is an empirical number that's "long enough."
# (Thanks to Andreas Koenig <k@franz.ww.tu-berlin.de>)
ranlib='sleep 5; /bin/ranlib'
+
+case "$ldlibpthname" in
+'') ldlibpthname=DYLD_LIBRARY_PATH ;;
+esac
diff --git a/hints/os2.sh b/hints/os2.sh
index e49ab7f124..6eef5e37dc 100644
--- a/hints/os2.sh
+++ b/hints/os2.sh
@@ -351,5 +351,9 @@ for xxx in * ; do
fi
done
+case "$ldlibpthname" in
+'') ldlibpthname=none ;;
+esac
+
# Now go back
cd ../..
diff --git a/hints/rhapsody.sh b/hints/rhapsody.sh
index 7f652234c7..c564c8827e 100644
--- a/hints/rhapsody.sh
+++ b/hints/rhapsody.sh
@@ -52,3 +52,8 @@ usevfork='true';
# malloc works
usemymalloc='n';
+
+case "$ldlibpthname" in
+'') ldlibpthname=DYLD_LIBRARY_PATH ;;
+esac
+
diff --git a/hints/svr4.sh b/hints/svr4.sh
index cf6906dac7..8109b39752 100644
--- a/hints/svr4.sh
+++ b/hints/svr4.sh
@@ -142,12 +142,3 @@ d_lstat=define
d_suidsafe='define' # "./Configure -d" can't figure this out easilly
-cat <<'EOM' >&4
-
-If you wish to use dynamic linking, you must use
- LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
-or
- setenv LD_LIBRARY_PATH `pwd`
-before running make.
-
-EOM
diff --git a/jpl/JNI/JNI.pm b/jpl/JNI/JNI.pm
index 455a130d9f..82bedf9c62 100644
--- a/jpl/JNI/JNI.pm
+++ b/jpl/JNI/JNI.pm
@@ -229,7 +229,7 @@ if (not $JPL::_env_) {
$ENV{THREADS_TYPE} ||= "green_threads";
$JAVALIB = "$ENV{JAVA_HOME}/lib/$arch/$ENV{THREADS_TYPE}";
- $ENV{LD_LIBRARY_PATH} .= ":$JAVALIB";
+ $ENV{$Config{ldlibpthname}":$JAVALIB";
$JVM = GetJavaVM("$JAVALIB/libjava.so",@JVM_ARGS);
}
diff --git a/jpl/install-jpl b/jpl/install-jpl
index 546ae91cc1..c1ef0b4e12 100755
--- a/jpl/install-jpl
+++ b/jpl/install-jpl
@@ -187,8 +187,14 @@ archname=`$JPLPERL -MConfig -e 'print $Config{archname}'`
CLASSPATH=".:$JPL_HOME/lib${CLASSPATH:+:$CLASSPATH}"
export CLASSPATH
-LD_LIBRARY_PATH=".:$JPL_HOME/lib/$archname:$archlib/CORE${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
-export LD_LIBRARY_PATH
+ldlibpthname=`$JPLPERL -MConfig -e 'print $Config{ldlibpthname}'`
+case "$ldlibpthname" in
+'') ldlibpthname=LD_LIBRARY_PATH ;;
+esac
+eval "ldlibpth=\$$ldlibpthname"
+
+$ldlibpthname=".:$JPL_HOME/lib/$archname:$archlib/CORE$ldlibpth"
+export $ldlibpthname
PERL5LIB="$JPL_HOME/perl${PERL5LIB:+:$PERL5LIB}"
export PERL5LIB
@@ -205,13 +211,13 @@ case "$1" in
\$ENV{JPL_HOME} = '$JPL_HOME';
\$ENV{JPLPERL} = '$JPLPERL';
\$ENV{CLASSPATH} = '$CLASSPATH';
-\$ENV{LD_LIBRARY_PATH} = '$LD_LIBRARY_PATH';
+\$ENV{$ldlibpthname} = '$ldlibpth';
\$ENV{PERL5LIB} = '$PERL5LIB';
END
;;
-sh)
cat <<END
- PATH='$PATH';export PATH;JAVA_HOME='$JAVA_HOME';export JAVA_HOME;JPL_HOME='$JPL_HOME';export JPL_HOME;JPLPERL='$JPLPERL';export JPLPERL;CLASSPATH='$CLASSPATH';export CLASSPATH;LD_LIBRARY_PATH='$LD_LIBRARY_PATH';export LD_LIBRARY_PATH;PERL5LIB='$PERL5LIB';export PERL5LIB
+ PATH='$PATH';export PATH;JAVA_HOME='$JAVA_HOME';export JAVA_HOME;JPL_HOME='$JPL_HOME';export JPL_HOME;JPLPERL='$JPLPERL';export JPLPERL;CLASSPATH='$CLASSPATH';export CLASSPATH;$ldlibpthname='$ldlibpth';export $ldlibpthname;PERL5LIB='$PERL5LIB';export PERL5LIB
END
;;
-csh)
@@ -221,7 +227,7 @@ setenv JAVA_HOME '$JAVA_HOME';
setenv JPL_HOME '$JPL_HOME';
setenv JPLPERL '$JPLPERL';
setenv CLASSPATH '$CLASSPATH';
-setenv LD_LIBRARY_PATH '$LD_LIBRARY_PATH';
+setenv $ldlibpthname '$ldlibpth';
setenv PERL5LIB '$PERL5LIB';
END
;;
diff --git a/utils/perlbug.PL b/utils/perlbug.PL
index 377893a959..c25eec01c3 100644
--- a/utils/perlbug.PL
+++ b/utils/perlbug.PL
@@ -527,9 +527,11 @@ EOF
---
Environment for perl $]:
EOF
- for my $env (sort
- (qw(PATH LD_LIBRARY_PATH LANG PERL_BADLANG SHELL HOME LOGDIR LANGUAGE),
- grep /^(?:PERL|LC_)/, keys %ENV)
+ my @env =
+ qw(PATH LD_LIBRARY_PATH LANG PERL_BADLANG SHELL HOME LOGDIR LANGUAGE);
+ push @env, $Config{ldlibpthname} if $Config{ldlibpthname} ne '';
+ for my $env (sort @env,
+ grep /^(?:PERL|LC_)/, keys %ENV)
) {
print OUT " $env",
exists $ENV{$env} ? "=$ENV{$env}" : ' (unset)',