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-2007 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.
37
# All known linkers require a `.a' archive for static linking (except M$VC,
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,
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
# 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.
48
53
if test "$GCC" = yes; then
52
aix3* | aix4* | aix5*)
67
mingw* | cygwin* | pw32* | os2*)
55
69
hpux9* | hpux10* | hpux11*)
72
irix5* | irix6* | nonstopux*)
62
echo '__INTEL_COMPILER' > conftest.$ac_ext
63
if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
92
case `$CC -V 2>&1 | sed 5q` in
71
100
osf3* | osf4* | osf5*)
80
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
81
if test "x$host_vendor" = xsni; then
111
sysv4 | sysv4.2uw2* | sysv4.3*)
116
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
127
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
90
129
hardcode_libdir_flag_spec=
91
130
hardcode_libdir_separator=
92
131
hardcode_direct=no
110
153
if test "$with_gnu_ld" = yes; then
154
# Set some defaults for GNU ld with shared library support. These
155
# are reset later if shared libraries are not supported. Putting them
156
# here allows them to be overridden if necessary.
157
# Unlike libtool, we use -rpath here, not --rpath, since the documented
158
# option of GNU ld is called -rpath, not --rpath.
159
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
111
160
case "$host_os" in
112
161
aix3* | aix4* | aix5*)
113
# On AIX, the GNU linker is very broken
162
# On AIX/PPC, the GNU linker is very broken
163
if test "$host_cpu" != ia64; then
117
168
hardcode_libdir_flag_spec='-L$libdir'
135
186
# hardcode_libdir_flag_spec is actually meaningless, as there is
136
187
# no search path for DLLs.
137
188
hardcode_libdir_flag_spec='-L$libdir'
140
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
142
elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
189
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
197
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
199
gnu* | linux* | k*bsd*-gnu)
200
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
209
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
211
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
217
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
218
case `$LD -v 2>&1` in
219
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
223
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
224
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
149
232
hardcode_direct=yes
152
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
235
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
159
if test "$ld_shlibs" = yes; then
160
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
242
if test "$ld_shlibs" = no; then
243
hardcode_libdir_flag_spec=
163
246
case "$host_os" in
207
291
hardcode_libdir_flag_spec='-L$libdir'
208
292
hardcode_libdir_separator=
297
# Begin _LT_AC_SYS_LIBPATH_AIX.
298
echo 'int main () { return 0; }' > conftest.c
299
${CC} ${LDFLAGS} conftest.c -o conftest
300
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
302
if test -z "$aix_libpath"; then
303
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
306
if test -z "$aix_libpath"; then
307
aix_libpath="/usr/lib:/lib"
309
rm -f conftest.c conftest
310
# End _LT_AC_SYS_LIBPATH_AIX.
212
311
if test "$aix_use_runtimelinking" = yes; then
213
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
312
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
215
314
if test "$host_cpu" = ia64; then
216
315
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
218
hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
317
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
247
362
hardcode_direct=yes
248
363
hardcode_minus_L=yes
365
freebsd* | dragonfly*)
251
366
hardcode_libdir_flag_spec='-R$libdir'
252
367
hardcode_direct=yes
254
hpux9* | hpux10* | hpux11*)
255
370
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
256
371
hardcode_libdir_separator=:
257
372
hardcode_direct=yes
258
hardcode_minus_L=yes # Not in the search PATH, but as the default
259
# location of the library.
373
# hardcode_minus_L: Not really in the search PATH,
374
# but as the default location of the library.
378
if test "$with_gnu_ld" = no; then
379
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
380
hardcode_libdir_separator=:
382
# hardcode_minus_L: Not really in the search PATH,
383
# but as the default location of the library.
388
if test "$with_gnu_ld" = no; then
389
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
390
hardcode_libdir_separator=:
397
# hardcode_minus_L: Not really in the search PATH,
398
# but as the default location of the library.
404
irix5* | irix6* | nonstopux*)
262
405
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
263
406
hardcode_libdir_separator=:
272
415
hardcode_libdir_separator=:
276
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
277
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
418
if test -f /usr/libexec/ld.so; then
420
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
421
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
424
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
425
hardcode_libdir_flag_spec='-R$libdir'
428
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
280
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
281
hardcode_libdir_flag_spec='-R$libdir'
284
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
314
459
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
464
hardcode_direct=yes # is this really true???
470
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
477
if test -d /usr/nec; then
343
sysv5uw7* | unixware7*)
481
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
483
sysv5* | sco3.2v5* | sco5v6*)
484
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
485
hardcode_libdir_separator=':'
488
hardcode_libdir_flag_spec='-L$libdir'
351
496
# Check dynamic linker characteristics
497
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
498
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
499
# only about the one the linker finds when passed -lNAME. This is the last
500
# element of library_names_spec in libtool.m4, or possibly two of them if the
501
# linker has special search rules.
502
library_names_spec= # the last element of library_names_spec in libtool.m4
352
503
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
504
case "$host_os" in
506
library_names_spec='$libname.a'
509
library_names_spec='$libname$shrext'
512
library_names_spec='$libname.a'
515
library_names_spec='$libname$shrext'
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"
518
library_names_spec='$libname$shrext'
373
520
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"`
522
library_names_spec='$libname.dll.a $libname.lib'
390
524
darwin* | rhapsody*)
526
library_names_spec='$libname$shrext'
529
library_names_spec='$libname$shrext'
533
freebsd* | dragonfly*)
536
library_names_spec='$libname$shrext$versuffix' ;;
538
library_names_spec='$libname$shrext' ;;
542
library_names_spec='$libname$shrext'
401
544
hpux9* | hpux10* | hpux11*)
556
library_names_spec='$libname$shrext'
559
library_names_spec='$libname$shrext'
561
irix5* | irix6* | nonstopux*)
562
library_names_spec='$libname$shrext'
406
563
case "$host_os" in
408
565
libsuff= shlibsuff=
412
*-32|*"-32 ") libsuff= shlibsuff= ;;
413
*-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
414
*-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
569
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
570
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
571
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
415
572
*) 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*)
577
linux*oldld* | linux*aout* | linux*coff*)
580
library_names_spec='$libname$shrext'
583
library_names_spec='$libname$shrext'
586
library_names_spec='$libname$shrext'
589
library_names_spec='$libname$shrext'
592
library_names_spec='$libname$shrext'
595
library_names_spec='$libname$shrext$versuffix'
437
598
libname_spec='$name'
600
library_names_spec='$libname.a'
440
602
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"
603
library_names_spec='$libname$shrext'
608
library_names_spec='$libname$shrext'
454
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
456
case "$host_vendor" in
458
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
611
library_names_spec='$libname$shrext$versuffix'
614
library_names_spec='$libname$shrext'
617
library_names_spec='$libname$shrext'
619
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
620
library_names_spec='$libname$shrext'
469
if test -d /usr/nec; then
623
library_names_spec='$libname$shrext'
475
627
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
476
628
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
629
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
630
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
631
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
477
632
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
634
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
483
636
# How to pass a linker flag through the compiler.