2 # Output a system dependent set of variables, describing how to set the
3 # run time search path of shared libraries in an executable at run time.
5 # Copyright 1996-2024 Free Software Foundation, Inc.
6 # Taken from GNU libtool, 2003
7 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <https://www.gnu.org/licenses/>.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
28 # outputs to stdout the --help usage message.
32 Usage: config.libpath [OPTION] HOST
34 Prints shell variable assignments that describe how to set the
35 run time search path of shared libraries in an executable at run time.
37 The first argument passed to this file is the canonical host specification,
38 CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
40 CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
42 The environment variable LD should be set by the caller.
44 The set of defined variables is at the end of this script.
47 --help print this help and exit
48 --version print version information and exit
50 Send patches and bug reports to <bug-gnulib@gnu.org>."
54 # outputs to stdout the --version message.
57 echo "config.libpath (GNU gnulib, module relocatable-prog)"
58 echo "Copyright (C) 2024 Free Software Foundation, Inc.
59 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
60 This is free software: you are free to change and redistribute it.
61 There is NO WARRANTY, to the extent permitted by law."
63 printf 'Written by %s.\n' "Bruno Haible"
66 # func_fatal_error message
67 # outputs to stderr a fatal error message, and terminates the program.
70 echo "config.libpath: *** $1" 1>&2
71 echo "config.libpath: *** Stop." 1>&2
75 # Command-line option processing.
76 while test $# -gt 0; do
78 --help |
--hel |
--he |
--h )
81 --version |
--versio |
--versi |
--vers |
--ver |
--ve |
--v )
84 -- ) # Stop option processing
87 func_fatal_error
"unrecognized option: $1"
94 if test $# -gt 1; then
95 func_fatal_error
"too many arguments"
97 if test $# -lt 1; then
98 func_fatal_error
"too few arguments"
102 host_cpu
=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
103 host_vendor
=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
104 host_os
=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
109 shlibpath_var
=LIBPATH
112 if test "$host_cpu" = ia64
; then
113 # AIX 5 supports IA64
114 shlibpath_var
=LD_LIBRARY_PATH
116 shlibpath_var
=LIBPATH
120 shlibpath_var
=LIBRARY_PATH
123 shlibpath_var
=LD_LIBRARY_PATH
125 cygwin
* | mingw
* | pw32
* | cegcc
*)
126 # FIXME: first we should search . and the directory the executable is in
130 shlibpath_var
=DYLD_LIBRARY_PATH
133 shlibpath_var
=LD_LIBRARY_PATH
135 freebsd
* | dragonfly
* | midnightbsd
*)
136 shlibpath_var
=LD_LIBRARY_PATH
139 shlibpath_var
=LD_LIBRARY_PATH
141 hpux9
* | hpux10
* | hpux11
*)
143 ia64
* | hppa
*64*) shlibpath_var
=LD_LIBRARY_PATH
;;
144 *) shlibpath_var
=SHLIB_PATH
;;
148 shlibpath_var
=LD_LIBRARY_PATH
150 irix5
* | irix6
* | nonstopux
*)
156 case $LD in # libtool.m4 will add one of these switches to LD
157 *-32|
*"-32 ") shlibsuff
= ;;
158 *-n32|
*"-n32 ") shlibsuff
=N32
;;
159 *-64|
*"-64 ") shlibsuff
=64 ;;
164 shlibpath_var
=LD_LIBRARY
${shlibsuff}_PATH
166 linux
*oldld
* | linux
*aout
* | linux
*coff
*)
169 shlibpath_var
=LD_LIBRARY_PATH
172 shlibpath_var
=LD_LIBRARY_PATH
175 shlibpath_var
=LD_LIBRARY_PATH
178 shlibpath_var
=LD_LIBRARY_PATH
181 shlibpath_var
=LD_LIBRARY_PATH
184 shlibpath_var
=LIBPATH
186 osf3
* | osf4
* | osf5
*)
187 shlibpath_var
=LD_LIBRARY_PATH
192 shlibpath_var
=LD_LIBRARY_PATH
195 shlibpath_var
=LD_LIBRARY_PATH
198 shlibpath_var
=LD_LIBRARY_PATH
201 if test -d /usr
/nec
;then
202 shlibpath_var
=LD_LIBRARY_PATH
205 sysv5
* | sco3.2v5
* | sco5v6
* | unixware
* | OpenUNIX
* | sysv4
*uw2
*)
206 shlibpath_var
=LD_LIBRARY_PATH
209 shlibpath_var
=LD_LIBRARY_PATH
213 LC_ALL
=C
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
215 # This is the shared library path variable.
216 shlibpath_var=$shlibpath_var