|
|
#! /bin/sh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func_usage () |
|
|
{ |
|
|
echo "\ |
|
|
Usage: config.libpath [OPTION] HOST HOST_CPU_C_ABI_32BIT |
|
|
|
|
|
Prints shell variable assignments that describe how to set the |
|
|
run time search path of shared libraries in an executable at run time. |
|
|
|
|
|
The first argument passed to this file is the canonical host specification, |
|
|
CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM |
|
|
or |
|
|
CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM |
|
|
|
|
|
The second argument passed to this file is 'yes' if the C language ABI |
|
|
is 32-bit, or 'no' if it is 64-bit. |
|
|
|
|
|
The environment variable LD should be set by the caller. |
|
|
|
|
|
The set of defined variables is at the end of this script. |
|
|
|
|
|
Options: |
|
|
--help print this help and exit |
|
|
--version print version information and exit |
|
|
|
|
|
Send patches and bug reports to <bug-gnulib@gnu.org>." |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func_version () |
|
|
{ |
|
|
echo "config.libpath (GNU gnulib, module relocatable-prog)" |
|
|
echo "Copyright (C) 2025 Free Software Foundation, Inc. |
|
|
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> |
|
|
This is free software: you are free to change and redistribute it. |
|
|
There is NO WARRANTY, to the extent permitted by law." |
|
|
echo |
|
|
printf 'Written by %s.\n' "Bruno Haible" |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func_fatal_error () |
|
|
{ |
|
|
echo "config.libpath: *** $1" 1>&2 |
|
|
echo "config.libpath: *** Stop." 1>&2 |
|
|
exit 1 |
|
|
} |
|
|
|
|
|
|
|
|
while test $# -gt 0; do |
|
|
case "$1" in |
|
|
--help | --hel | --he | --h ) |
|
|
func_usage |
|
|
exit 0 ;; |
|
|
--version | --versio | --versi | --vers | --ver | --ve | --v ) |
|
|
func_version |
|
|
exit 0 ;; |
|
|
-- ) |
|
|
shift; break ;; |
|
|
-* ) |
|
|
func_fatal_error "unrecognized option: $1" |
|
|
;; |
|
|
* ) |
|
|
break ;; |
|
|
esac |
|
|
done |
|
|
|
|
|
if test $# -gt 2; then |
|
|
func_fatal_error "too many arguments" |
|
|
fi |
|
|
if test $# -lt 2; then |
|
|
func_fatal_error "too few arguments" |
|
|
fi |
|
|
|
|
|
host="$1" |
|
|
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` |
|
|
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` |
|
|
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` |
|
|
abi_32bit="$2" |
|
|
|
|
|
shlibpath_var= |
|
|
case $host_os in |
|
|
aix3*) |
|
|
shlibpath_var=LIBPATH |
|
|
;; |
|
|
aix[4-9]*) |
|
|
if test "$host_cpu" = ia64; then |
|
|
|
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
else |
|
|
shlibpath_var=LIBPATH |
|
|
fi |
|
|
;; |
|
|
beos*) |
|
|
shlibpath_var=LIBRARY_PATH |
|
|
;; |
|
|
bsdi[45]*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
cygwin* | mingw* | pw32* | cegcc*) |
|
|
|
|
|
shlibpath_var=PATH |
|
|
;; |
|
|
darwin* | rhapsody*) |
|
|
shlibpath_var=DYLD_LIBRARY_PATH |
|
|
;; |
|
|
dgux*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
freebsd* | dragonfly* | midnightbsd*) |
|
|
case $host_cpu in |
|
|
powerpc64) |
|
|
if test "$abi_32bit" != yes; then |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
else |
|
|
shlibpath_var=LD_32_LIBRARY_PATH |
|
|
fi |
|
|
;; |
|
|
*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
esac |
|
|
;; |
|
|
gnu*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
hpux9* | hpux10* | hpux11*) |
|
|
case "$host_cpu" in |
|
|
ia64* | hppa*64*) shlibpath_var=LD_LIBRARY_PATH ;; |
|
|
*) shlibpath_var=SHLIB_PATH ;; |
|
|
esac |
|
|
;; |
|
|
interix[3-9]*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
nonstopux*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
linux*oldld* | linux*aout* | linux*coff*) |
|
|
;; |
|
|
linux* | k*bsd*-gnu) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
netbsd*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
newsos6) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
nto-qnx*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
openbsd*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
os2*) |
|
|
shlibpath_var=LIBPATH |
|
|
;; |
|
|
osf3* | osf4* | osf5*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
rdos*) |
|
|
;; |
|
|
solaris*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
sunos4*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
sysv4 | sysv4.3*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
sysv4*MP*) |
|
|
if test -d /usr/nec ;then |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
fi |
|
|
;; |
|
|
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
uts4*) |
|
|
shlibpath_var=LD_LIBRARY_PATH |
|
|
;; |
|
|
esac |
|
|
|
|
|
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF |
|
|
|
|
|
# This is the shared library path variable. |
|
|
shlibpath_var=$shlibpath_var |
|
|
|
|
|
EOF |
|
|
|