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