2
2
# Output a system dependent set of variables, describing how to set the
3
3
# run time search path of shared libraries in an executable.
5
# Copyright 1996-2002 Free Software Foundation, Inc.
5
# Copyright 1996-2005 Free Software Foundation, Inc.
6
6
# Taken from GNU libtool, 2001
7
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 2 of the License, or
12
# (at your option) any later version.
14
# This program is distributed in the hope that it will be useful, but
15
# WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
# 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, write to the Free Software
21
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
# As a special exception to the GNU General Public License, if you
24
# distribute this file as part of a program that contains a
25
# configuration script generated by Autoconf, you may include it under
26
# the same distribution terms that you use for the rest of that program.
9
# This file is free software; the Free Software Foundation gives
10
# unlimited permission to copy and/or distribute it, with or without
11
# modifications, as long as this notice is preserved.
28
13
# The first argument passed to this file is the canonical host specification,
29
14
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
35
20
# The set of defined variables is at the end of this script.
23
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
24
# than 256 bytes, otherwise the compiler driver will dump core. The only
25
# known workaround is to choose shorter directory names for the build
26
# directory and/or the installation directory.
37
28
# All known linkers require a `.a' archive for static linking (except M$VC,
38
29
# which needs '.lib').
43
34
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
44
35
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
45
36
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
38
cc_basename=`echo "$CC" | sed -e 's%^.*/%%'`
40
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
48
43
if test "$GCC" = yes; then
52
aix3* | aix4* | aix5*)
51
case "$cc_basename" in
57
mingw* | pw32* | os2*)
55
59
hpux9* | hpux10* | hpux11*)
62
irix5* | irix6* | nonstopux*)
62
echo '__INTEL_COMPILER' > conftest.$ac_ext
63
if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
71
83
osf3* | osf4* | osf5*)
80
94
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
81
if test "x$host_vendor" = xsni; then
107
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
90
109
hardcode_libdir_flag_spec=
91
110
hardcode_libdir_separator=
92
111
hardcode_direct=no
110
129
if test "$with_gnu_ld" = yes; then
111
130
case "$host_os" in
112
131
aix3* | aix4* | aix5*)
113
# On AIX, the GNU linker is very broken
132
# On AIX/PPC, the GNU linker is very broken
133
if test "$host_cpu" != ia64; then
117
138
hardcode_libdir_flag_spec='-L$libdir'
120
141
# that the semantics of dynamic libraries on AmigaOS, at least up
121
142
# to version 4, is to share data among multiple programs linked
122
143
# with the same dynamic library. Since this doesn't match the
123
# behavior of shared libraries on other platforms, we can use
144
# behavior of shared libraries on other platforms, we cannot use
128
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
149
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
135
156
# hardcode_libdir_flag_spec is actually meaningless, as there is
136
157
# no search path for DLLs.
137
158
hardcode_libdir_flag_spec='-L$libdir'
159
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
139
167
solaris* | sysv5*)
140
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
168
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
142
elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
170
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
159
194
if test "$ld_shlibs" = yes; then
195
# Unlike libtool, we use -rpath here, not --rpath, since the documented
196
# option of GNU ld is called -rpath, not --rpath.
160
197
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
249
# Begin _LT_AC_SYS_LIBPATH_AIX.
250
echo 'int main () { return 0; }' > conftest.c
251
${CC} ${LDFLAGS} conftest.c -o conftest
252
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
254
if test -z "$aix_libpath"; then
255
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
258
if test -z "$aix_libpath"; then
259
aix_libpath="/usr/lib:/lib"
261
rm -f conftest.c conftest
262
# End _LT_AC_SYS_LIBPATH_AIX.
212
263
if test "$aix_use_runtimelinking" = yes; then
213
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
264
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
215
266
if test "$host_cpu" = ia64; then
216
267
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
218
hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
269
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
247
314
hardcode_direct=yes
248
315
hardcode_minus_L=yes
317
freebsd* | kfreebsd*-gnu | dragonfly*)
251
318
hardcode_libdir_flag_spec='-R$libdir'
252
319
hardcode_direct=yes
254
hpux9* | hpux10* | hpux11*)
255
322
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
256
323
hardcode_libdir_separator=:
257
324
hardcode_direct=yes
258
hardcode_minus_L=yes # Not in the search PATH, but as the default
259
# location of the library.
325
# hardcode_minus_L: Not really in the search PATH,
326
# but as the default location of the library.
330
if test "$with_gnu_ld" = no; then
333
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
334
hardcode_libdir_separator=:
338
hardcode_libdir_flag_spec='-L$libdir'
340
# hardcode_minus_L: Not really in the search PATH,
341
# but as the default location of the library.
345
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
346
hardcode_libdir_separator=:
348
# hardcode_minus_L: Not really in the search PATH,
349
# but as the default location of the library.
355
irix5* | irix6* | nonstopux*)
262
356
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
263
357
hardcode_libdir_separator=:
314
408
hardcode_minus_L=yes
317
if test "x$host_vendor" = xsno; then
318
hardcode_direct=yes # is this really true???
320
hardcode_direct=no # Motorola manual says yes, but my tests say they lie
413
hardcode_direct=yes # is this really true???
419
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
326
hardcode_libdir_flag_spec=
329
hardcode_libdir_flag_spec='-L$libdir'
332
hardcode_libdir_flag_spec='-L$libdir'
335
426
if test -d /usr/nec; then
351
448
# Check dynamic linker characteristics
449
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
352
450
libname_spec='lib$name'
353
sys_lib_dlsearch_path_spec="/lib /usr/lib"
354
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
355
451
case "$host_os" in
370
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
371
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
373
462
cygwin* | mingw* | pw32*)
374
case $GCC,$host_os in
380
sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
390
465
darwin* | rhapsody*)
401
478
hpux9* | hpux10* | hpux11*)
491
irix5* | irix6* | nonstopux*)
406
492
case "$host_os" in
408
494
libsuff= shlibsuff=
412
*-32|*"-32 ") libsuff= shlibsuff= ;;
413
*-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
414
*-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
498
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
499
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
500
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
415
501
*) libsuff= shlibsuff= ;;
419
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
420
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
422
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
506
linux*oldld* | linux*aout* | linux*coff*)
437
521
libname_spec='$name'
440
524
osf3* | osf4* | osf5*)
442
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
443
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
454
532
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
456
case "$host_vendor" in
458
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
469
if test -d /usr/nec; then
475
540
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
476
541
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
542
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
477
543
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
478
escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
479
escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
481
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
545
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
483
547
# How to pass a linker flag through the compiler.
504
568
# resulting binary.
505
569
hardcode_minus_L="$hardcode_minus_L"
507
# Compile-time system search path for libraries
508
sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
510
# Run-time system search path for libraries
511
sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"