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-2010 Free Software Foundation, Inc.
5
# Copyright 1996-2003 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 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.
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.
13
28
# The first argument passed to this file is the canonical host specification,
14
29
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
25
40
# known workaround is to choose shorter directory names for the build
26
41
# directory and/or the installation directory.
28
# All known linkers require a `.a' archive for static linking (except MSVC,
43
# All known linkers require a `.a' archive for static linking (except M$VC,
29
44
# which needs '.lib').
35
50
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
36
51
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 _LT_COMPILER_PIC.
53
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
53
56
if test "$GCC" = yes; then
117
sysv4 | sysv4.2uw2* | sysv4.3*)
94
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
122
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
133
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
104
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
135
106
hardcode_libdir_flag_spec=
136
107
hardcode_libdir_separator=
138
109
hardcode_minus_L=no
140
111
case "$host_os" in
141
cygwin* | mingw* | pw32* | cegcc*)
112
cygwin* | mingw* | pw32*)
142
113
# FIXME: the MSVC++ port hasn't been tested in a loooong time
143
114
# When not using gcc, we currently assume that we are using
144
115
# Microsoft Visual C++.
159
126
if test "$with_gnu_ld" = yes; then
160
# Set some defaults for GNU ld with shared library support. These
161
# are reset later if shared libraries are not supported. Putting them
162
# here allows them to be overridden if necessary.
163
# Unlike libtool, we use -rpath here, not --rpath, since the documented
164
# option of GNU ld is called -rpath, not --rpath.
165
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
166
127
case "$host_os" in
128
aix3* | aix4* | aix5*)
168
129
# On AIX/PPC, the GNU linker is very broken
169
130
if test "$host_cpu" != ia64; then
177
138
# that the semantics of dynamic libraries on AmigaOS, at least up
178
139
# to version 4, is to share data among multiple programs linked
179
140
# with the same dynamic library. Since this doesn't match the
180
# behavior of shared libraries on other platforms, we cannot use
141
# behavior of shared libraries on other platforms, we can use
191
cygwin* | mingw* | pw32* | cegcc*)
152
cygwin* | mingw* | pw32*)
192
153
# hardcode_libdir_flag_spec is actually meaningless, as there is
193
154
# no search path for DLLs.
194
155
hardcode_libdir_flag_spec='-L$libdir'
203
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
205
gnu* | linux* | k*bsd*-gnu)
206
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
215
165
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
217
167
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
223
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
224
case `$LD -v 2>&1` in
225
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
229
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
230
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
238
174
hardcode_direct=yes
248
if test "$ld_shlibs" = no; then
249
hardcode_libdir_flag_spec=
184
if test "$ld_shlibs" = yes; then
185
# Unlike libtool, we use -rpath here, not --rpath, since the documented
186
# option of GNU ld is called -rpath, not --rpath.
187
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
252
190
case "$host_os" in
260
198
hardcode_direct=unsupported
264
202
if test "$host_cpu" = ia64; then
265
203
# On IA64, the linker does run time linking by default, so we don't
266
204
# have to do anything special.
270
208
# Test if we are trying to use run time linking or normal
271
209
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
272
210
# need to do runtime linking.
273
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
211
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
274
212
for ld_flag in $LDFLAGS; do
275
213
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
276
214
aix_use_runtimelinking=yes
283
220
hardcode_direct=yes
330
266
# see comment about different semantics on the GNU ld section
335
cygwin* | mingw* | pw32* | cegcc*)
271
cygwin* | mingw* | pw32*)
336
272
# When not using gcc, we currently assume that we are using
337
273
# Microsoft Visual C++.
338
274
# hardcode_libdir_flag_spec is actually meaningless, as there is
380
307
# but as the default location of the library.
381
308
hardcode_minus_L=yes
384
if test "$with_gnu_ld" = no; then
385
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
386
hardcode_libdir_separator=:
388
# hardcode_minus_L: Not really in the search PATH,
389
# but as the default location of the library.
394
if test "$with_gnu_ld" = no; then
395
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
396
hardcode_libdir_separator=:
311
if test "$with_gnu_ld" = no; then
314
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
315
hardcode_libdir_separator=:
319
hardcode_libdir_flag_spec='-L$libdir'
321
# hardcode_minus_L: Not really in the search PATH,
322
# but as the default location of the library.
326
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
327
hardcode_libdir_separator=:
402
328
hardcode_direct=yes
403
329
# hardcode_minus_L: Not really in the search PATH,
404
330
# but as the default location of the library.
421
347
hardcode_libdir_separator=:
424
if test -f /usr/libexec/ld.so; then
426
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
427
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
430
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
431
hardcode_libdir_flag_spec='-R$libdir'
434
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
351
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
352
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
355
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
356
hardcode_libdir_flag_spec='-R$libdir'
359
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
487
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
489
sysv5* | sco3.2v5* | sco5v6*)
490
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
491
hardcode_libdir_separator=':'
415
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
418
hardcode_libdir_flag_spec=
494
421
hardcode_libdir_flag_spec='-L$libdir'
502
429
# Check dynamic linker characteristics
503
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
504
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
505
# only about the one the linker finds when passed -lNAME. This is the last
506
# element of library_names_spec in libtool.m4, or possibly two of them if the
507
# linker has special search rules.
508
library_names_spec= # the last element of library_names_spec in libtool.m4
430
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
509
431
libname_spec='lib$name'
510
432
case "$host_os" in
512
library_names_spec='$libname.a'
515
library_names_spec='$libname$shrext'
518
library_names_spec='$libname.a'
521
library_names_spec='$libname$shrext'
524
library_names_spec='$libname$shrext'
526
cygwin* | mingw* | pw32* | cegcc*)
443
cygwin* | mingw* | pw32*)
528
library_names_spec='$libname.dll.a $libname.lib'
530
446
darwin* | rhapsody*)
532
library_names_spec='$libname$shrext'
535
library_names_spec='$libname$shrext'
539
freebsd* | dragonfly*)
542
library_names_spec='$libname$shrext$versuffix' ;;
544
library_names_spec='$libname$shrext' ;;
548
library_names_spec='$libname$shrext'
550
457
hpux9* | hpux10* | hpux11*)
583
485
linux*oldld* | linux*aout* | linux*coff*)
586
library_names_spec='$libname$shrext'
589
library_names_spec='$libname$shrext'
592
library_names_spec='$libname$shrext'
595
library_names_spec='$libname$shrext'
598
library_names_spec='$libname$shrext'
601
library_names_spec='$libname$shrext$versuffix'
604
498
libname_spec='$name'
606
library_names_spec='$libname.a'
608
501
osf3* | osf4* | osf5*)
609
library_names_spec='$libname$shrext'
614
library_names_spec='$libname$shrext'
617
library_names_spec='$libname$shrext$versuffix'
620
library_names_spec='$libname$shrext'
509
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
623
library_names_spec='$libname$shrext'
625
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
626
library_names_spec='$libname$shrext'
629
library_names_spec='$libname$shrext'
633
517
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
634
518
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
635
519
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
636
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
637
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
638
520
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
640
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
522
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
642
524
# How to pass a linker flag through the compiler.
648
530
# Shared library suffix (normally "so").
649
531
shlibext="$shlibext"
651
# Format of library name prefix.
652
libname_spec="$escaped_libname_spec"
654
# Library names that the linker finds when passed -lNAME.
655
library_names_spec="$escaped_library_names_spec"
657
533
# Flag to hardcode \$libdir into a binary during linking.
658
534
# This must work even if \$libdir does not exist.
659
535
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"