libssh2
/
config.rpath
662 строки · 17.8 Кб
1#! /bin/sh
2# Output a system dependent set of variables, describing how to set the
3# run time search path of shared libraries in an executable.
4#
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
8#
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.
12#
13# The first argument passed to this file is the canonical host specification,
14# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
15# or
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.
19#
20# The set of defined variables is at the end of this script.
21
22# Known limitations:
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.
27#
28# SPDX-License-Identifier: FSFULLR
29
30# All known linkers require a `.a' archive for static linking (except MSVC,
31# which needs '.lib').
32libext=a
33shrext=.so
34
35host="$1"
36host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
37host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
38host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
39
40# Code taken from libtool.m4's _LT_CC_BASENAME.
41
42for cc_temp in $CC""; do
43case $cc_temp in
44compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
45distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
46\-*) ;;
47*) break;;
48esac
49done
50cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
51
52# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
53
54wl=
55if test "$GCC" = yes; then
56wl='-Wl,'
57else
58case "$host_os" in
59aix*)
60wl='-Wl,'
61;;
62darwin*)
63case $cc_basename in
64xlc*)
65wl='-Wl,'
66;;
67esac
68;;
69mingw* | pw32* | os2*)
70;;
71hpux9* | hpux10* | hpux11*)
72wl='-Wl,'
73;;
74irix5* | irix6* | nonstopux*)
75wl='-Wl,'
76;;
77newsos6)
78;;
79linux*)
80case $cc_basename in
81icc* | ecc*)
82wl='-Wl,'
83;;
84pgcc | pgf77 | pgf90)
85wl='-Wl,'
86;;
87ccc*)
88wl='-Wl,'
89;;
90como)
91wl='-lopt='
92;;
93*)
94case `$CC -V 2>&1 | sed 5q` in
95*Sun\ C*)
96wl='-Wl,'
97;;
98esac
99;;
100esac
101;;
102osf3* | osf4* | osf5*)
103wl='-Wl,'
104;;
105sco3.2v5*)
106;;
107solaris*)
108wl='-Wl,'
109;;
110sunos4*)
111wl='-Qoption ld '
112;;
113sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
114wl='-Wl,'
115;;
116sysv4*MP*)
117;;
118unicos*)
119wl='-Wl,'
120;;
121uts4*)
122;;
123esac
124fi
125
126# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
127
128hardcode_libdir_flag_spec=
129hardcode_libdir_separator=
130hardcode_direct=no
131hardcode_minus_L=no
132
133case "$host_os" in
134cygwin* | mingw* | pw32*)
135# FIXME: the MSVC++ port hasn't been tested in a loooong time
136# When not using gcc, we currently assume that we are using
137# Microsoft Visual C++.
138if test "$GCC" != yes; then
139with_gnu_ld=no
140fi
141;;
142interix*)
143# we just hope/assume this is gcc and not c89 (= MSVC++)
144with_gnu_ld=yes
145;;
146openbsd*)
147with_gnu_ld=no
148;;
149esac
150
151ld_shlibs=yes
152if test "$with_gnu_ld" = yes; then
153# Set some defaults for GNU ld with shared library support. These
154# are reset later if shared libraries are not supported. Putting them
155# here allows them to be overridden if necessary.
156# Unlike libtool, we use -rpath here, not --rpath, since the documented
157# option of GNU ld is called -rpath, not --rpath.
158hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
159case "$host_os" in
160aix3* | aix4* | aix5*)
161# On AIX/PPC, the GNU linker is very broken
162if test "$host_cpu" != ia64; then
163ld_shlibs=no
164fi
165;;
166amigaos*)
167hardcode_libdir_flag_spec='-L$libdir'
168hardcode_minus_L=yes
169# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
170# that the semantics of dynamic libraries on AmigaOS, at least up
171# to version 4, is to share data among multiple programs linked
172# with the same dynamic library. Since this doesn't match the
173# behavior of shared libraries on other platforms, we cannot use
174# them.
175ld_shlibs=no
176;;
177beos*)
178if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
179:
180else
181ld_shlibs=no
182fi
183;;
184cygwin* | mingw* | pw32*)
185# hardcode_libdir_flag_spec is actually meaningless, as there is
186# no search path for DLLs.
187hardcode_libdir_flag_spec='-L$libdir'
188if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
189:
190else
191ld_shlibs=no
192fi
193;;
194interix3*)
195hardcode_direct=no
196hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
197;;
198linux*)
199if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
200:
201else
202ld_shlibs=no
203fi
204;;
205netbsd*)
206;;
207solaris*)
208if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
209ld_shlibs=no
210elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
211:
212else
213ld_shlibs=no
214fi
215;;
216sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
217case `$LD -v 2>&1` in
218*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
219ld_shlibs=no
220;;
221*)
222if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
223hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
224else
225ld_shlibs=no
226fi
227;;
228esac
229;;
230sunos4*)
231hardcode_direct=yes
232;;
233*)
234if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
235:
236else
237ld_shlibs=no
238fi
239;;
240esac
241if test "$ld_shlibs" = no; then
242hardcode_libdir_flag_spec=
243fi
244else
245case "$host_os" in
246aix3*)
247# Note: this linker hardcodes the directories in LIBPATH if there
248# are no directories specified by -L.
249hardcode_minus_L=yes
250if test "$GCC" = yes; then
251# Neither direct hardcoding nor static linking is supported with a
252# broken collect2.
253hardcode_direct=unsupported
254fi
255;;
256aix4* | aix5*)
257if test "$host_cpu" = ia64; then
258# On IA64, the linker does run time linking by default, so we don't
259# have to do anything special.
260aix_use_runtimelinking=no
261else
262aix_use_runtimelinking=no
263# Test if we are trying to use run time linking or normal
264# AIX style linking. If -brtl is somewhere in LDFLAGS, we
265# need to do runtime linking.
266case $host_os in aix4.[23]|aix4.[23].*|aix5*)
267for ld_flag in $LDFLAGS; do
268if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
269aix_use_runtimelinking=yes
270break
271fi
272done
273;;
274esac
275fi
276hardcode_direct=yes
277hardcode_libdir_separator=':'
278if test "$GCC" = yes; then
279case $host_os in aix4.[012]|aix4.[012].*)
280collect2name=`${CC} -print-prog-name=collect2`
281if test -f "$collect2name" && \
282strings "$collect2name" | grep resolve_lib_name >/dev/null
283then
284# We have reworked collect2
285hardcode_direct=yes
286else
287# We have old collect2
288hardcode_direct=unsupported
289hardcode_minus_L=yes
290hardcode_libdir_flag_spec='-L$libdir'
291hardcode_libdir_separator=
292fi
293;;
294esac
295fi
296# Begin _LT_AC_SYS_LIBPATH_AIX.
297echo 'int main () { return 0; }' > conftest.c
298${CC} ${LDFLAGS} conftest.c -o conftest
299aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
300}'`
301if test -z "$aix_libpath"; then
302aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
303}'`
304fi
305if test -z "$aix_libpath"; then
306aix_libpath="/usr/lib:/lib"
307fi
308rm -f conftest.c conftest
309# End _LT_AC_SYS_LIBPATH_AIX.
310if test "$aix_use_runtimelinking" = yes; then
311hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
312else
313if test "$host_cpu" = ia64; then
314hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
315else
316hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
317fi
318fi
319;;
320amigaos*)
321hardcode_libdir_flag_spec='-L$libdir'
322hardcode_minus_L=yes
323# see comment about different semantics on the GNU ld section
324ld_shlibs=no
325;;
326bsdi[45]*)
327;;
328cygwin* | mingw* | pw32*)
329# When not using gcc, we currently assume that we are using
330# Microsoft Visual C++.
331# hardcode_libdir_flag_spec is actually meaningless, as there is
332# no search path for DLLs.
333hardcode_libdir_flag_spec=' '
334libext=lib
335;;
336darwin* | rhapsody*)
337hardcode_direct=no
338if test "$GCC" = yes ; then
339:
340else
341case $cc_basename in
342xlc*)
343;;
344*)
345ld_shlibs=no
346;;
347esac
348fi
349;;
350dgux*)
351hardcode_libdir_flag_spec='-L$libdir'
352;;
353freebsd1*)
354ld_shlibs=no
355;;
356freebsd2.2*)
357hardcode_libdir_flag_spec='-R$libdir'
358hardcode_direct=yes
359;;
360freebsd2*)
361hardcode_direct=yes
362hardcode_minus_L=yes
363;;
364freebsd* | kfreebsd*-gnu | dragonfly*)
365hardcode_libdir_flag_spec='-R$libdir'
366hardcode_direct=yes
367;;
368hpux9*)
369hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
370hardcode_libdir_separator=:
371hardcode_direct=yes
372# hardcode_minus_L: Not really in the search PATH,
373# but as the default location of the library.
374hardcode_minus_L=yes
375;;
376hpux10*)
377if test "$with_gnu_ld" = no; then
378hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
379hardcode_libdir_separator=:
380hardcode_direct=yes
381# hardcode_minus_L: Not really in the search PATH,
382# but as the default location of the library.
383hardcode_minus_L=yes
384fi
385;;
386hpux11*)
387if test "$with_gnu_ld" = no; then
388hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
389hardcode_libdir_separator=:
390case $host_cpu in
391hppa*64*|ia64*)
392hardcode_direct=no
393;;
394*)
395hardcode_direct=yes
396# hardcode_minus_L: Not really in the search PATH,
397# but as the default location of the library.
398hardcode_minus_L=yes
399;;
400esac
401fi
402;;
403irix5* | irix6* | nonstopux*)
404hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
405hardcode_libdir_separator=:
406;;
407netbsd*)
408hardcode_libdir_flag_spec='-R$libdir'
409hardcode_direct=yes
410;;
411newsos6)
412hardcode_direct=yes
413hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
414hardcode_libdir_separator=:
415;;
416openbsd*)
417hardcode_direct=yes
418if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
419hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
420else
421case "$host_os" in
422openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
423hardcode_libdir_flag_spec='-R$libdir'
424;;
425*)
426hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
427;;
428esac
429fi
430;;
431os2*)
432hardcode_libdir_flag_spec='-L$libdir'
433hardcode_minus_L=yes
434;;
435osf3*)
436hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
437hardcode_libdir_separator=:
438;;
439osf4* | osf5*)
440if test "$GCC" = yes; then
441hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
442else
443# Both cc and cxx compiler support -rpath directly
444hardcode_libdir_flag_spec='-rpath $libdir'
445fi
446hardcode_libdir_separator=:
447;;
448solaris*)
449hardcode_libdir_flag_spec='-R$libdir'
450;;
451sunos4*)
452hardcode_libdir_flag_spec='-L$libdir'
453hardcode_direct=yes
454hardcode_minus_L=yes
455;;
456sysv4)
457case $host_vendor in
458sni)
459hardcode_direct=yes # is this really true???
460;;
461siemens)
462hardcode_direct=no
463;;
464motorola)
465hardcode_direct=no #Motorola manual says yes, but my tests say they lie
466;;
467esac
468;;
469sysv4.3*)
470;;
471sysv4*MP*)
472if test -d /usr/nec; then
473ld_shlibs=yes
474fi
475;;
476sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
477;;
478sysv5* | sco3.2v5* | sco5v6*)
479hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
480hardcode_libdir_separator=':'
481;;
482uts4*)
483hardcode_libdir_flag_spec='-L$libdir'
484;;
485*)
486ld_shlibs=no
487;;
488esac
489fi
490
491# Check dynamic linker characteristics
492# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
493# Unlike libtool.m4, here we don't care about _all_ names of the library, but
494# only about the one the linker finds when passed -lNAME. This is the last
495# element of library_names_spec in libtool.m4, or possibly two of them if the
496# linker has special search rules.
497library_names_spec= # the last element of library_names_spec in libtool.m4
498libname_spec='lib$name'
499case "$host_os" in
500aix3*)
501library_names_spec='$libname.a'
502;;
503aix4* | aix5*)
504library_names_spec='$libname$shrext'
505;;
506amigaos*)
507library_names_spec='$libname.a'
508;;
509beos*)
510library_names_spec='$libname$shrext'
511;;
512bsdi[45]*)
513library_names_spec='$libname$shrext'
514;;
515cygwin* | mingw* | pw32*)
516shrext=.dll
517library_names_spec='$libname.dll.a $libname.lib'
518;;
519darwin* | rhapsody*)
520shrext=.dylib
521library_names_spec='$libname$shrext'
522;;
523dgux*)
524library_names_spec='$libname$shrext'
525;;
526freebsd1*)
527;;
528kfreebsd*-gnu)
529library_names_spec='$libname$shrext'
530;;
531freebsd* | dragonfly*)
532case "$host_os" in
533freebsd[123]*)
534library_names_spec='$libname$shrext$versuffix' ;;
535*)
536library_names_spec='$libname$shrext' ;;
537esac
538;;
539gnu*)
540library_names_spec='$libname$shrext'
541;;
542hpux9* | hpux10* | hpux11*)
543case $host_cpu in
544ia64*)
545shrext=.so
546;;
547hppa*64*)
548shrext=.sl
549;;
550*)
551shrext=.sl
552;;
553esac
554library_names_spec='$libname$shrext'
555;;
556interix3*)
557library_names_spec='$libname$shrext'
558;;
559irix5* | irix6* | nonstopux*)
560library_names_spec='$libname$shrext'
561case "$host_os" in
562irix5* | nonstopux*)
563libsuff= shlibsuff=
564;;
565*)
566case $LD in
567*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
568*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
569*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
570*) libsuff= shlibsuff= ;;
571esac
572;;
573esac
574;;
575linux*oldld* | linux*aout* | linux*coff*)
576;;
577linux*)
578library_names_spec='$libname$shrext'
579;;
580knetbsd*-gnu)
581library_names_spec='$libname$shrext'
582;;
583netbsd*)
584library_names_spec='$libname$shrext'
585;;
586newsos6)
587library_names_spec='$libname$shrext'
588;;
589nto-qnx*)
590library_names_spec='$libname$shrext'
591;;
592openbsd*)
593library_names_spec='$libname$shrext$versuffix'
594;;
595os2*)
596libname_spec='$name'
597shrext=.dll
598library_names_spec='$libname.a'
599;;
600osf3* | osf4* | osf5*)
601library_names_spec='$libname$shrext'
602;;
603solaris*)
604library_names_spec='$libname$shrext'
605;;
606sunos4*)
607library_names_spec='$libname$shrext$versuffix'
608;;
609sysv4 | sysv4.3*)
610library_names_spec='$libname$shrext'
611;;
612sysv4*MP*)
613library_names_spec='$libname$shrext'
614;;
615sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
616library_names_spec='$libname$shrext'
617;;
618uts4*)
619library_names_spec='$libname$shrext'
620;;
621esac
622
623sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
624escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
625shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
626escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
627escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
628escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
629
630LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
631
632# How to pass a linker flag through the compiler.
633wl="$escaped_wl"
634
635# Static library suffix (normally "a").
636libext="$libext"
637
638# Shared library suffix (normally "so").
639shlibext="$shlibext"
640
641# Format of library name prefix.
642libname_spec="$escaped_libname_spec"
643
644# Library names that the linker finds when passed -lNAME.
645library_names_spec="$escaped_library_names_spec"
646
647# Flag to hardcode \$libdir into a binary during linking.
648# This must work even if \$libdir does not exist.
649hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
650
651# Whether we need a single -rpath flag with a separated argument.
652hardcode_libdir_separator="$hardcode_libdir_separator"
653
654# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
655# resulting binary.
656hardcode_direct="$hardcode_direct"
657
658# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
659# resulting binary.
660hardcode_minus_L="$hardcode_minus_L"
661
662EOF
663