2
# Output a system dependent set of variables, describing how to set the
3
# run time search path of shared libraries in an executable.
5
# Copyright 1996-2006 Free Software Foundation, Inc.
6
# Taken from GNU libtool, 2001
7
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
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.
13
# The first argument passed to this file is the canonical host specification,
14
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
16
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
17
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
18
# should be set by the caller.
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.
28
# All known linkers require a `.a' archive for static linking (except MSVC,
29
# which needs '.lib').
34
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
35
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
36
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
38
# Code taken from libtool.m4's _LT_CC_BASENAME.
40
for cc_temp in $CC""; do
42
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
43
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
48
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
50
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
53
if test "$GCC" = yes; then
67
mingw* | pw32* | os2*)
69
hpux9* | hpux10* | hpux11*)
72
irix5* | irix6* | nonstopux*)
92
case `$CC -V 2>&1 | sed 5q` in
100
osf3* | osf4* | osf5*)
111
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
124
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
126
hardcode_libdir_flag_spec=
127
hardcode_libdir_separator=
132
cygwin* | mingw* | pw32*)
133
# FIXME: the MSVC++ port hasn't been tested in a loooong time
134
# When not using gcc, we currently assume that we are using
135
# Microsoft Visual C++.
136
if test "$GCC" != yes; then
141
# we just hope/assume this is gcc and not c89 (= MSVC++)
150
if test "$with_gnu_ld" = yes; then
151
# Set some defaults for GNU ld with shared library support. These
152
# are reset later if shared libraries are not supported. Putting them
153
# here allows them to be overridden if necessary.
154
# Unlike libtool, we use -rpath here, not --rpath, since the documented
155
# option of GNU ld is called -rpath, not --rpath.
156
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
158
aix3* | aix4* | aix5*)
159
# On AIX/PPC, the GNU linker is very broken
160
if test "$host_cpu" != ia64; then
165
hardcode_libdir_flag_spec='-L$libdir'
167
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
168
# that the semantics of dynamic libraries on AmigaOS, at least up
169
# to version 4, is to share data among multiple programs linked
170
# with the same dynamic library. Since this doesn't match the
171
# behavior of shared libraries on other platforms, we cannot use
176
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
182
cygwin* | mingw* | pw32*)
183
# hardcode_libdir_flag_spec is actually meaningless, as there is
184
# no search path for DLLs.
185
hardcode_libdir_flag_spec='-L$libdir'
186
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
194
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
197
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
206
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
208
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
214
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
215
case `$LD -v 2>&1` in
216
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
220
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
221
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
232
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
239
if test "$ld_shlibs" = no; then
240
hardcode_libdir_flag_spec=
245
# Note: this linker hardcodes the directories in LIBPATH if there
246
# are no directories specified by -L.
248
if test "$GCC" = yes; then
249
# Neither direct hardcoding nor static linking is supported with a
251
hardcode_direct=unsupported
255
if test "$host_cpu" = ia64; then
256
# On IA64, the linker does run time linking by default, so we don't
257
# have to do anything special.
258
aix_use_runtimelinking=no
260
aix_use_runtimelinking=no
261
# Test if we are trying to use run time linking or normal
262
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
263
# need to do runtime linking.
264
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
265
for ld_flag in $LDFLAGS; do
266
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
267
aix_use_runtimelinking=yes
275
hardcode_libdir_separator=':'
276
if test "$GCC" = yes; then
277
case $host_os in aix4.[012]|aix4.[012].*)
278
collect2name=`${CC} -print-prog-name=collect2`
279
if test -f "$collect2name" && \
280
strings "$collect2name" | grep resolve_lib_name >/dev/null
282
# We have reworked collect2
285
# We have old collect2
286
hardcode_direct=unsupported
288
hardcode_libdir_flag_spec='-L$libdir'
289
hardcode_libdir_separator=
294
# Begin _LT_AC_SYS_LIBPATH_AIX.
295
echo 'int main () { return 0; }' > conftest.c
296
${CC} ${LDFLAGS} conftest.c -o conftest
297
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
299
if test -z "$aix_libpath"; then
300
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
303
if test -z "$aix_libpath"; then
304
aix_libpath="/usr/lib:/lib"
306
rm -f conftest.c conftest
307
# End _LT_AC_SYS_LIBPATH_AIX.
308
if test "$aix_use_runtimelinking" = yes; then
309
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
311
if test "$host_cpu" = ia64; then
312
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
314
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
319
hardcode_libdir_flag_spec='-L$libdir'
321
# see comment about different semantics on the GNU ld section
326
cygwin* | mingw* | pw32*)
327
# When not using gcc, we currently assume that we are using
328
# Microsoft Visual C++.
329
# hardcode_libdir_flag_spec is actually meaningless, as there is
330
# no search path for DLLs.
331
hardcode_libdir_flag_spec=' '
336
if test "$GCC" = yes ; then
349
hardcode_libdir_flag_spec='-L$libdir'
355
hardcode_libdir_flag_spec='-R$libdir'
362
freebsd* | kfreebsd*-gnu | dragonfly*)
363
hardcode_libdir_flag_spec='-R$libdir'
367
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
368
hardcode_libdir_separator=:
370
# hardcode_minus_L: Not really in the search PATH,
371
# but as the default location of the library.
375
if test "$with_gnu_ld" = no; then
376
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
377
hardcode_libdir_separator=:
379
# hardcode_minus_L: Not really in the search PATH,
380
# but as the default location of the library.
385
if test "$with_gnu_ld" = no; then
386
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
387
hardcode_libdir_separator=:
394
# hardcode_minus_L: Not really in the search PATH,
395
# but as the default location of the library.
401
irix5* | irix6* | nonstopux*)
402
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
403
hardcode_libdir_separator=:
406
hardcode_libdir_flag_spec='-R$libdir'
411
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
412
hardcode_libdir_separator=:
416
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
417
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
420
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
421
hardcode_libdir_flag_spec='-R$libdir'
424
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
430
hardcode_libdir_flag_spec='-L$libdir'
434
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
435
hardcode_libdir_separator=:
438
if test "$GCC" = yes; then
439
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
441
# Both cc and cxx compiler support -rpath directly
442
hardcode_libdir_flag_spec='-rpath $libdir'
444
hardcode_libdir_separator=:
447
hardcode_libdir_flag_spec='-R$libdir'
450
hardcode_libdir_flag_spec='-L$libdir'
457
hardcode_direct=yes # is this really true???
463
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
470
if test -d /usr/nec; then
474
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
476
sysv5* | sco3.2v5* | sco5v6*)
477
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
478
hardcode_libdir_separator=':'
481
hardcode_libdir_flag_spec='-L$libdir'
489
# Check dynamic linker characteristics
490
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
491
libname_spec='lib$name'
503
cygwin* | mingw* | pw32*)
515
freebsd* | dragonfly*)
519
hpux9* | hpux10* | hpux11*)
534
irix5* | irix6* | nonstopux*)
541
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
542
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
543
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
544
*) libsuff= shlibsuff= ;;
549
linux*oldld* | linux*aout* | linux*coff*)
567
osf3* | osf4* | osf5*)
577
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
583
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
584
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
585
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
586
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
588
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
590
# How to pass a linker flag through the compiler.
593
# Static library suffix (normally "a").
596
# Shared library suffix (normally "so").
599
# Flag to hardcode \$libdir into a binary during linking.
600
# This must work even if \$libdir does not exist.
601
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
603
# Whether we need a single -rpath flag with a separated argument.
604
hardcode_libdir_separator="$hardcode_libdir_separator"
606
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
608
hardcode_direct="$hardcode_direct"
610
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
612
hardcode_minus_L="$hardcode_minus_L"