File: config.libpath

package info (click to toggle)
gettext 0.23.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 168,104 kB
  • sloc: ansic: 532,579; sh: 68,252; perl: 28,011; makefile: 9,066; lisp: 3,184; yacc: 1,055; java: 615; cs: 589; cpp: 397; objc: 343; sed: 79; tcl: 63; xml: 40; pascal: 11; php: 7; awk: 7
file content (233 lines) | stat: -rwxr-xr-x 6,140 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable at run time.
#
#   Copyright 1996-2024 Free Software Foundation, Inc.
#   Taken from GNU libtool, 2003
#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
#   As a special exception to the GNU General Public License, if you
#   distribute this file as part of a program that contains a
#   configuration script generated by Autoconf, you may include it under
#   the same distribution terms that you use for the rest of that program.

# func_usage
# outputs to stdout the --help usage message.
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
# outputs to stdout the --version message.
func_version ()
{
  echo "config.libpath (GNU gnulib, module relocatable-prog)"
  echo "Copyright (C) 2024 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 message
# outputs to stderr a fatal error message, and terminates the program.
func_fatal_error ()
{
  echo "config.libpath: *** $1" 1>&2
  echo "config.libpath: *** Stop." 1>&2
  exit 1
}

# Command-line option processing.
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 ;;
    -- )      # Stop option processing
      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
      # AIX 5 supports IA64
      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*)
    # FIXME: first we should search . and the directory the executable is in
    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
    ;;
  irix5* | irix6* | nonstopux*)
    case $host_os in
      irix5* | nonstopux*)
        shlibsuff=
        ;;
      *)
        case $LD in # libtool.m4 will add one of these switches to LD
          *-32|*"-32 ") shlibsuff= ;;
          *-n32|*"-n32 ") shlibsuff=N32 ;;
          *-64|*"-64 ") shlibsuff=64 ;;
          *) shlibsuff= ;;
        esac
        ;;
    esac
    shlibpath_var=LD_LIBRARY${shlibsuff}_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