From: Jarkko Hietaniemi Date: Fri, 23 Jul 1999 11:58:49 +0000 (+0000) Subject: Introduce $Config{ldlibpthname} which contains X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5cf1d1f16c1401220ecaa7b3127343c7c6c095d2;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/Configure b/Configure index da92f7b..04f7db3 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$$ <&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 267a533..79953c7 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 96c9962..3e30698 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 0f255a7..2bd092d 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 8d76bc5..8017dce 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 14fb300..7d68892 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 03b285d..9a6f7a4 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 - # 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 b91537a..03d5be5 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 3d3145d..695f8b8 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 b215335..8240b3e 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" # I looked through the gcc.info and found this: diff --git a/hints/next_4.sh b/hints/next_4.sh index 8bc623a..ba096ac 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 ) ranlib='sleep 5; /bin/ranlib' + +case "$ldlibpthname" in +'') ldlibpthname=DYLD_LIBRARY_PATH ;; +esac diff --git a/hints/os2.sh b/hints/os2.sh index e49ab7f..6eef5e3 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 7f65223..c564c88 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 cf6906d..8109b39 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 455a130..82bedf9 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 546ae91..c1ef0b4 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 <