xref: /netbsd-src/external/bsd/flex/dist/build-aux/config.rpath (revision 463ae347b383ca644b1399e7e5228310d0bdf969)
130da1778Schristos#! /bin/sh
230da1778Schristos# Output a system dependent set of variables, describing how to set the
330da1778Schristos# run time search path of shared libraries in an executable.
430da1778Schristos#
5*463ae347Schristos#   Copyright 1996-2010 Free Software Foundation, Inc.
630da1778Schristos#   Taken from GNU libtool, 2001
730da1778Schristos#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
830da1778Schristos#
930da1778Schristos#   This file is free software; the Free Software Foundation gives
1030da1778Schristos#   unlimited permission to copy and/or distribute it, with or without
1130da1778Schristos#   modifications, as long as this notice is preserved.
1230da1778Schristos#
1330da1778Schristos# The first argument passed to this file is the canonical host specification,
1430da1778Schristos#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
1530da1778Schristos# or
1630da1778Schristos#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
1730da1778Schristos# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
1830da1778Schristos# should be set by the caller.
1930da1778Schristos#
2030da1778Schristos# The set of defined variables is at the end of this script.
2130da1778Schristos
2230da1778Schristos# Known limitations:
2330da1778Schristos# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
2430da1778Schristos#   than 256 bytes, otherwise the compiler driver will dump core. The only
2530da1778Schristos#   known workaround is to choose shorter directory names for the build
2630da1778Schristos#   directory and/or the installation directory.
2730da1778Schristos
28*463ae347Schristos# All known linkers require a `.a' archive for static linking (except MSVC,
2930da1778Schristos# which needs '.lib').
3030da1778Schristoslibext=a
3130da1778Schristosshrext=.so
3230da1778Schristos
3330da1778Schristoshost="$1"
3430da1778Schristoshost_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
3530da1778Schristoshost_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
3630da1778Schristoshost_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
3730da1778Schristos
3830da1778Schristos# Code taken from libtool.m4's _LT_CC_BASENAME.
3930da1778Schristos
4030da1778Schristosfor cc_temp in $CC""; do
4130da1778Schristos  case $cc_temp in
4230da1778Schristos    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
4330da1778Schristos    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
4430da1778Schristos    \-*) ;;
4530da1778Schristos    *) break;;
4630da1778Schristos  esac
4730da1778Schristosdone
4830da1778Schristoscc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
4930da1778Schristos
5030da1778Schristos# Code taken from libtool.m4's _LT_COMPILER_PIC.
5130da1778Schristos
5230da1778Schristoswl=
5330da1778Schristosif test "$GCC" = yes; then
5430da1778Schristos  wl='-Wl,'
5530da1778Schristoselse
5630da1778Schristos  case "$host_os" in
5730da1778Schristos    aix*)
5830da1778Schristos      wl='-Wl,'
5930da1778Schristos      ;;
60*463ae347Schristos    darwin*)
61*463ae347Schristos      case $cc_basename in
62*463ae347Schristos        xlc*)
63*463ae347Schristos          wl='-Wl,'
64*463ae347Schristos          ;;
65*463ae347Schristos      esac
66*463ae347Schristos      ;;
6730da1778Schristos    mingw* | cygwin* | pw32* | os2* | cegcc*)
6830da1778Schristos      ;;
6930da1778Schristos    hpux9* | hpux10* | hpux11*)
7030da1778Schristos      wl='-Wl,'
7130da1778Schristos      ;;
7230da1778Schristos    irix5* | irix6* | nonstopux*)
7330da1778Schristos      wl='-Wl,'
7430da1778Schristos      ;;
75*463ae347Schristos    newsos6)
76*463ae347Schristos      ;;
77*463ae347Schristos    linux* | k*bsd*-gnu)
7830da1778Schristos      case $cc_basename in
7930da1778Schristos        ecc*)
8030da1778Schristos          wl='-Wl,'
8130da1778Schristos          ;;
8230da1778Schristos        icc* | ifort*)
8330da1778Schristos          wl='-Wl,'
8430da1778Schristos          ;;
8530da1778Schristos        lf95*)
8630da1778Schristos          wl='-Wl,'
8730da1778Schristos          ;;
88*463ae347Schristos        pgcc | pgf77 | pgf90)
8930da1778Schristos          wl='-Wl,'
9030da1778Schristos          ;;
9130da1778Schristos        ccc*)
9230da1778Schristos          wl='-Wl,'
9330da1778Schristos          ;;
9430da1778Schristos        como)
9530da1778Schristos          wl='-lopt='
9630da1778Schristos          ;;
9730da1778Schristos        *)
9830da1778Schristos          case `$CC -V 2>&1 | sed 5q` in
9930da1778Schristos            *Sun\ C*)
10030da1778Schristos              wl='-Wl,'
10130da1778Schristos              ;;
10230da1778Schristos          esac
10330da1778Schristos          ;;
10430da1778Schristos      esac
10530da1778Schristos      ;;
10630da1778Schristos    osf3* | osf4* | osf5*)
10730da1778Schristos      wl='-Wl,'
10830da1778Schristos      ;;
10930da1778Schristos    rdos*)
11030da1778Schristos      ;;
11130da1778Schristos    solaris*)
11230da1778Schristos      wl='-Wl,'
11330da1778Schristos      ;;
11430da1778Schristos    sunos4*)
11530da1778Schristos      wl='-Qoption ld '
11630da1778Schristos      ;;
11730da1778Schristos    sysv4 | sysv4.2uw2* | sysv4.3*)
11830da1778Schristos      wl='-Wl,'
11930da1778Schristos      ;;
12030da1778Schristos    sysv4*MP*)
12130da1778Schristos      ;;
12230da1778Schristos    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
12330da1778Schristos      wl='-Wl,'
12430da1778Schristos      ;;
12530da1778Schristos    unicos*)
12630da1778Schristos      wl='-Wl,'
12730da1778Schristos      ;;
12830da1778Schristos    uts4*)
12930da1778Schristos      ;;
13030da1778Schristos  esac
13130da1778Schristosfi
13230da1778Schristos
13330da1778Schristos# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
13430da1778Schristos
13530da1778Schristoshardcode_libdir_flag_spec=
13630da1778Schristoshardcode_libdir_separator=
13730da1778Schristoshardcode_direct=no
13830da1778Schristoshardcode_minus_L=no
13930da1778Schristos
14030da1778Schristoscase "$host_os" in
14130da1778Schristos  cygwin* | mingw* | pw32* | cegcc*)
14230da1778Schristos    # FIXME: the MSVC++ port hasn't been tested in a loooong time
14330da1778Schristos    # When not using gcc, we currently assume that we are using
14430da1778Schristos    # Microsoft Visual C++.
14530da1778Schristos    if test "$GCC" != yes; then
14630da1778Schristos      with_gnu_ld=no
14730da1778Schristos    fi
14830da1778Schristos    ;;
14930da1778Schristos  interix*)
15030da1778Schristos    # we just hope/assume this is gcc and not c89 (= MSVC++)
15130da1778Schristos    with_gnu_ld=yes
15230da1778Schristos    ;;
15330da1778Schristos  openbsd*)
15430da1778Schristos    with_gnu_ld=no
15530da1778Schristos    ;;
15630da1778Schristosesac
15730da1778Schristos
15830da1778Schristosld_shlibs=yes
15930da1778Schristosif test "$with_gnu_ld" = yes; then
16030da1778Schristos  # Set some defaults for GNU ld with shared library support. These
16130da1778Schristos  # are reset later if shared libraries are not supported. Putting them
16230da1778Schristos  # here allows them to be overridden if necessary.
16330da1778Schristos  # Unlike libtool, we use -rpath here, not --rpath, since the documented
16430da1778Schristos  # option of GNU ld is called -rpath, not --rpath.
16530da1778Schristos  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
16630da1778Schristos  case "$host_os" in
16730da1778Schristos    aix[3-9]*)
16830da1778Schristos      # On AIX/PPC, the GNU linker is very broken
16930da1778Schristos      if test "$host_cpu" != ia64; then
17030da1778Schristos        ld_shlibs=no
17130da1778Schristos      fi
17230da1778Schristos      ;;
17330da1778Schristos    amigaos*)
17430da1778Schristos      hardcode_libdir_flag_spec='-L$libdir'
17530da1778Schristos      hardcode_minus_L=yes
176*463ae347Schristos      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
177*463ae347Schristos      # that the semantics of dynamic libraries on AmigaOS, at least up
178*463ae347Schristos      # to version 4, is to share data among multiple programs linked
179*463ae347Schristos      # with the same dynamic library.  Since this doesn't match the
180*463ae347Schristos      # behavior of shared libraries on other platforms, we cannot use
181*463ae347Schristos      # them.
182*463ae347Schristos      ld_shlibs=no
18330da1778Schristos      ;;
18430da1778Schristos    beos*)
18530da1778Schristos      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
18630da1778Schristos        :
18730da1778Schristos      else
18830da1778Schristos        ld_shlibs=no
18930da1778Schristos      fi
19030da1778Schristos      ;;
19130da1778Schristos    cygwin* | mingw* | pw32* | cegcc*)
19230da1778Schristos      # hardcode_libdir_flag_spec is actually meaningless, as there is
19330da1778Schristos      # no search path for DLLs.
19430da1778Schristos      hardcode_libdir_flag_spec='-L$libdir'
19530da1778Schristos      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
19630da1778Schristos        :
19730da1778Schristos      else
19830da1778Schristos        ld_shlibs=no
19930da1778Schristos      fi
20030da1778Schristos      ;;
20130da1778Schristos    interix[3-9]*)
20230da1778Schristos      hardcode_direct=no
20330da1778Schristos      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
20430da1778Schristos      ;;
205*463ae347Schristos    gnu* | linux* | k*bsd*-gnu)
20630da1778Schristos      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
20730da1778Schristos        :
20830da1778Schristos      else
20930da1778Schristos        ld_shlibs=no
21030da1778Schristos      fi
21130da1778Schristos      ;;
21230da1778Schristos    netbsd*)
21330da1778Schristos      ;;
21430da1778Schristos    solaris*)
21530da1778Schristos      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
21630da1778Schristos        ld_shlibs=no
21730da1778Schristos      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
21830da1778Schristos        :
21930da1778Schristos      else
22030da1778Schristos        ld_shlibs=no
22130da1778Schristos      fi
22230da1778Schristos      ;;
22330da1778Schristos    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
22430da1778Schristos      case `$LD -v 2>&1` in
22530da1778Schristos        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
22630da1778Schristos          ld_shlibs=no
22730da1778Schristos          ;;
22830da1778Schristos        *)
22930da1778Schristos          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
23030da1778Schristos            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
23130da1778Schristos          else
23230da1778Schristos            ld_shlibs=no
23330da1778Schristos          fi
23430da1778Schristos          ;;
23530da1778Schristos      esac
23630da1778Schristos      ;;
23730da1778Schristos    sunos4*)
23830da1778Schristos      hardcode_direct=yes
23930da1778Schristos      ;;
24030da1778Schristos    *)
24130da1778Schristos      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
24230da1778Schristos        :
24330da1778Schristos      else
24430da1778Schristos        ld_shlibs=no
24530da1778Schristos      fi
24630da1778Schristos      ;;
24730da1778Schristos  esac
24830da1778Schristos  if test "$ld_shlibs" = no; then
24930da1778Schristos    hardcode_libdir_flag_spec=
25030da1778Schristos  fi
25130da1778Schristoselse
25230da1778Schristos  case "$host_os" in
25330da1778Schristos    aix3*)
25430da1778Schristos      # Note: this linker hardcodes the directories in LIBPATH if there
25530da1778Schristos      # are no directories specified by -L.
25630da1778Schristos      hardcode_minus_L=yes
25730da1778Schristos      if test "$GCC" = yes; then
25830da1778Schristos        # Neither direct hardcoding nor static linking is supported with a
25930da1778Schristos        # broken collect2.
26030da1778Schristos        hardcode_direct=unsupported
26130da1778Schristos      fi
26230da1778Schristos      ;;
26330da1778Schristos    aix[4-9]*)
26430da1778Schristos      if test "$host_cpu" = ia64; then
26530da1778Schristos        # On IA64, the linker does run time linking by default, so we don't
26630da1778Schristos        # have to do anything special.
26730da1778Schristos        aix_use_runtimelinking=no
26830da1778Schristos      else
26930da1778Schristos        aix_use_runtimelinking=no
27030da1778Schristos        # Test if we are trying to use run time linking or normal
27130da1778Schristos        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
27230da1778Schristos        # need to do runtime linking.
27330da1778Schristos        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
27430da1778Schristos          for ld_flag in $LDFLAGS; do
27530da1778Schristos            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
27630da1778Schristos              aix_use_runtimelinking=yes
27730da1778Schristos              break
27830da1778Schristos            fi
27930da1778Schristos          done
28030da1778Schristos          ;;
28130da1778Schristos        esac
28230da1778Schristos      fi
28330da1778Schristos      hardcode_direct=yes
28430da1778Schristos      hardcode_libdir_separator=':'
28530da1778Schristos      if test "$GCC" = yes; then
28630da1778Schristos        case $host_os in aix4.[012]|aix4.[012].*)
28730da1778Schristos          collect2name=`${CC} -print-prog-name=collect2`
28830da1778Schristos          if test -f "$collect2name" && \
28930da1778Schristos            strings "$collect2name" | grep resolve_lib_name >/dev/null
29030da1778Schristos          then
29130da1778Schristos            # We have reworked collect2
29230da1778Schristos            :
29330da1778Schristos          else
29430da1778Schristos            # We have old collect2
29530da1778Schristos            hardcode_direct=unsupported
29630da1778Schristos            hardcode_minus_L=yes
29730da1778Schristos            hardcode_libdir_flag_spec='-L$libdir'
29830da1778Schristos            hardcode_libdir_separator=
29930da1778Schristos          fi
30030da1778Schristos          ;;
30130da1778Schristos        esac
30230da1778Schristos      fi
30330da1778Schristos      # Begin _LT_AC_SYS_LIBPATH_AIX.
30430da1778Schristos      echo 'int main () { return 0; }' > conftest.c
30530da1778Schristos      ${CC} ${LDFLAGS} conftest.c -o conftest
30630da1778Schristos      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
30730da1778Schristos}'`
30830da1778Schristos      if test -z "$aix_libpath"; then
30930da1778Schristos        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
31030da1778Schristos}'`
31130da1778Schristos      fi
31230da1778Schristos      if test -z "$aix_libpath"; then
31330da1778Schristos        aix_libpath="/usr/lib:/lib"
31430da1778Schristos      fi
31530da1778Schristos      rm -f conftest.c conftest
31630da1778Schristos      # End _LT_AC_SYS_LIBPATH_AIX.
31730da1778Schristos      if test "$aix_use_runtimelinking" = yes; then
31830da1778Schristos        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
31930da1778Schristos      else
32030da1778Schristos        if test "$host_cpu" = ia64; then
32130da1778Schristos          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
32230da1778Schristos        else
32330da1778Schristos          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
32430da1778Schristos        fi
32530da1778Schristos      fi
32630da1778Schristos      ;;
32730da1778Schristos    amigaos*)
32830da1778Schristos      hardcode_libdir_flag_spec='-L$libdir'
32930da1778Schristos      hardcode_minus_L=yes
330*463ae347Schristos      # see comment about different semantics on the GNU ld section
331*463ae347Schristos      ld_shlibs=no
33230da1778Schristos      ;;
33330da1778Schristos    bsdi[45]*)
33430da1778Schristos      ;;
33530da1778Schristos    cygwin* | mingw* | pw32* | cegcc*)
33630da1778Schristos      # When not using gcc, we currently assume that we are using
33730da1778Schristos      # Microsoft Visual C++.
33830da1778Schristos      # hardcode_libdir_flag_spec is actually meaningless, as there is
33930da1778Schristos      # no search path for DLLs.
34030da1778Schristos      hardcode_libdir_flag_spec=' '
34130da1778Schristos      libext=lib
34230da1778Schristos      ;;
34330da1778Schristos    darwin* | rhapsody*)
34430da1778Schristos      hardcode_direct=no
345*463ae347Schristos      if test "$GCC" = yes ; then
34630da1778Schristos        :
34730da1778Schristos      else
348*463ae347Schristos        case $cc_basename in
349*463ae347Schristos          xlc*)
350*463ae347Schristos            ;;
351*463ae347Schristos          *)
35230da1778Schristos            ld_shlibs=no
353*463ae347Schristos            ;;
354*463ae347Schristos        esac
35530da1778Schristos      fi
35630da1778Schristos      ;;
35730da1778Schristos    dgux*)
35830da1778Schristos      hardcode_libdir_flag_spec='-L$libdir'
35930da1778Schristos      ;;
360*463ae347Schristos    freebsd1*)
361*463ae347Schristos      ld_shlibs=no
362*463ae347Schristos      ;;
36330da1778Schristos    freebsd2.2*)
36430da1778Schristos      hardcode_libdir_flag_spec='-R$libdir'
36530da1778Schristos      hardcode_direct=yes
36630da1778Schristos      ;;
36730da1778Schristos    freebsd2*)
36830da1778Schristos      hardcode_direct=yes
36930da1778Schristos      hardcode_minus_L=yes
37030da1778Schristos      ;;
37130da1778Schristos    freebsd* | dragonfly*)
37230da1778Schristos      hardcode_libdir_flag_spec='-R$libdir'
37330da1778Schristos      hardcode_direct=yes
37430da1778Schristos      ;;
37530da1778Schristos    hpux9*)
37630da1778Schristos      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
37730da1778Schristos      hardcode_libdir_separator=:
37830da1778Schristos      hardcode_direct=yes
37930da1778Schristos      # hardcode_minus_L: Not really in the search PATH,
38030da1778Schristos      # but as the default location of the library.
38130da1778Schristos      hardcode_minus_L=yes
38230da1778Schristos      ;;
38330da1778Schristos    hpux10*)
38430da1778Schristos      if test "$with_gnu_ld" = no; then
38530da1778Schristos        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
38630da1778Schristos        hardcode_libdir_separator=:
38730da1778Schristos        hardcode_direct=yes
38830da1778Schristos        # hardcode_minus_L: Not really in the search PATH,
38930da1778Schristos        # but as the default location of the library.
39030da1778Schristos        hardcode_minus_L=yes
39130da1778Schristos      fi
39230da1778Schristos      ;;
39330da1778Schristos    hpux11*)
39430da1778Schristos      if test "$with_gnu_ld" = no; then
39530da1778Schristos        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
39630da1778Schristos        hardcode_libdir_separator=:
39730da1778Schristos        case $host_cpu in
39830da1778Schristos          hppa*64*|ia64*)
39930da1778Schristos            hardcode_direct=no
40030da1778Schristos            ;;
40130da1778Schristos          *)
40230da1778Schristos            hardcode_direct=yes
40330da1778Schristos            # hardcode_minus_L: Not really in the search PATH,
40430da1778Schristos            # but as the default location of the library.
40530da1778Schristos            hardcode_minus_L=yes
40630da1778Schristos            ;;
40730da1778Schristos        esac
40830da1778Schristos      fi
40930da1778Schristos      ;;
41030da1778Schristos    irix5* | irix6* | nonstopux*)
41130da1778Schristos      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
41230da1778Schristos      hardcode_libdir_separator=:
41330da1778Schristos      ;;
41430da1778Schristos    netbsd*)
41530da1778Schristos      hardcode_libdir_flag_spec='-R$libdir'
41630da1778Schristos      hardcode_direct=yes
41730da1778Schristos      ;;
41830da1778Schristos    newsos6)
41930da1778Schristos      hardcode_direct=yes
42030da1778Schristos      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
42130da1778Schristos      hardcode_libdir_separator=:
42230da1778Schristos      ;;
42330da1778Schristos    openbsd*)
42430da1778Schristos      if test -f /usr/libexec/ld.so; then
42530da1778Schristos        hardcode_direct=yes
42630da1778Schristos        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
42730da1778Schristos          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
42830da1778Schristos        else
42930da1778Schristos          case "$host_os" in
43030da1778Schristos            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
43130da1778Schristos              hardcode_libdir_flag_spec='-R$libdir'
43230da1778Schristos              ;;
43330da1778Schristos            *)
43430da1778Schristos              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
43530da1778Schristos              ;;
43630da1778Schristos          esac
43730da1778Schristos        fi
43830da1778Schristos      else
43930da1778Schristos        ld_shlibs=no
44030da1778Schristos      fi
44130da1778Schristos      ;;
44230da1778Schristos    os2*)
44330da1778Schristos      hardcode_libdir_flag_spec='-L$libdir'
44430da1778Schristos      hardcode_minus_L=yes
44530da1778Schristos      ;;
44630da1778Schristos    osf3*)
44730da1778Schristos      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
44830da1778Schristos      hardcode_libdir_separator=:
44930da1778Schristos      ;;
45030da1778Schristos    osf4* | osf5*)
45130da1778Schristos      if test "$GCC" = yes; then
45230da1778Schristos        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
45330da1778Schristos      else
45430da1778Schristos        # Both cc and cxx compiler support -rpath directly
45530da1778Schristos        hardcode_libdir_flag_spec='-rpath $libdir'
45630da1778Schristos      fi
45730da1778Schristos      hardcode_libdir_separator=:
45830da1778Schristos      ;;
45930da1778Schristos    solaris*)
46030da1778Schristos      hardcode_libdir_flag_spec='-R$libdir'
46130da1778Schristos      ;;
46230da1778Schristos    sunos4*)
46330da1778Schristos      hardcode_libdir_flag_spec='-L$libdir'
46430da1778Schristos      hardcode_direct=yes
46530da1778Schristos      hardcode_minus_L=yes
46630da1778Schristos      ;;
46730da1778Schristos    sysv4)
46830da1778Schristos      case $host_vendor in
46930da1778Schristos        sni)
47030da1778Schristos          hardcode_direct=yes # is this really true???
47130da1778Schristos          ;;
47230da1778Schristos        siemens)
47330da1778Schristos          hardcode_direct=no
47430da1778Schristos          ;;
47530da1778Schristos        motorola)
47630da1778Schristos          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
47730da1778Schristos          ;;
47830da1778Schristos      esac
47930da1778Schristos      ;;
48030da1778Schristos    sysv4.3*)
48130da1778Schristos      ;;
48230da1778Schristos    sysv4*MP*)
48330da1778Schristos      if test -d /usr/nec; then
48430da1778Schristos        ld_shlibs=yes
48530da1778Schristos      fi
48630da1778Schristos      ;;
48730da1778Schristos    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
48830da1778Schristos      ;;
48930da1778Schristos    sysv5* | sco3.2v5* | sco5v6*)
49030da1778Schristos      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
49130da1778Schristos      hardcode_libdir_separator=':'
49230da1778Schristos      ;;
49330da1778Schristos    uts4*)
49430da1778Schristos      hardcode_libdir_flag_spec='-L$libdir'
49530da1778Schristos      ;;
49630da1778Schristos    *)
49730da1778Schristos      ld_shlibs=no
49830da1778Schristos      ;;
49930da1778Schristos  esac
50030da1778Schristosfi
50130da1778Schristos
50230da1778Schristos# Check dynamic linker characteristics
50330da1778Schristos# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
50430da1778Schristos# Unlike libtool.m4, here we don't care about _all_ names of the library, but
50530da1778Schristos# only about the one the linker finds when passed -lNAME. This is the last
50630da1778Schristos# element of library_names_spec in libtool.m4, or possibly two of them if the
50730da1778Schristos# linker has special search rules.
50830da1778Schristoslibrary_names_spec=      # the last element of library_names_spec in libtool.m4
50930da1778Schristoslibname_spec='lib$name'
51030da1778Schristoscase "$host_os" in
51130da1778Schristos  aix3*)
51230da1778Schristos    library_names_spec='$libname.a'
51330da1778Schristos    ;;
51430da1778Schristos  aix[4-9]*)
51530da1778Schristos    library_names_spec='$libname$shrext'
51630da1778Schristos    ;;
51730da1778Schristos  amigaos*)
518*463ae347Schristos    library_names_spec='$libname.a'
51930da1778Schristos    ;;
52030da1778Schristos  beos*)
52130da1778Schristos    library_names_spec='$libname$shrext'
52230da1778Schristos    ;;
52330da1778Schristos  bsdi[45]*)
52430da1778Schristos    library_names_spec='$libname$shrext'
52530da1778Schristos    ;;
52630da1778Schristos  cygwin* | mingw* | pw32* | cegcc*)
52730da1778Schristos    shrext=.dll
52830da1778Schristos    library_names_spec='$libname.dll.a $libname.lib'
52930da1778Schristos    ;;
53030da1778Schristos  darwin* | rhapsody*)
53130da1778Schristos    shrext=.dylib
53230da1778Schristos    library_names_spec='$libname$shrext'
53330da1778Schristos    ;;
53430da1778Schristos  dgux*)
53530da1778Schristos    library_names_spec='$libname$shrext'
53630da1778Schristos    ;;
537*463ae347Schristos  freebsd1*)
538*463ae347Schristos    ;;
53930da1778Schristos  freebsd* | dragonfly*)
54030da1778Schristos    case "$host_os" in
54130da1778Schristos      freebsd[123]*)
54230da1778Schristos        library_names_spec='$libname$shrext$versuffix' ;;
54330da1778Schristos      *)
54430da1778Schristos        library_names_spec='$libname$shrext' ;;
54530da1778Schristos    esac
54630da1778Schristos    ;;
54730da1778Schristos  gnu*)
54830da1778Schristos    library_names_spec='$libname$shrext'
54930da1778Schristos    ;;
55030da1778Schristos  hpux9* | hpux10* | hpux11*)
55130da1778Schristos    case $host_cpu in
55230da1778Schristos      ia64*)
55330da1778Schristos        shrext=.so
55430da1778Schristos        ;;
55530da1778Schristos      hppa*64*)
55630da1778Schristos        shrext=.sl
55730da1778Schristos        ;;
55830da1778Schristos      *)
55930da1778Schristos        shrext=.sl
56030da1778Schristos        ;;
56130da1778Schristos    esac
56230da1778Schristos    library_names_spec='$libname$shrext'
56330da1778Schristos    ;;
56430da1778Schristos  interix[3-9]*)
56530da1778Schristos    library_names_spec='$libname$shrext'
56630da1778Schristos    ;;
56730da1778Schristos  irix5* | irix6* | nonstopux*)
56830da1778Schristos    library_names_spec='$libname$shrext'
56930da1778Schristos    case "$host_os" in
57030da1778Schristos      irix5* | nonstopux*)
57130da1778Schristos        libsuff= shlibsuff=
57230da1778Schristos        ;;
57330da1778Schristos      *)
57430da1778Schristos        case $LD in
57530da1778Schristos          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
57630da1778Schristos          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
57730da1778Schristos          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
57830da1778Schristos          *) libsuff= shlibsuff= ;;
57930da1778Schristos        esac
58030da1778Schristos        ;;
58130da1778Schristos    esac
58230da1778Schristos    ;;
58330da1778Schristos  linux*oldld* | linux*aout* | linux*coff*)
58430da1778Schristos    ;;
585*463ae347Schristos  linux* | k*bsd*-gnu)
58630da1778Schristos    library_names_spec='$libname$shrext'
58730da1778Schristos    ;;
58830da1778Schristos  knetbsd*-gnu)
58930da1778Schristos    library_names_spec='$libname$shrext'
59030da1778Schristos    ;;
59130da1778Schristos  netbsd*)
59230da1778Schristos    library_names_spec='$libname$shrext'
59330da1778Schristos    ;;
59430da1778Schristos  newsos6)
59530da1778Schristos    library_names_spec='$libname$shrext'
59630da1778Schristos    ;;
597*463ae347Schristos  nto-qnx*)
59830da1778Schristos    library_names_spec='$libname$shrext'
59930da1778Schristos    ;;
60030da1778Schristos  openbsd*)
60130da1778Schristos    library_names_spec='$libname$shrext$versuffix'
60230da1778Schristos    ;;
60330da1778Schristos  os2*)
60430da1778Schristos    libname_spec='$name'
60530da1778Schristos    shrext=.dll
60630da1778Schristos    library_names_spec='$libname.a'
60730da1778Schristos    ;;
60830da1778Schristos  osf3* | osf4* | osf5*)
60930da1778Schristos    library_names_spec='$libname$shrext'
61030da1778Schristos    ;;
61130da1778Schristos  rdos*)
61230da1778Schristos    ;;
61330da1778Schristos  solaris*)
61430da1778Schristos    library_names_spec='$libname$shrext'
61530da1778Schristos    ;;
61630da1778Schristos  sunos4*)
61730da1778Schristos    library_names_spec='$libname$shrext$versuffix'
61830da1778Schristos    ;;
61930da1778Schristos  sysv4 | sysv4.3*)
62030da1778Schristos    library_names_spec='$libname$shrext'
62130da1778Schristos    ;;
62230da1778Schristos  sysv4*MP*)
62330da1778Schristos    library_names_spec='$libname$shrext'
62430da1778Schristos    ;;
62530da1778Schristos  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
62630da1778Schristos    library_names_spec='$libname$shrext'
62730da1778Schristos    ;;
62830da1778Schristos  uts4*)
62930da1778Schristos    library_names_spec='$libname$shrext'
63030da1778Schristos    ;;
63130da1778Schristosesac
63230da1778Schristos
63330da1778Schristossed_quote_subst='s/\(["`$\\]\)/\\\1/g'
63430da1778Schristosescaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
63530da1778Schristosshlibext=`echo "$shrext" | sed -e 's,^\.,,'`
63630da1778Schristosescaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
63730da1778Schristosescaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
63830da1778Schristosescaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
63930da1778Schristos
64030da1778SchristosLC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
64130da1778Schristos
64230da1778Schristos# How to pass a linker flag through the compiler.
64330da1778Schristoswl="$escaped_wl"
64430da1778Schristos
64530da1778Schristos# Static library suffix (normally "a").
64630da1778Schristoslibext="$libext"
64730da1778Schristos
64830da1778Schristos# Shared library suffix (normally "so").
64930da1778Schristosshlibext="$shlibext"
65030da1778Schristos
65130da1778Schristos# Format of library name prefix.
65230da1778Schristoslibname_spec="$escaped_libname_spec"
65330da1778Schristos
65430da1778Schristos# Library names that the linker finds when passed -lNAME.
65530da1778Schristoslibrary_names_spec="$escaped_library_names_spec"
65630da1778Schristos
65730da1778Schristos# Flag to hardcode \$libdir into a binary during linking.
65830da1778Schristos# This must work even if \$libdir does not exist.
65930da1778Schristoshardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
66030da1778Schristos
66130da1778Schristos# Whether we need a single -rpath flag with a separated argument.
66230da1778Schristoshardcode_libdir_separator="$hardcode_libdir_separator"
66330da1778Schristos
66430da1778Schristos# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
66530da1778Schristos# resulting binary.
66630da1778Schristoshardcode_direct="$hardcode_direct"
66730da1778Schristos
66830da1778Schristos# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
66930da1778Schristos# resulting binary.
67030da1778Schristoshardcode_minus_L="$hardcode_minus_L"
67130da1778Schristos
67230da1778SchristosEOF
673