1159b3361Sopenharmony_ci#! /bin/sh
2159b3361Sopenharmony_ci# Output a system dependent set of variables, describing how to set the
3159b3361Sopenharmony_ci# run time search path of shared libraries in an executable.
4159b3361Sopenharmony_ci#
5159b3361Sopenharmony_ci#   Copyright 1996-2010 Free Software Foundation, Inc.
6159b3361Sopenharmony_ci#   Taken from GNU libtool, 2001
7159b3361Sopenharmony_ci#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8159b3361Sopenharmony_ci#
9159b3361Sopenharmony_ci#   This file is free software; the Free Software Foundation gives
10159b3361Sopenharmony_ci#   unlimited permission to copy and/or distribute it, with or without
11159b3361Sopenharmony_ci#   modifications, as long as this notice is preserved.
12159b3361Sopenharmony_ci#
13159b3361Sopenharmony_ci# The first argument passed to this file is the canonical host specification,
14159b3361Sopenharmony_ci#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
15159b3361Sopenharmony_ci# or
16159b3361Sopenharmony_ci#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
17159b3361Sopenharmony_ci# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
18159b3361Sopenharmony_ci# should be set by the caller.
19159b3361Sopenharmony_ci#
20159b3361Sopenharmony_ci# The set of defined variables is at the end of this script.
21159b3361Sopenharmony_ci
22159b3361Sopenharmony_ci# Known limitations:
23159b3361Sopenharmony_ci# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
24159b3361Sopenharmony_ci#   than 256 bytes, otherwise the compiler driver will dump core. The only
25159b3361Sopenharmony_ci#   known workaround is to choose shorter directory names for the build
26159b3361Sopenharmony_ci#   directory and/or the installation directory.
27159b3361Sopenharmony_ci
28159b3361Sopenharmony_ci# All known linkers require a `.a' archive for static linking (except MSVC,
29159b3361Sopenharmony_ci# which needs '.lib').
30159b3361Sopenharmony_cilibext=a
31159b3361Sopenharmony_cishrext=.so
32159b3361Sopenharmony_ci
33159b3361Sopenharmony_cihost="$1"
34159b3361Sopenharmony_cihost_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
35159b3361Sopenharmony_cihost_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
36159b3361Sopenharmony_cihost_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
37159b3361Sopenharmony_ci
38159b3361Sopenharmony_ci# Code taken from libtool.m4's _LT_CC_BASENAME.
39159b3361Sopenharmony_ci
40159b3361Sopenharmony_cifor cc_temp in $CC""; do
41159b3361Sopenharmony_ci  case $cc_temp in
42159b3361Sopenharmony_ci    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
43159b3361Sopenharmony_ci    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
44159b3361Sopenharmony_ci    \-*) ;;
45159b3361Sopenharmony_ci    *) break;;
46159b3361Sopenharmony_ci  esac
47159b3361Sopenharmony_cidone
48159b3361Sopenharmony_cicc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
49159b3361Sopenharmony_ci
50159b3361Sopenharmony_ci# Code taken from libtool.m4's _LT_COMPILER_PIC.
51159b3361Sopenharmony_ci
52159b3361Sopenharmony_ciwl=
53159b3361Sopenharmony_ciif test "$GCC" = yes; then
54159b3361Sopenharmony_ci  wl='-Wl,'
55159b3361Sopenharmony_cielse
56159b3361Sopenharmony_ci  case "$host_os" in
57159b3361Sopenharmony_ci    aix*)
58159b3361Sopenharmony_ci      wl='-Wl,'
59159b3361Sopenharmony_ci      ;;
60159b3361Sopenharmony_ci    darwin*)
61159b3361Sopenharmony_ci      case $cc_basename in
62159b3361Sopenharmony_ci        xlc*)
63159b3361Sopenharmony_ci          wl='-Wl,'
64159b3361Sopenharmony_ci          ;;
65159b3361Sopenharmony_ci      esac
66159b3361Sopenharmony_ci      ;;
67159b3361Sopenharmony_ci    mingw* | cygwin* | pw32* | os2* | cegcc*)
68159b3361Sopenharmony_ci      ;;
69159b3361Sopenharmony_ci    hpux9* | hpux10* | hpux11*)
70159b3361Sopenharmony_ci      wl='-Wl,'
71159b3361Sopenharmony_ci      ;;
72159b3361Sopenharmony_ci    irix5* | irix6* | nonstopux*)
73159b3361Sopenharmony_ci      wl='-Wl,'
74159b3361Sopenharmony_ci      ;;
75159b3361Sopenharmony_ci    newsos6)
76159b3361Sopenharmony_ci      ;;
77159b3361Sopenharmony_ci    linux* | k*bsd*-gnu)
78159b3361Sopenharmony_ci      case $cc_basename in
79159b3361Sopenharmony_ci        ecc*)
80159b3361Sopenharmony_ci          wl='-Wl,'
81159b3361Sopenharmony_ci          ;;
82159b3361Sopenharmony_ci        icc* | ifort*)
83159b3361Sopenharmony_ci          wl='-Wl,'
84159b3361Sopenharmony_ci          ;;
85159b3361Sopenharmony_ci        lf95*)
86159b3361Sopenharmony_ci          wl='-Wl,'
87159b3361Sopenharmony_ci          ;;
88159b3361Sopenharmony_ci        pgcc | pgf77 | pgf90)
89159b3361Sopenharmony_ci          wl='-Wl,'
90159b3361Sopenharmony_ci          ;;
91159b3361Sopenharmony_ci        ccc*)
92159b3361Sopenharmony_ci          wl='-Wl,'
93159b3361Sopenharmony_ci          ;;
94159b3361Sopenharmony_ci        como)
95159b3361Sopenharmony_ci          wl='-lopt='
96159b3361Sopenharmony_ci          ;;
97159b3361Sopenharmony_ci        *)
98159b3361Sopenharmony_ci          case `$CC -V 2>&1 | sed 5q` in
99159b3361Sopenharmony_ci            *Sun\ C*)
100159b3361Sopenharmony_ci              wl='-Wl,'
101159b3361Sopenharmony_ci              ;;
102159b3361Sopenharmony_ci          esac
103159b3361Sopenharmony_ci          ;;
104159b3361Sopenharmony_ci      esac
105159b3361Sopenharmony_ci      ;;
106159b3361Sopenharmony_ci    osf3* | osf4* | osf5*)
107159b3361Sopenharmony_ci      wl='-Wl,'
108159b3361Sopenharmony_ci      ;;
109159b3361Sopenharmony_ci    rdos*)
110159b3361Sopenharmony_ci      ;;
111159b3361Sopenharmony_ci    solaris*)
112159b3361Sopenharmony_ci      wl='-Wl,'
113159b3361Sopenharmony_ci      ;;
114159b3361Sopenharmony_ci    sunos4*)
115159b3361Sopenharmony_ci      wl='-Qoption ld '
116159b3361Sopenharmony_ci      ;;
117159b3361Sopenharmony_ci    sysv4 | sysv4.2uw2* | sysv4.3*)
118159b3361Sopenharmony_ci      wl='-Wl,'
119159b3361Sopenharmony_ci      ;;
120159b3361Sopenharmony_ci    sysv4*MP*)
121159b3361Sopenharmony_ci      ;;
122159b3361Sopenharmony_ci    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
123159b3361Sopenharmony_ci      wl='-Wl,'
124159b3361Sopenharmony_ci      ;;
125159b3361Sopenharmony_ci    unicos*)
126159b3361Sopenharmony_ci      wl='-Wl,'
127159b3361Sopenharmony_ci      ;;
128159b3361Sopenharmony_ci    uts4*)
129159b3361Sopenharmony_ci      ;;
130159b3361Sopenharmony_ci  esac
131159b3361Sopenharmony_cifi
132159b3361Sopenharmony_ci
133159b3361Sopenharmony_ci# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
134159b3361Sopenharmony_ci
135159b3361Sopenharmony_cihardcode_libdir_flag_spec=
136159b3361Sopenharmony_cihardcode_libdir_separator=
137159b3361Sopenharmony_cihardcode_direct=no
138159b3361Sopenharmony_cihardcode_minus_L=no
139159b3361Sopenharmony_ci
140159b3361Sopenharmony_cicase "$host_os" in
141159b3361Sopenharmony_ci  cygwin* | mingw* | pw32* | cegcc*)
142159b3361Sopenharmony_ci    # FIXME: the MSVC++ port hasn't been tested in a loooong time
143159b3361Sopenharmony_ci    # When not using gcc, we currently assume that we are using
144159b3361Sopenharmony_ci    # Microsoft Visual C++.
145159b3361Sopenharmony_ci    if test "$GCC" != yes; then
146159b3361Sopenharmony_ci      with_gnu_ld=no
147159b3361Sopenharmony_ci    fi
148159b3361Sopenharmony_ci    ;;
149159b3361Sopenharmony_ci  interix*)
150159b3361Sopenharmony_ci    # we just hope/assume this is gcc and not c89 (= MSVC++)
151159b3361Sopenharmony_ci    with_gnu_ld=yes
152159b3361Sopenharmony_ci    ;;
153159b3361Sopenharmony_ci  openbsd*)
154159b3361Sopenharmony_ci    with_gnu_ld=no
155159b3361Sopenharmony_ci    ;;
156159b3361Sopenharmony_ciesac
157159b3361Sopenharmony_ci
158159b3361Sopenharmony_cild_shlibs=yes
159159b3361Sopenharmony_ciif test "$with_gnu_ld" = yes; then
160159b3361Sopenharmony_ci  # Set some defaults for GNU ld with shared library support. These
161159b3361Sopenharmony_ci  # are reset later if shared libraries are not supported. Putting them
162159b3361Sopenharmony_ci  # here allows them to be overridden if necessary.
163159b3361Sopenharmony_ci  # Unlike libtool, we use -rpath here, not --rpath, since the documented
164159b3361Sopenharmony_ci  # option of GNU ld is called -rpath, not --rpath.
165159b3361Sopenharmony_ci  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
166159b3361Sopenharmony_ci  case "$host_os" in
167159b3361Sopenharmony_ci    aix[3-9]*)
168159b3361Sopenharmony_ci      # On AIX/PPC, the GNU linker is very broken
169159b3361Sopenharmony_ci      if test "$host_cpu" != ia64; then
170159b3361Sopenharmony_ci        ld_shlibs=no
171159b3361Sopenharmony_ci      fi
172159b3361Sopenharmony_ci      ;;
173159b3361Sopenharmony_ci    amigaos*)
174159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-L$libdir'
175159b3361Sopenharmony_ci      hardcode_minus_L=yes
176159b3361Sopenharmony_ci      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
177159b3361Sopenharmony_ci      # that the semantics of dynamic libraries on AmigaOS, at least up
178159b3361Sopenharmony_ci      # to version 4, is to share data among multiple programs linked
179159b3361Sopenharmony_ci      # with the same dynamic library.  Since this doesn't match the
180159b3361Sopenharmony_ci      # behavior of shared libraries on other platforms, we cannot use
181159b3361Sopenharmony_ci      # them.
182159b3361Sopenharmony_ci      ld_shlibs=no
183159b3361Sopenharmony_ci      ;;
184159b3361Sopenharmony_ci    beos*)
185159b3361Sopenharmony_ci      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
186159b3361Sopenharmony_ci        :
187159b3361Sopenharmony_ci      else
188159b3361Sopenharmony_ci        ld_shlibs=no
189159b3361Sopenharmony_ci      fi
190159b3361Sopenharmony_ci      ;;
191159b3361Sopenharmony_ci    cygwin* | mingw* | pw32* | cegcc*)
192159b3361Sopenharmony_ci      # hardcode_libdir_flag_spec is actually meaningless, as there is
193159b3361Sopenharmony_ci      # no search path for DLLs.
194159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-L$libdir'
195159b3361Sopenharmony_ci      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
196159b3361Sopenharmony_ci        :
197159b3361Sopenharmony_ci      else
198159b3361Sopenharmony_ci        ld_shlibs=no
199159b3361Sopenharmony_ci      fi
200159b3361Sopenharmony_ci      ;;
201159b3361Sopenharmony_ci    interix[3-9]*)
202159b3361Sopenharmony_ci      hardcode_direct=no
203159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
204159b3361Sopenharmony_ci      ;;
205159b3361Sopenharmony_ci    gnu* | linux* | k*bsd*-gnu)
206159b3361Sopenharmony_ci      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
207159b3361Sopenharmony_ci        :
208159b3361Sopenharmony_ci      else
209159b3361Sopenharmony_ci        ld_shlibs=no
210159b3361Sopenharmony_ci      fi
211159b3361Sopenharmony_ci      ;;
212159b3361Sopenharmony_ci    netbsd*)
213159b3361Sopenharmony_ci      ;;
214159b3361Sopenharmony_ci    solaris*)
215159b3361Sopenharmony_ci      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
216159b3361Sopenharmony_ci        ld_shlibs=no
217159b3361Sopenharmony_ci      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
218159b3361Sopenharmony_ci        :
219159b3361Sopenharmony_ci      else
220159b3361Sopenharmony_ci        ld_shlibs=no
221159b3361Sopenharmony_ci      fi
222159b3361Sopenharmony_ci      ;;
223159b3361Sopenharmony_ci    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
224159b3361Sopenharmony_ci      case `$LD -v 2>&1` in
225159b3361Sopenharmony_ci        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
226159b3361Sopenharmony_ci          ld_shlibs=no
227159b3361Sopenharmony_ci          ;;
228159b3361Sopenharmony_ci        *)
229159b3361Sopenharmony_ci          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
230159b3361Sopenharmony_ci            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
231159b3361Sopenharmony_ci          else
232159b3361Sopenharmony_ci            ld_shlibs=no
233159b3361Sopenharmony_ci          fi
234159b3361Sopenharmony_ci          ;;
235159b3361Sopenharmony_ci      esac
236159b3361Sopenharmony_ci      ;;
237159b3361Sopenharmony_ci    sunos4*)
238159b3361Sopenharmony_ci      hardcode_direct=yes
239159b3361Sopenharmony_ci      ;;
240159b3361Sopenharmony_ci    *)
241159b3361Sopenharmony_ci      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
242159b3361Sopenharmony_ci        :
243159b3361Sopenharmony_ci      else
244159b3361Sopenharmony_ci        ld_shlibs=no
245159b3361Sopenharmony_ci      fi
246159b3361Sopenharmony_ci      ;;
247159b3361Sopenharmony_ci  esac
248159b3361Sopenharmony_ci  if test "$ld_shlibs" = no; then
249159b3361Sopenharmony_ci    hardcode_libdir_flag_spec=
250159b3361Sopenharmony_ci  fi
251159b3361Sopenharmony_cielse
252159b3361Sopenharmony_ci  case "$host_os" in
253159b3361Sopenharmony_ci    aix3*)
254159b3361Sopenharmony_ci      # Note: this linker hardcodes the directories in LIBPATH if there
255159b3361Sopenharmony_ci      # are no directories specified by -L.
256159b3361Sopenharmony_ci      hardcode_minus_L=yes
257159b3361Sopenharmony_ci      if test "$GCC" = yes; then
258159b3361Sopenharmony_ci        # Neither direct hardcoding nor static linking is supported with a
259159b3361Sopenharmony_ci        # broken collect2.
260159b3361Sopenharmony_ci        hardcode_direct=unsupported
261159b3361Sopenharmony_ci      fi
262159b3361Sopenharmony_ci      ;;
263159b3361Sopenharmony_ci    aix[4-9]*)
264159b3361Sopenharmony_ci      if test "$host_cpu" = ia64; then
265159b3361Sopenharmony_ci        # On IA64, the linker does run time linking by default, so we don't
266159b3361Sopenharmony_ci        # have to do anything special.
267159b3361Sopenharmony_ci        aix_use_runtimelinking=no
268159b3361Sopenharmony_ci      else
269159b3361Sopenharmony_ci        aix_use_runtimelinking=no
270159b3361Sopenharmony_ci        # Test if we are trying to use run time linking or normal
271159b3361Sopenharmony_ci        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
272159b3361Sopenharmony_ci        # need to do runtime linking.
273159b3361Sopenharmony_ci        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
274159b3361Sopenharmony_ci          for ld_flag in $LDFLAGS; do
275159b3361Sopenharmony_ci            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
276159b3361Sopenharmony_ci              aix_use_runtimelinking=yes
277159b3361Sopenharmony_ci              break
278159b3361Sopenharmony_ci            fi
279159b3361Sopenharmony_ci          done
280159b3361Sopenharmony_ci          ;;
281159b3361Sopenharmony_ci        esac
282159b3361Sopenharmony_ci      fi
283159b3361Sopenharmony_ci      hardcode_direct=yes
284159b3361Sopenharmony_ci      hardcode_libdir_separator=':'
285159b3361Sopenharmony_ci      if test "$GCC" = yes; then
286159b3361Sopenharmony_ci        case $host_os in aix4.[012]|aix4.[012].*)
287159b3361Sopenharmony_ci          collect2name=`${CC} -print-prog-name=collect2`
288159b3361Sopenharmony_ci          if test -f "$collect2name" && \
289159b3361Sopenharmony_ci            strings "$collect2name" | grep resolve_lib_name >/dev/null
290159b3361Sopenharmony_ci          then
291159b3361Sopenharmony_ci            # We have reworked collect2
292159b3361Sopenharmony_ci            :
293159b3361Sopenharmony_ci          else
294159b3361Sopenharmony_ci            # We have old collect2
295159b3361Sopenharmony_ci            hardcode_direct=unsupported
296159b3361Sopenharmony_ci            hardcode_minus_L=yes
297159b3361Sopenharmony_ci            hardcode_libdir_flag_spec='-L$libdir'
298159b3361Sopenharmony_ci            hardcode_libdir_separator=
299159b3361Sopenharmony_ci          fi
300159b3361Sopenharmony_ci          ;;
301159b3361Sopenharmony_ci        esac
302159b3361Sopenharmony_ci      fi
303159b3361Sopenharmony_ci      # Begin _LT_AC_SYS_LIBPATH_AIX.
304159b3361Sopenharmony_ci      echo 'int main () { return 0; }' > conftest.c
305159b3361Sopenharmony_ci      ${CC} ${LDFLAGS} conftest.c -o conftest
306159b3361Sopenharmony_ci      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
307159b3361Sopenharmony_ci}'`
308159b3361Sopenharmony_ci      if test -z "$aix_libpath"; then
309159b3361Sopenharmony_ci        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
310159b3361Sopenharmony_ci}'`
311159b3361Sopenharmony_ci      fi
312159b3361Sopenharmony_ci      if test -z "$aix_libpath"; then
313159b3361Sopenharmony_ci        aix_libpath="/usr/lib:/lib"
314159b3361Sopenharmony_ci      fi
315159b3361Sopenharmony_ci      rm -f conftest.c conftest
316159b3361Sopenharmony_ci      # End _LT_AC_SYS_LIBPATH_AIX.
317159b3361Sopenharmony_ci      if test "$aix_use_runtimelinking" = yes; then
318159b3361Sopenharmony_ci        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
319159b3361Sopenharmony_ci      else
320159b3361Sopenharmony_ci        if test "$host_cpu" = ia64; then
321159b3361Sopenharmony_ci          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
322159b3361Sopenharmony_ci        else
323159b3361Sopenharmony_ci          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
324159b3361Sopenharmony_ci        fi
325159b3361Sopenharmony_ci      fi
326159b3361Sopenharmony_ci      ;;
327159b3361Sopenharmony_ci    amigaos*)
328159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-L$libdir'
329159b3361Sopenharmony_ci      hardcode_minus_L=yes
330159b3361Sopenharmony_ci      # see comment about different semantics on the GNU ld section
331159b3361Sopenharmony_ci      ld_shlibs=no
332159b3361Sopenharmony_ci      ;;
333159b3361Sopenharmony_ci    bsdi[45]*)
334159b3361Sopenharmony_ci      ;;
335159b3361Sopenharmony_ci    cygwin* | mingw* | pw32* | cegcc*)
336159b3361Sopenharmony_ci      # When not using gcc, we currently assume that we are using
337159b3361Sopenharmony_ci      # Microsoft Visual C++.
338159b3361Sopenharmony_ci      # hardcode_libdir_flag_spec is actually meaningless, as there is
339159b3361Sopenharmony_ci      # no search path for DLLs.
340159b3361Sopenharmony_ci      hardcode_libdir_flag_spec=' '
341159b3361Sopenharmony_ci      libext=lib
342159b3361Sopenharmony_ci      ;;
343159b3361Sopenharmony_ci    darwin* | rhapsody*)
344159b3361Sopenharmony_ci      hardcode_direct=no
345159b3361Sopenharmony_ci      if test "$GCC" = yes ; then
346159b3361Sopenharmony_ci        :
347159b3361Sopenharmony_ci      else
348159b3361Sopenharmony_ci        case $cc_basename in
349159b3361Sopenharmony_ci          xlc*)
350159b3361Sopenharmony_ci            ;;
351159b3361Sopenharmony_ci          *)
352159b3361Sopenharmony_ci            ld_shlibs=no
353159b3361Sopenharmony_ci            ;;
354159b3361Sopenharmony_ci        esac
355159b3361Sopenharmony_ci      fi
356159b3361Sopenharmony_ci      ;;
357159b3361Sopenharmony_ci    dgux*)
358159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-L$libdir'
359159b3361Sopenharmony_ci      ;;
360159b3361Sopenharmony_ci    freebsd1*)
361159b3361Sopenharmony_ci      ld_shlibs=no
362159b3361Sopenharmony_ci      ;;
363159b3361Sopenharmony_ci    freebsd2.2*)
364159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-R$libdir'
365159b3361Sopenharmony_ci      hardcode_direct=yes
366159b3361Sopenharmony_ci      ;;
367159b3361Sopenharmony_ci    freebsd2*)
368159b3361Sopenharmony_ci      hardcode_direct=yes
369159b3361Sopenharmony_ci      hardcode_minus_L=yes
370159b3361Sopenharmony_ci      ;;
371159b3361Sopenharmony_ci    freebsd* | dragonfly*)
372159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-R$libdir'
373159b3361Sopenharmony_ci      hardcode_direct=yes
374159b3361Sopenharmony_ci      ;;
375159b3361Sopenharmony_ci    hpux9*)
376159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
377159b3361Sopenharmony_ci      hardcode_libdir_separator=:
378159b3361Sopenharmony_ci      hardcode_direct=yes
379159b3361Sopenharmony_ci      # hardcode_minus_L: Not really in the search PATH,
380159b3361Sopenharmony_ci      # but as the default location of the library.
381159b3361Sopenharmony_ci      hardcode_minus_L=yes
382159b3361Sopenharmony_ci      ;;
383159b3361Sopenharmony_ci    hpux10*)
384159b3361Sopenharmony_ci      if test "$with_gnu_ld" = no; then
385159b3361Sopenharmony_ci        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
386159b3361Sopenharmony_ci        hardcode_libdir_separator=:
387159b3361Sopenharmony_ci        hardcode_direct=yes
388159b3361Sopenharmony_ci        # hardcode_minus_L: Not really in the search PATH,
389159b3361Sopenharmony_ci        # but as the default location of the library.
390159b3361Sopenharmony_ci        hardcode_minus_L=yes
391159b3361Sopenharmony_ci      fi
392159b3361Sopenharmony_ci      ;;
393159b3361Sopenharmony_ci    hpux11*)
394159b3361Sopenharmony_ci      if test "$with_gnu_ld" = no; then
395159b3361Sopenharmony_ci        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
396159b3361Sopenharmony_ci        hardcode_libdir_separator=:
397159b3361Sopenharmony_ci        case $host_cpu in
398159b3361Sopenharmony_ci          hppa*64*|ia64*)
399159b3361Sopenharmony_ci            hardcode_direct=no
400159b3361Sopenharmony_ci            ;;
401159b3361Sopenharmony_ci          *)
402159b3361Sopenharmony_ci            hardcode_direct=yes
403159b3361Sopenharmony_ci            # hardcode_minus_L: Not really in the search PATH,
404159b3361Sopenharmony_ci            # but as the default location of the library.
405159b3361Sopenharmony_ci            hardcode_minus_L=yes
406159b3361Sopenharmony_ci            ;;
407159b3361Sopenharmony_ci        esac
408159b3361Sopenharmony_ci      fi
409159b3361Sopenharmony_ci      ;;
410159b3361Sopenharmony_ci    irix5* | irix6* | nonstopux*)
411159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
412159b3361Sopenharmony_ci      hardcode_libdir_separator=:
413159b3361Sopenharmony_ci      ;;
414159b3361Sopenharmony_ci    netbsd*)
415159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-R$libdir'
416159b3361Sopenharmony_ci      hardcode_direct=yes
417159b3361Sopenharmony_ci      ;;
418159b3361Sopenharmony_ci    newsos6)
419159b3361Sopenharmony_ci      hardcode_direct=yes
420159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
421159b3361Sopenharmony_ci      hardcode_libdir_separator=:
422159b3361Sopenharmony_ci      ;;
423159b3361Sopenharmony_ci    openbsd*)
424159b3361Sopenharmony_ci      if test -f /usr/libexec/ld.so; then
425159b3361Sopenharmony_ci        hardcode_direct=yes
426159b3361Sopenharmony_ci        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
427159b3361Sopenharmony_ci          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
428159b3361Sopenharmony_ci        else
429159b3361Sopenharmony_ci          case "$host_os" in
430159b3361Sopenharmony_ci            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
431159b3361Sopenharmony_ci              hardcode_libdir_flag_spec='-R$libdir'
432159b3361Sopenharmony_ci              ;;
433159b3361Sopenharmony_ci            *)
434159b3361Sopenharmony_ci              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
435159b3361Sopenharmony_ci              ;;
436159b3361Sopenharmony_ci          esac
437159b3361Sopenharmony_ci        fi
438159b3361Sopenharmony_ci      else
439159b3361Sopenharmony_ci        ld_shlibs=no
440159b3361Sopenharmony_ci      fi
441159b3361Sopenharmony_ci      ;;
442159b3361Sopenharmony_ci    os2*)
443159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-L$libdir'
444159b3361Sopenharmony_ci      hardcode_minus_L=yes
445159b3361Sopenharmony_ci      ;;
446159b3361Sopenharmony_ci    osf3*)
447159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
448159b3361Sopenharmony_ci      hardcode_libdir_separator=:
449159b3361Sopenharmony_ci      ;;
450159b3361Sopenharmony_ci    osf4* | osf5*)
451159b3361Sopenharmony_ci      if test "$GCC" = yes; then
452159b3361Sopenharmony_ci        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
453159b3361Sopenharmony_ci      else
454159b3361Sopenharmony_ci        # Both cc and cxx compiler support -rpath directly
455159b3361Sopenharmony_ci        hardcode_libdir_flag_spec='-rpath $libdir'
456159b3361Sopenharmony_ci      fi
457159b3361Sopenharmony_ci      hardcode_libdir_separator=:
458159b3361Sopenharmony_ci      ;;
459159b3361Sopenharmony_ci    solaris*)
460159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-R$libdir'
461159b3361Sopenharmony_ci      ;;
462159b3361Sopenharmony_ci    sunos4*)
463159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-L$libdir'
464159b3361Sopenharmony_ci      hardcode_direct=yes
465159b3361Sopenharmony_ci      hardcode_minus_L=yes
466159b3361Sopenharmony_ci      ;;
467159b3361Sopenharmony_ci    sysv4)
468159b3361Sopenharmony_ci      case $host_vendor in
469159b3361Sopenharmony_ci        sni)
470159b3361Sopenharmony_ci          hardcode_direct=yes # is this really true???
471159b3361Sopenharmony_ci          ;;
472159b3361Sopenharmony_ci        siemens)
473159b3361Sopenharmony_ci          hardcode_direct=no
474159b3361Sopenharmony_ci          ;;
475159b3361Sopenharmony_ci        motorola)
476159b3361Sopenharmony_ci          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
477159b3361Sopenharmony_ci          ;;
478159b3361Sopenharmony_ci      esac
479159b3361Sopenharmony_ci      ;;
480159b3361Sopenharmony_ci    sysv4.3*)
481159b3361Sopenharmony_ci      ;;
482159b3361Sopenharmony_ci    sysv4*MP*)
483159b3361Sopenharmony_ci      if test -d /usr/nec; then
484159b3361Sopenharmony_ci        ld_shlibs=yes
485159b3361Sopenharmony_ci      fi
486159b3361Sopenharmony_ci      ;;
487159b3361Sopenharmony_ci    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
488159b3361Sopenharmony_ci      ;;
489159b3361Sopenharmony_ci    sysv5* | sco3.2v5* | sco5v6*)
490159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
491159b3361Sopenharmony_ci      hardcode_libdir_separator=':'
492159b3361Sopenharmony_ci      ;;
493159b3361Sopenharmony_ci    uts4*)
494159b3361Sopenharmony_ci      hardcode_libdir_flag_spec='-L$libdir'
495159b3361Sopenharmony_ci      ;;
496159b3361Sopenharmony_ci    *)
497159b3361Sopenharmony_ci      ld_shlibs=no
498159b3361Sopenharmony_ci      ;;
499159b3361Sopenharmony_ci  esac
500159b3361Sopenharmony_cifi
501159b3361Sopenharmony_ci
502159b3361Sopenharmony_ci# Check dynamic linker characteristics
503159b3361Sopenharmony_ci# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
504159b3361Sopenharmony_ci# Unlike libtool.m4, here we don't care about _all_ names of the library, but
505159b3361Sopenharmony_ci# only about the one the linker finds when passed -lNAME. This is the last
506159b3361Sopenharmony_ci# element of library_names_spec in libtool.m4, or possibly two of them if the
507159b3361Sopenharmony_ci# linker has special search rules.
508159b3361Sopenharmony_cilibrary_names_spec=      # the last element of library_names_spec in libtool.m4
509159b3361Sopenharmony_cilibname_spec='lib$name'
510159b3361Sopenharmony_cicase "$host_os" in
511159b3361Sopenharmony_ci  aix3*)
512159b3361Sopenharmony_ci    library_names_spec='$libname.a'
513159b3361Sopenharmony_ci    ;;
514159b3361Sopenharmony_ci  aix[4-9]*)
515159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
516159b3361Sopenharmony_ci    ;;
517159b3361Sopenharmony_ci  amigaos*)
518159b3361Sopenharmony_ci    library_names_spec='$libname.a'
519159b3361Sopenharmony_ci    ;;
520159b3361Sopenharmony_ci  beos*)
521159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
522159b3361Sopenharmony_ci    ;;
523159b3361Sopenharmony_ci  bsdi[45]*)
524159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
525159b3361Sopenharmony_ci    ;;
526159b3361Sopenharmony_ci  cygwin* | mingw* | pw32* | cegcc*)
527159b3361Sopenharmony_ci    shrext=.dll
528159b3361Sopenharmony_ci    library_names_spec='$libname.dll.a $libname.lib'
529159b3361Sopenharmony_ci    ;;
530159b3361Sopenharmony_ci  darwin* | rhapsody*)
531159b3361Sopenharmony_ci    shrext=.dylib
532159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
533159b3361Sopenharmony_ci    ;;
534159b3361Sopenharmony_ci  dgux*)
535159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
536159b3361Sopenharmony_ci    ;;
537159b3361Sopenharmony_ci  freebsd1*)
538159b3361Sopenharmony_ci    ;;
539159b3361Sopenharmony_ci  freebsd* | dragonfly*)
540159b3361Sopenharmony_ci    case "$host_os" in
541159b3361Sopenharmony_ci      freebsd[123]*)
542159b3361Sopenharmony_ci        library_names_spec='$libname$shrext$versuffix' ;;
543159b3361Sopenharmony_ci      *)
544159b3361Sopenharmony_ci        library_names_spec='$libname$shrext' ;;
545159b3361Sopenharmony_ci    esac
546159b3361Sopenharmony_ci    ;;
547159b3361Sopenharmony_ci  gnu*)
548159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
549159b3361Sopenharmony_ci    ;;
550159b3361Sopenharmony_ci  hpux9* | hpux10* | hpux11*)
551159b3361Sopenharmony_ci    case $host_cpu in
552159b3361Sopenharmony_ci      ia64*)
553159b3361Sopenharmony_ci        shrext=.so
554159b3361Sopenharmony_ci        ;;
555159b3361Sopenharmony_ci      hppa*64*)
556159b3361Sopenharmony_ci        shrext=.sl
557159b3361Sopenharmony_ci        ;;
558159b3361Sopenharmony_ci      *)
559159b3361Sopenharmony_ci        shrext=.sl
560159b3361Sopenharmony_ci        ;;
561159b3361Sopenharmony_ci    esac
562159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
563159b3361Sopenharmony_ci    ;;
564159b3361Sopenharmony_ci  interix[3-9]*)
565159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
566159b3361Sopenharmony_ci    ;;
567159b3361Sopenharmony_ci  irix5* | irix6* | nonstopux*)
568159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
569159b3361Sopenharmony_ci    case "$host_os" in
570159b3361Sopenharmony_ci      irix5* | nonstopux*)
571159b3361Sopenharmony_ci        libsuff= shlibsuff=
572159b3361Sopenharmony_ci        ;;
573159b3361Sopenharmony_ci      *)
574159b3361Sopenharmony_ci        case $LD in
575159b3361Sopenharmony_ci          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
576159b3361Sopenharmony_ci          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
577159b3361Sopenharmony_ci          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
578159b3361Sopenharmony_ci          *) libsuff= shlibsuff= ;;
579159b3361Sopenharmony_ci        esac
580159b3361Sopenharmony_ci        ;;
581159b3361Sopenharmony_ci    esac
582159b3361Sopenharmony_ci    ;;
583159b3361Sopenharmony_ci  linux*oldld* | linux*aout* | linux*coff*)
584159b3361Sopenharmony_ci    ;;
585159b3361Sopenharmony_ci  linux* | k*bsd*-gnu)
586159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
587159b3361Sopenharmony_ci    ;;
588159b3361Sopenharmony_ci  knetbsd*-gnu)
589159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
590159b3361Sopenharmony_ci    ;;
591159b3361Sopenharmony_ci  netbsd*)
592159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
593159b3361Sopenharmony_ci    ;;
594159b3361Sopenharmony_ci  newsos6)
595159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
596159b3361Sopenharmony_ci    ;;
597159b3361Sopenharmony_ci  nto-qnx*)
598159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
599159b3361Sopenharmony_ci    ;;
600159b3361Sopenharmony_ci  openbsd*)
601159b3361Sopenharmony_ci    library_names_spec='$libname$shrext$versuffix'
602159b3361Sopenharmony_ci    ;;
603159b3361Sopenharmony_ci  os2*)
604159b3361Sopenharmony_ci    libname_spec='$name'
605159b3361Sopenharmony_ci    shrext=.dll
606159b3361Sopenharmony_ci    library_names_spec='$libname.a'
607159b3361Sopenharmony_ci    ;;
608159b3361Sopenharmony_ci  osf3* | osf4* | osf5*)
609159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
610159b3361Sopenharmony_ci    ;;
611159b3361Sopenharmony_ci  rdos*)
612159b3361Sopenharmony_ci    ;;
613159b3361Sopenharmony_ci  solaris*)
614159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
615159b3361Sopenharmony_ci    ;;
616159b3361Sopenharmony_ci  sunos4*)
617159b3361Sopenharmony_ci    library_names_spec='$libname$shrext$versuffix'
618159b3361Sopenharmony_ci    ;;
619159b3361Sopenharmony_ci  sysv4 | sysv4.3*)
620159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
621159b3361Sopenharmony_ci    ;;
622159b3361Sopenharmony_ci  sysv4*MP*)
623159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
624159b3361Sopenharmony_ci    ;;
625159b3361Sopenharmony_ci  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
626159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
627159b3361Sopenharmony_ci    ;;
628159b3361Sopenharmony_ci  uts4*)
629159b3361Sopenharmony_ci    library_names_spec='$libname$shrext'
630159b3361Sopenharmony_ci    ;;
631159b3361Sopenharmony_ciesac
632159b3361Sopenharmony_ci
633159b3361Sopenharmony_cised_quote_subst='s/\(["`$\\]\)/\\\1/g'
634159b3361Sopenharmony_ciescaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
635159b3361Sopenharmony_cishlibext=`echo "$shrext" | sed -e 's,^\.,,'`
636159b3361Sopenharmony_ciescaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
637159b3361Sopenharmony_ciescaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
638159b3361Sopenharmony_ciescaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
639159b3361Sopenharmony_ci
640159b3361Sopenharmony_ciLC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
641159b3361Sopenharmony_ci
642159b3361Sopenharmony_ci# How to pass a linker flag through the compiler.
643159b3361Sopenharmony_ciwl="$escaped_wl"
644159b3361Sopenharmony_ci
645159b3361Sopenharmony_ci# Static library suffix (normally "a").
646159b3361Sopenharmony_cilibext="$libext"
647159b3361Sopenharmony_ci
648159b3361Sopenharmony_ci# Shared library suffix (normally "so").
649159b3361Sopenharmony_cishlibext="$shlibext"
650159b3361Sopenharmony_ci
651159b3361Sopenharmony_ci# Format of library name prefix.
652159b3361Sopenharmony_cilibname_spec="$escaped_libname_spec"
653159b3361Sopenharmony_ci
654159b3361Sopenharmony_ci# Library names that the linker finds when passed -lNAME.
655159b3361Sopenharmony_cilibrary_names_spec="$escaped_library_names_spec"
656159b3361Sopenharmony_ci
657159b3361Sopenharmony_ci# Flag to hardcode \$libdir into a binary during linking.
658159b3361Sopenharmony_ci# This must work even if \$libdir does not exist.
659159b3361Sopenharmony_cihardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
660159b3361Sopenharmony_ci
661159b3361Sopenharmony_ci# Whether we need a single -rpath flag with a separated argument.
662159b3361Sopenharmony_cihardcode_libdir_separator="$hardcode_libdir_separator"
663159b3361Sopenharmony_ci
664159b3361Sopenharmony_ci# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
665159b3361Sopenharmony_ci# resulting binary.
666159b3361Sopenharmony_cihardcode_direct="$hardcode_direct"
667159b3361Sopenharmony_ci
668159b3361Sopenharmony_ci# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
669159b3361Sopenharmony_ci# resulting binary.
670159b3361Sopenharmony_cihardcode_minus_L="$hardcode_minus_L"
671159b3361Sopenharmony_ci
672159b3361Sopenharmony_ciEOF
673