1357f1050SThomas Veerman#! /bin/sh 2357f1050SThomas Veerman# Output a system dependent set of variables, describing how to set the 3357f1050SThomas Veerman# run time search path of shared libraries in an executable. 4357f1050SThomas Veerman# 5*0a6a1f1dSLionel Sambuc# Copyright 1996-2010 Free Software Foundation, Inc. 6357f1050SThomas Veerman# Taken from GNU libtool, 2001 7357f1050SThomas Veerman# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 8357f1050SThomas Veerman# 9*0a6a1f1dSLionel Sambuc# This file is free software; the Free Software Foundation gives 10*0a6a1f1dSLionel Sambuc# unlimited permission to copy and/or distribute it, with or without 11*0a6a1f1dSLionel Sambuc# modifications, as long as this notice is preserved. 12357f1050SThomas Veerman# 13357f1050SThomas Veerman# The first argument passed to this file is the canonical host specification, 14357f1050SThomas Veerman# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 15357f1050SThomas Veerman# or 16357f1050SThomas Veerman# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 17357f1050SThomas Veerman# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld 18357f1050SThomas Veerman# should be set by the caller. 19357f1050SThomas Veerman# 20357f1050SThomas Veerman# The set of defined variables is at the end of this script. 21357f1050SThomas Veerman 22357f1050SThomas Veerman# Known limitations: 23357f1050SThomas Veerman# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer 24357f1050SThomas Veerman# than 256 bytes, otherwise the compiler driver will dump core. The only 25357f1050SThomas Veerman# known workaround is to choose shorter directory names for the build 26357f1050SThomas Veerman# directory and/or the installation directory. 27357f1050SThomas Veerman 28*0a6a1f1dSLionel Sambuc# All known linkers require a `.a' archive for static linking (except MSVC, 29357f1050SThomas Veerman# which needs '.lib'). 30357f1050SThomas Veermanlibext=a 31357f1050SThomas Veermanshrext=.so 32357f1050SThomas Veerman 33357f1050SThomas Veermanhost="$1" 34357f1050SThomas Veermanhost_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 35357f1050SThomas Veermanhost_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 36357f1050SThomas Veermanhost_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 37357f1050SThomas Veerman 38*0a6a1f1dSLionel Sambuc# Code taken from libtool.m4's _LT_CC_BASENAME. 39*0a6a1f1dSLionel Sambuc 40*0a6a1f1dSLionel Sambucfor cc_temp in $CC""; do 41*0a6a1f1dSLionel Sambuc case $cc_temp in 42*0a6a1f1dSLionel Sambuc compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; 43*0a6a1f1dSLionel Sambuc distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; 44*0a6a1f1dSLionel Sambuc \-*) ;; 45*0a6a1f1dSLionel Sambuc *) break;; 46*0a6a1f1dSLionel Sambuc esac 47*0a6a1f1dSLionel Sambucdone 48*0a6a1f1dSLionel Sambuccc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` 49*0a6a1f1dSLionel Sambuc 50*0a6a1f1dSLionel Sambuc# Code taken from libtool.m4's _LT_COMPILER_PIC. 51357f1050SThomas Veerman 52357f1050SThomas Veermanwl= 53357f1050SThomas Veermanif test "$GCC" = yes; then 54357f1050SThomas Veerman wl='-Wl,' 55357f1050SThomas Veermanelse 56357f1050SThomas Veerman case "$host_os" in 57357f1050SThomas Veerman aix*) 58357f1050SThomas Veerman wl='-Wl,' 59357f1050SThomas Veerman ;; 60*0a6a1f1dSLionel Sambuc darwin*) 61*0a6a1f1dSLionel Sambuc case $cc_basename in 62*0a6a1f1dSLionel Sambuc xlc*) 63*0a6a1f1dSLionel Sambuc wl='-Wl,' 64*0a6a1f1dSLionel Sambuc ;; 65*0a6a1f1dSLionel Sambuc esac 66*0a6a1f1dSLionel Sambuc ;; 67*0a6a1f1dSLionel Sambuc mingw* | cygwin* | pw32* | os2* | cegcc*) 68357f1050SThomas Veerman ;; 69357f1050SThomas Veerman hpux9* | hpux10* | hpux11*) 70357f1050SThomas Veerman wl='-Wl,' 71357f1050SThomas Veerman ;; 72357f1050SThomas Veerman irix5* | irix6* | nonstopux*) 73357f1050SThomas Veerman wl='-Wl,' 74357f1050SThomas Veerman ;; 75357f1050SThomas Veerman newsos6) 76357f1050SThomas Veerman ;; 77*0a6a1f1dSLionel Sambuc linux* | k*bsd*-gnu) 78*0a6a1f1dSLionel Sambuc case $cc_basename in 79*0a6a1f1dSLionel Sambuc ecc*) 80357f1050SThomas Veerman wl='-Wl,' 81357f1050SThomas Veerman ;; 82*0a6a1f1dSLionel Sambuc icc* | ifort*) 83357f1050SThomas Veerman wl='-Wl,' 84357f1050SThomas Veerman ;; 85*0a6a1f1dSLionel Sambuc lf95*) 86*0a6a1f1dSLionel Sambuc wl='-Wl,' 87*0a6a1f1dSLionel Sambuc ;; 88*0a6a1f1dSLionel Sambuc pgcc | pgf77 | pgf90) 89*0a6a1f1dSLionel Sambuc wl='-Wl,' 90*0a6a1f1dSLionel Sambuc ;; 91*0a6a1f1dSLionel Sambuc ccc*) 92*0a6a1f1dSLionel Sambuc wl='-Wl,' 93*0a6a1f1dSLionel Sambuc ;; 94*0a6a1f1dSLionel Sambuc como) 95*0a6a1f1dSLionel Sambuc wl='-lopt=' 96*0a6a1f1dSLionel Sambuc ;; 97*0a6a1f1dSLionel Sambuc *) 98*0a6a1f1dSLionel Sambuc case `$CC -V 2>&1 | sed 5q` in 99*0a6a1f1dSLionel Sambuc *Sun\ C*) 100*0a6a1f1dSLionel Sambuc wl='-Wl,' 101*0a6a1f1dSLionel Sambuc ;; 102*0a6a1f1dSLionel Sambuc esac 103*0a6a1f1dSLionel Sambuc ;; 104357f1050SThomas Veerman esac 105357f1050SThomas Veerman ;; 106357f1050SThomas Veerman osf3* | osf4* | osf5*) 107357f1050SThomas Veerman wl='-Wl,' 108357f1050SThomas Veerman ;; 109*0a6a1f1dSLionel Sambuc rdos*) 110357f1050SThomas Veerman ;; 111357f1050SThomas Veerman solaris*) 112357f1050SThomas Veerman wl='-Wl,' 113357f1050SThomas Veerman ;; 114357f1050SThomas Veerman sunos4*) 115357f1050SThomas Veerman wl='-Qoption ld ' 116357f1050SThomas Veerman ;; 117*0a6a1f1dSLionel Sambuc sysv4 | sysv4.2uw2* | sysv4.3*) 118357f1050SThomas Veerman wl='-Wl,' 119357f1050SThomas Veerman ;; 120357f1050SThomas Veerman sysv4*MP*) 121357f1050SThomas Veerman ;; 122*0a6a1f1dSLionel Sambuc sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) 123*0a6a1f1dSLionel Sambuc wl='-Wl,' 124*0a6a1f1dSLionel Sambuc ;; 125*0a6a1f1dSLionel Sambuc unicos*) 126*0a6a1f1dSLionel Sambuc wl='-Wl,' 127*0a6a1f1dSLionel Sambuc ;; 128357f1050SThomas Veerman uts4*) 129357f1050SThomas Veerman ;; 130357f1050SThomas Veerman esac 131357f1050SThomas Veermanfi 132357f1050SThomas Veerman 133*0a6a1f1dSLionel Sambuc# Code taken from libtool.m4's _LT_LINKER_SHLIBS. 134357f1050SThomas Veerman 135357f1050SThomas Veermanhardcode_libdir_flag_spec= 136357f1050SThomas Veermanhardcode_libdir_separator= 137357f1050SThomas Veermanhardcode_direct=no 138357f1050SThomas Veermanhardcode_minus_L=no 139357f1050SThomas Veerman 140357f1050SThomas Veermancase "$host_os" in 141*0a6a1f1dSLionel Sambuc cygwin* | mingw* | pw32* | cegcc*) 142357f1050SThomas Veerman # FIXME: the MSVC++ port hasn't been tested in a loooong time 143357f1050SThomas Veerman # When not using gcc, we currently assume that we are using 144357f1050SThomas Veerman # Microsoft Visual C++. 145357f1050SThomas Veerman if test "$GCC" != yes; then 146357f1050SThomas Veerman with_gnu_ld=no 147357f1050SThomas Veerman fi 148357f1050SThomas Veerman ;; 149*0a6a1f1dSLionel Sambuc interix*) 150*0a6a1f1dSLionel Sambuc # we just hope/assume this is gcc and not c89 (= MSVC++) 151*0a6a1f1dSLionel Sambuc with_gnu_ld=yes 152*0a6a1f1dSLionel Sambuc ;; 153357f1050SThomas Veerman openbsd*) 154357f1050SThomas Veerman with_gnu_ld=no 155357f1050SThomas Veerman ;; 156357f1050SThomas Veermanesac 157357f1050SThomas Veerman 158357f1050SThomas Veermanld_shlibs=yes 159357f1050SThomas Veermanif test "$with_gnu_ld" = yes; then 160*0a6a1f1dSLionel Sambuc # Set some defaults for GNU ld with shared library support. These 161*0a6a1f1dSLionel Sambuc # are reset later if shared libraries are not supported. Putting them 162*0a6a1f1dSLionel Sambuc # here allows them to be overridden if necessary. 163*0a6a1f1dSLionel Sambuc # Unlike libtool, we use -rpath here, not --rpath, since the documented 164*0a6a1f1dSLionel Sambuc # option of GNU ld is called -rpath, not --rpath. 165*0a6a1f1dSLionel Sambuc hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 166357f1050SThomas Veerman case "$host_os" in 167*0a6a1f1dSLionel Sambuc aix[3-9]*) 168357f1050SThomas Veerman # On AIX/PPC, the GNU linker is very broken 169357f1050SThomas Veerman if test "$host_cpu" != ia64; then 170357f1050SThomas Veerman ld_shlibs=no 171357f1050SThomas Veerman fi 172357f1050SThomas Veerman ;; 173357f1050SThomas Veerman amigaos*) 174357f1050SThomas Veerman hardcode_libdir_flag_spec='-L$libdir' 175357f1050SThomas Veerman hardcode_minus_L=yes 176357f1050SThomas Veerman # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports 177357f1050SThomas Veerman # that the semantics of dynamic libraries on AmigaOS, at least up 178357f1050SThomas Veerman # to version 4, is to share data among multiple programs linked 179357f1050SThomas Veerman # with the same dynamic library. Since this doesn't match the 180*0a6a1f1dSLionel Sambuc # behavior of shared libraries on other platforms, we cannot use 181357f1050SThomas Veerman # them. 182357f1050SThomas Veerman ld_shlibs=no 183357f1050SThomas Veerman ;; 184357f1050SThomas Veerman beos*) 185*0a6a1f1dSLionel Sambuc if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then 186357f1050SThomas Veerman : 187357f1050SThomas Veerman else 188357f1050SThomas Veerman ld_shlibs=no 189357f1050SThomas Veerman fi 190357f1050SThomas Veerman ;; 191*0a6a1f1dSLionel Sambuc cygwin* | mingw* | pw32* | cegcc*) 192357f1050SThomas Veerman # hardcode_libdir_flag_spec is actually meaningless, as there is 193357f1050SThomas Veerman # no search path for DLLs. 194357f1050SThomas Veerman hardcode_libdir_flag_spec='-L$libdir' 195357f1050SThomas Veerman if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then 196357f1050SThomas Veerman : 197357f1050SThomas Veerman else 198357f1050SThomas Veerman ld_shlibs=no 199357f1050SThomas Veerman fi 200357f1050SThomas Veerman ;; 201*0a6a1f1dSLionel Sambuc interix[3-9]*) 202*0a6a1f1dSLionel Sambuc hardcode_direct=no 203*0a6a1f1dSLionel Sambuc hardcode_libdir_flag_spec='${wl}-rpath,$libdir' 204357f1050SThomas Veerman ;; 205*0a6a1f1dSLionel Sambuc gnu* | linux* | k*bsd*-gnu) 206*0a6a1f1dSLionel Sambuc if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then 207357f1050SThomas Veerman : 208357f1050SThomas Veerman else 209357f1050SThomas Veerman ld_shlibs=no 210357f1050SThomas Veerman fi 211357f1050SThomas Veerman ;; 212*0a6a1f1dSLionel Sambuc netbsd*) 213*0a6a1f1dSLionel Sambuc ;; 214*0a6a1f1dSLionel Sambuc solaris*) 215*0a6a1f1dSLionel Sambuc if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then 216*0a6a1f1dSLionel Sambuc ld_shlibs=no 217*0a6a1f1dSLionel Sambuc elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then 218*0a6a1f1dSLionel Sambuc : 219*0a6a1f1dSLionel Sambuc else 220*0a6a1f1dSLionel Sambuc ld_shlibs=no 221*0a6a1f1dSLionel Sambuc fi 222*0a6a1f1dSLionel Sambuc ;; 223*0a6a1f1dSLionel Sambuc sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) 224*0a6a1f1dSLionel Sambuc case `$LD -v 2>&1` in 225*0a6a1f1dSLionel Sambuc *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) 226*0a6a1f1dSLionel Sambuc ld_shlibs=no 227*0a6a1f1dSLionel Sambuc ;; 228*0a6a1f1dSLionel Sambuc *) 229*0a6a1f1dSLionel Sambuc if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then 230*0a6a1f1dSLionel Sambuc hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' 231*0a6a1f1dSLionel Sambuc else 232*0a6a1f1dSLionel Sambuc ld_shlibs=no 233*0a6a1f1dSLionel Sambuc fi 234*0a6a1f1dSLionel Sambuc ;; 235*0a6a1f1dSLionel Sambuc esac 236*0a6a1f1dSLionel Sambuc ;; 237357f1050SThomas Veerman sunos4*) 238357f1050SThomas Veerman hardcode_direct=yes 239357f1050SThomas Veerman ;; 240357f1050SThomas Veerman *) 241*0a6a1f1dSLionel Sambuc if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then 242357f1050SThomas Veerman : 243357f1050SThomas Veerman else 244357f1050SThomas Veerman ld_shlibs=no 245357f1050SThomas Veerman fi 246357f1050SThomas Veerman ;; 247357f1050SThomas Veerman esac 248*0a6a1f1dSLionel Sambuc if test "$ld_shlibs" = no; then 249*0a6a1f1dSLionel Sambuc hardcode_libdir_flag_spec= 250357f1050SThomas Veerman fi 251357f1050SThomas Veermanelse 252357f1050SThomas Veerman case "$host_os" in 253357f1050SThomas Veerman aix3*) 254357f1050SThomas Veerman # Note: this linker hardcodes the directories in LIBPATH if there 255357f1050SThomas Veerman # are no directories specified by -L. 256357f1050SThomas Veerman hardcode_minus_L=yes 257357f1050SThomas Veerman if test "$GCC" = yes; then 258357f1050SThomas Veerman # Neither direct hardcoding nor static linking is supported with a 259357f1050SThomas Veerman # broken collect2. 260357f1050SThomas Veerman hardcode_direct=unsupported 261357f1050SThomas Veerman fi 262357f1050SThomas Veerman ;; 263*0a6a1f1dSLionel Sambuc aix[4-9]*) 264357f1050SThomas Veerman if test "$host_cpu" = ia64; then 265357f1050SThomas Veerman # On IA64, the linker does run time linking by default, so we don't 266357f1050SThomas Veerman # have to do anything special. 267357f1050SThomas Veerman aix_use_runtimelinking=no 268357f1050SThomas Veerman else 269357f1050SThomas Veerman aix_use_runtimelinking=no 270357f1050SThomas Veerman # Test if we are trying to use run time linking or normal 271357f1050SThomas Veerman # AIX style linking. If -brtl is somewhere in LDFLAGS, we 272357f1050SThomas Veerman # need to do runtime linking. 273*0a6a1f1dSLionel Sambuc case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) 274357f1050SThomas Veerman for ld_flag in $LDFLAGS; do 275357f1050SThomas Veerman if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then 276357f1050SThomas Veerman aix_use_runtimelinking=yes 277357f1050SThomas Veerman break 278357f1050SThomas Veerman fi 279357f1050SThomas Veerman done 280*0a6a1f1dSLionel Sambuc ;; 281357f1050SThomas Veerman esac 282357f1050SThomas Veerman fi 283357f1050SThomas Veerman hardcode_direct=yes 284357f1050SThomas Veerman hardcode_libdir_separator=':' 285357f1050SThomas Veerman if test "$GCC" = yes; then 286357f1050SThomas Veerman case $host_os in aix4.[012]|aix4.[012].*) 287357f1050SThomas Veerman collect2name=`${CC} -print-prog-name=collect2` 288357f1050SThomas Veerman if test -f "$collect2name" && \ 289357f1050SThomas Veerman strings "$collect2name" | grep resolve_lib_name >/dev/null 290357f1050SThomas Veerman then 291357f1050SThomas Veerman # We have reworked collect2 292*0a6a1f1dSLionel Sambuc : 293357f1050SThomas Veerman else 294357f1050SThomas Veerman # We have old collect2 295357f1050SThomas Veerman hardcode_direct=unsupported 296357f1050SThomas Veerman hardcode_minus_L=yes 297357f1050SThomas Veerman hardcode_libdir_flag_spec='-L$libdir' 298357f1050SThomas Veerman hardcode_libdir_separator= 299357f1050SThomas Veerman fi 300*0a6a1f1dSLionel Sambuc ;; 301357f1050SThomas Veerman esac 302357f1050SThomas Veerman fi 303357f1050SThomas Veerman # Begin _LT_AC_SYS_LIBPATH_AIX. 304357f1050SThomas Veerman echo 'int main () { return 0; }' > conftest.c 305357f1050SThomas Veerman ${CC} ${LDFLAGS} conftest.c -o conftest 306357f1050SThomas Veerman aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } 307357f1050SThomas Veerman}'` 308357f1050SThomas Veerman if test -z "$aix_libpath"; then 309357f1050SThomas Veerman aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } 310357f1050SThomas Veerman}'` 311357f1050SThomas Veerman fi 312357f1050SThomas Veerman if test -z "$aix_libpath"; then 313357f1050SThomas Veerman aix_libpath="/usr/lib:/lib" 314357f1050SThomas Veerman fi 315357f1050SThomas Veerman rm -f conftest.c conftest 316357f1050SThomas Veerman # End _LT_AC_SYS_LIBPATH_AIX. 317357f1050SThomas Veerman if test "$aix_use_runtimelinking" = yes; then 318357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" 319357f1050SThomas Veerman else 320357f1050SThomas Veerman if test "$host_cpu" = ia64; then 321357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' 322357f1050SThomas Veerman else 323357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" 324357f1050SThomas Veerman fi 325357f1050SThomas Veerman fi 326357f1050SThomas Veerman ;; 327357f1050SThomas Veerman amigaos*) 328357f1050SThomas Veerman hardcode_libdir_flag_spec='-L$libdir' 329357f1050SThomas Veerman hardcode_minus_L=yes 330357f1050SThomas Veerman # see comment about different semantics on the GNU ld section 331357f1050SThomas Veerman ld_shlibs=no 332357f1050SThomas Veerman ;; 333*0a6a1f1dSLionel Sambuc bsdi[45]*) 334357f1050SThomas Veerman ;; 335*0a6a1f1dSLionel Sambuc cygwin* | mingw* | pw32* | cegcc*) 336357f1050SThomas Veerman # When not using gcc, we currently assume that we are using 337357f1050SThomas Veerman # Microsoft Visual C++. 338357f1050SThomas Veerman # hardcode_libdir_flag_spec is actually meaningless, as there is 339357f1050SThomas Veerman # no search path for DLLs. 340357f1050SThomas Veerman hardcode_libdir_flag_spec=' ' 341357f1050SThomas Veerman libext=lib 342357f1050SThomas Veerman ;; 343357f1050SThomas Veerman darwin* | rhapsody*) 344357f1050SThomas Veerman hardcode_direct=no 345*0a6a1f1dSLionel Sambuc if test "$GCC" = yes ; then 346*0a6a1f1dSLionel Sambuc : 347*0a6a1f1dSLionel Sambuc else 348*0a6a1f1dSLionel Sambuc case $cc_basename in 349*0a6a1f1dSLionel Sambuc xlc*) 350*0a6a1f1dSLionel Sambuc ;; 351*0a6a1f1dSLionel Sambuc *) 352*0a6a1f1dSLionel Sambuc ld_shlibs=no 353*0a6a1f1dSLionel Sambuc ;; 354*0a6a1f1dSLionel Sambuc esac 355357f1050SThomas Veerman fi 356357f1050SThomas Veerman ;; 357357f1050SThomas Veerman dgux*) 358357f1050SThomas Veerman hardcode_libdir_flag_spec='-L$libdir' 359357f1050SThomas Veerman ;; 360357f1050SThomas Veerman freebsd1*) 361357f1050SThomas Veerman ld_shlibs=no 362357f1050SThomas Veerman ;; 363357f1050SThomas Veerman freebsd2.2*) 364357f1050SThomas Veerman hardcode_libdir_flag_spec='-R$libdir' 365357f1050SThomas Veerman hardcode_direct=yes 366357f1050SThomas Veerman ;; 367357f1050SThomas Veerman freebsd2*) 368357f1050SThomas Veerman hardcode_direct=yes 369357f1050SThomas Veerman hardcode_minus_L=yes 370357f1050SThomas Veerman ;; 371*0a6a1f1dSLionel Sambuc freebsd* | dragonfly*) 372357f1050SThomas Veerman hardcode_libdir_flag_spec='-R$libdir' 373357f1050SThomas Veerman hardcode_direct=yes 374357f1050SThomas Veerman ;; 375357f1050SThomas Veerman hpux9*) 376357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' 377357f1050SThomas Veerman hardcode_libdir_separator=: 378357f1050SThomas Veerman hardcode_direct=yes 379357f1050SThomas Veerman # hardcode_minus_L: Not really in the search PATH, 380357f1050SThomas Veerman # but as the default location of the library. 381357f1050SThomas Veerman hardcode_minus_L=yes 382357f1050SThomas Veerman ;; 383*0a6a1f1dSLionel Sambuc hpux10*) 384357f1050SThomas Veerman if test "$with_gnu_ld" = no; then 385357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' 386357f1050SThomas Veerman hardcode_libdir_separator=: 387*0a6a1f1dSLionel Sambuc hardcode_direct=yes 388357f1050SThomas Veerman # hardcode_minus_L: Not really in the search PATH, 389357f1050SThomas Veerman # but as the default location of the library. 390357f1050SThomas Veerman hardcode_minus_L=yes 391*0a6a1f1dSLionel Sambuc fi 392357f1050SThomas Veerman ;; 393*0a6a1f1dSLionel Sambuc hpux11*) 394*0a6a1f1dSLionel Sambuc if test "$with_gnu_ld" = no; then 395357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' 396357f1050SThomas Veerman hardcode_libdir_separator=: 397*0a6a1f1dSLionel Sambuc case $host_cpu in 398*0a6a1f1dSLionel Sambuc hppa*64*|ia64*) 399*0a6a1f1dSLionel Sambuc hardcode_direct=no 400*0a6a1f1dSLionel Sambuc ;; 401*0a6a1f1dSLionel Sambuc *) 402357f1050SThomas Veerman hardcode_direct=yes 403357f1050SThomas Veerman # hardcode_minus_L: Not really in the search PATH, 404357f1050SThomas Veerman # but as the default location of the library. 405357f1050SThomas Veerman hardcode_minus_L=yes 406357f1050SThomas Veerman ;; 407357f1050SThomas Veerman esac 408357f1050SThomas Veerman fi 409357f1050SThomas Veerman ;; 410357f1050SThomas Veerman irix5* | irix6* | nonstopux*) 411357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 412357f1050SThomas Veerman hardcode_libdir_separator=: 413357f1050SThomas Veerman ;; 414357f1050SThomas Veerman netbsd*) 415357f1050SThomas Veerman hardcode_libdir_flag_spec='-R$libdir' 416357f1050SThomas Veerman hardcode_direct=yes 417357f1050SThomas Veerman ;; 418357f1050SThomas Veerman newsos6) 419357f1050SThomas Veerman hardcode_direct=yes 420357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 421357f1050SThomas Veerman hardcode_libdir_separator=: 422357f1050SThomas Veerman ;; 423357f1050SThomas Veerman openbsd*) 424*0a6a1f1dSLionel Sambuc if test -f /usr/libexec/ld.so; then 425357f1050SThomas Veerman hardcode_direct=yes 426357f1050SThomas Veerman if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 427357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-rpath,$libdir' 428357f1050SThomas Veerman else 429357f1050SThomas Veerman case "$host_os" in 430357f1050SThomas Veerman openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) 431357f1050SThomas Veerman hardcode_libdir_flag_spec='-R$libdir' 432357f1050SThomas Veerman ;; 433357f1050SThomas Veerman *) 434357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-rpath,$libdir' 435357f1050SThomas Veerman ;; 436357f1050SThomas Veerman esac 437357f1050SThomas Veerman fi 438*0a6a1f1dSLionel Sambuc else 439*0a6a1f1dSLionel Sambuc ld_shlibs=no 440*0a6a1f1dSLionel Sambuc fi 441357f1050SThomas Veerman ;; 442357f1050SThomas Veerman os2*) 443357f1050SThomas Veerman hardcode_libdir_flag_spec='-L$libdir' 444357f1050SThomas Veerman hardcode_minus_L=yes 445357f1050SThomas Veerman ;; 446357f1050SThomas Veerman osf3*) 447357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 448357f1050SThomas Veerman hardcode_libdir_separator=: 449357f1050SThomas Veerman ;; 450357f1050SThomas Veerman osf4* | osf5*) 451357f1050SThomas Veerman if test "$GCC" = yes; then 452357f1050SThomas Veerman hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 453357f1050SThomas Veerman else 454357f1050SThomas Veerman # Both cc and cxx compiler support -rpath directly 455357f1050SThomas Veerman hardcode_libdir_flag_spec='-rpath $libdir' 456357f1050SThomas Veerman fi 457357f1050SThomas Veerman hardcode_libdir_separator=: 458357f1050SThomas Veerman ;; 459357f1050SThomas Veerman solaris*) 460357f1050SThomas Veerman hardcode_libdir_flag_spec='-R$libdir' 461357f1050SThomas Veerman ;; 462357f1050SThomas Veerman sunos4*) 463357f1050SThomas Veerman hardcode_libdir_flag_spec='-L$libdir' 464357f1050SThomas Veerman hardcode_direct=yes 465357f1050SThomas Veerman hardcode_minus_L=yes 466357f1050SThomas Veerman ;; 467357f1050SThomas Veerman sysv4) 468357f1050SThomas Veerman case $host_vendor in 469357f1050SThomas Veerman sni) 470357f1050SThomas Veerman hardcode_direct=yes # is this really true??? 471357f1050SThomas Veerman ;; 472357f1050SThomas Veerman siemens) 473357f1050SThomas Veerman hardcode_direct=no 474357f1050SThomas Veerman ;; 475357f1050SThomas Veerman motorola) 476357f1050SThomas Veerman hardcode_direct=no #Motorola manual says yes, but my tests say they lie 477357f1050SThomas Veerman ;; 478357f1050SThomas Veerman esac 479357f1050SThomas Veerman ;; 480357f1050SThomas Veerman sysv4.3*) 481357f1050SThomas Veerman ;; 482357f1050SThomas Veerman sysv4*MP*) 483357f1050SThomas Veerman if test -d /usr/nec; then 484357f1050SThomas Veerman ld_shlibs=yes 485357f1050SThomas Veerman fi 486357f1050SThomas Veerman ;; 487*0a6a1f1dSLionel Sambuc sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) 488357f1050SThomas Veerman ;; 489*0a6a1f1dSLionel Sambuc sysv5* | sco3.2v5* | sco5v6*) 490*0a6a1f1dSLionel Sambuc hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' 491*0a6a1f1dSLionel Sambuc hardcode_libdir_separator=':' 492357f1050SThomas Veerman ;; 493357f1050SThomas Veerman uts4*) 494357f1050SThomas Veerman hardcode_libdir_flag_spec='-L$libdir' 495357f1050SThomas Veerman ;; 496357f1050SThomas Veerman *) 497357f1050SThomas Veerman ld_shlibs=no 498357f1050SThomas Veerman ;; 499357f1050SThomas Veerman esac 500357f1050SThomas Veermanfi 501357f1050SThomas Veerman 502357f1050SThomas Veerman# Check dynamic linker characteristics 503*0a6a1f1dSLionel Sambuc# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. 504*0a6a1f1dSLionel Sambuc# Unlike libtool.m4, here we don't care about _all_ names of the library, but 505*0a6a1f1dSLionel Sambuc# only about the one the linker finds when passed -lNAME. This is the last 506*0a6a1f1dSLionel Sambuc# element of library_names_spec in libtool.m4, or possibly two of them if the 507*0a6a1f1dSLionel Sambuc# linker has special search rules. 508*0a6a1f1dSLionel Sambuclibrary_names_spec= # the last element of library_names_spec in libtool.m4 509357f1050SThomas Veermanlibname_spec='lib$name' 510357f1050SThomas Veermancase "$host_os" in 511357f1050SThomas Veerman aix3*) 512*0a6a1f1dSLionel Sambuc library_names_spec='$libname.a' 513357f1050SThomas Veerman ;; 514*0a6a1f1dSLionel Sambuc aix[4-9]*) 515*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 516357f1050SThomas Veerman ;; 517357f1050SThomas Veerman amigaos*) 518*0a6a1f1dSLionel Sambuc library_names_spec='$libname.a' 519357f1050SThomas Veerman ;; 520357f1050SThomas Veerman beos*) 521*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 522357f1050SThomas Veerman ;; 523*0a6a1f1dSLionel Sambuc bsdi[45]*) 524*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 525357f1050SThomas Veerman ;; 526*0a6a1f1dSLionel Sambuc cygwin* | mingw* | pw32* | cegcc*) 527357f1050SThomas Veerman shrext=.dll 528*0a6a1f1dSLionel Sambuc library_names_spec='$libname.dll.a $libname.lib' 529357f1050SThomas Veerman ;; 530357f1050SThomas Veerman darwin* | rhapsody*) 531357f1050SThomas Veerman shrext=.dylib 532*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 533357f1050SThomas Veerman ;; 534357f1050SThomas Veerman dgux*) 535*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 536357f1050SThomas Veerman ;; 537357f1050SThomas Veerman freebsd1*) 538357f1050SThomas Veerman ;; 539*0a6a1f1dSLionel Sambuc freebsd* | dragonfly*) 540*0a6a1f1dSLionel Sambuc case "$host_os" in 541*0a6a1f1dSLionel Sambuc freebsd[123]*) 542*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext$versuffix' ;; 543*0a6a1f1dSLionel Sambuc *) 544*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' ;; 545*0a6a1f1dSLionel Sambuc esac 546357f1050SThomas Veerman ;; 547357f1050SThomas Veerman gnu*) 548*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 549357f1050SThomas Veerman ;; 550357f1050SThomas Veerman hpux9* | hpux10* | hpux11*) 551*0a6a1f1dSLionel Sambuc case $host_cpu in 552357f1050SThomas Veerman ia64*) 553357f1050SThomas Veerman shrext=.so 554357f1050SThomas Veerman ;; 555357f1050SThomas Veerman hppa*64*) 556357f1050SThomas Veerman shrext=.sl 557357f1050SThomas Veerman ;; 558357f1050SThomas Veerman *) 559357f1050SThomas Veerman shrext=.sl 560357f1050SThomas Veerman ;; 561357f1050SThomas Veerman esac 562*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 563*0a6a1f1dSLionel Sambuc ;; 564*0a6a1f1dSLionel Sambuc interix[3-9]*) 565*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 566357f1050SThomas Veerman ;; 567357f1050SThomas Veerman irix5* | irix6* | nonstopux*) 568*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 569357f1050SThomas Veerman case "$host_os" in 570357f1050SThomas Veerman irix5* | nonstopux*) 571357f1050SThomas Veerman libsuff= shlibsuff= 572357f1050SThomas Veerman ;; 573357f1050SThomas Veerman *) 574357f1050SThomas Veerman case $LD in 575357f1050SThomas Veerman *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; 576357f1050SThomas Veerman *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; 577357f1050SThomas Veerman *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; 578357f1050SThomas Veerman *) libsuff= shlibsuff= ;; 579357f1050SThomas Veerman esac 580357f1050SThomas Veerman ;; 581357f1050SThomas Veerman esac 582357f1050SThomas Veerman ;; 583357f1050SThomas Veerman linux*oldld* | linux*aout* | linux*coff*) 584357f1050SThomas Veerman ;; 585*0a6a1f1dSLionel Sambuc linux* | k*bsd*-gnu) 586*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 587*0a6a1f1dSLionel Sambuc ;; 588*0a6a1f1dSLionel Sambuc knetbsd*-gnu) 589*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 590357f1050SThomas Veerman ;; 591357f1050SThomas Veerman netbsd*) 592*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 593357f1050SThomas Veerman ;; 594357f1050SThomas Veerman newsos6) 595*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 596357f1050SThomas Veerman ;; 597*0a6a1f1dSLionel Sambuc nto-qnx*) 598*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 599357f1050SThomas Veerman ;; 600357f1050SThomas Veerman openbsd*) 601*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext$versuffix' 602357f1050SThomas Veerman ;; 603357f1050SThomas Veerman os2*) 604357f1050SThomas Veerman libname_spec='$name' 605357f1050SThomas Veerman shrext=.dll 606*0a6a1f1dSLionel Sambuc library_names_spec='$libname.a' 607357f1050SThomas Veerman ;; 608357f1050SThomas Veerman osf3* | osf4* | osf5*) 609*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 610357f1050SThomas Veerman ;; 611*0a6a1f1dSLionel Sambuc rdos*) 612357f1050SThomas Veerman ;; 613357f1050SThomas Veerman solaris*) 614*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 615357f1050SThomas Veerman ;; 616357f1050SThomas Veerman sunos4*) 617*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext$versuffix' 618357f1050SThomas Veerman ;; 619*0a6a1f1dSLionel Sambuc sysv4 | sysv4.3*) 620*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 621357f1050SThomas Veerman ;; 622357f1050SThomas Veerman sysv4*MP*) 623*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 624*0a6a1f1dSLionel Sambuc ;; 625*0a6a1f1dSLionel Sambuc sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 626*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 627357f1050SThomas Veerman ;; 628357f1050SThomas Veerman uts4*) 629*0a6a1f1dSLionel Sambuc library_names_spec='$libname$shrext' 630357f1050SThomas Veerman ;; 631357f1050SThomas Veermanesac 632357f1050SThomas Veerman 633357f1050SThomas Veermansed_quote_subst='s/\(["`$\\]\)/\\\1/g' 634357f1050SThomas Veermanescaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` 635357f1050SThomas Veermanshlibext=`echo "$shrext" | sed -e 's,^\.,,'` 636*0a6a1f1dSLionel Sambucescaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` 637*0a6a1f1dSLionel Sambucescaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` 638357f1050SThomas Veermanescaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` 639357f1050SThomas Veerman 640*0a6a1f1dSLionel SambucLC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF 641357f1050SThomas Veerman 642357f1050SThomas Veerman# How to pass a linker flag through the compiler. 643357f1050SThomas Veermanwl="$escaped_wl" 644357f1050SThomas Veerman 645357f1050SThomas Veerman# Static library suffix (normally "a"). 646357f1050SThomas Veermanlibext="$libext" 647357f1050SThomas Veerman 648357f1050SThomas Veerman# Shared library suffix (normally "so"). 649357f1050SThomas Veermanshlibext="$shlibext" 650357f1050SThomas Veerman 651*0a6a1f1dSLionel Sambuc# Format of library name prefix. 652*0a6a1f1dSLionel Sambuclibname_spec="$escaped_libname_spec" 653*0a6a1f1dSLionel Sambuc 654*0a6a1f1dSLionel Sambuc# Library names that the linker finds when passed -lNAME. 655*0a6a1f1dSLionel Sambuclibrary_names_spec="$escaped_library_names_spec" 656*0a6a1f1dSLionel Sambuc 657357f1050SThomas Veerman# Flag to hardcode \$libdir into a binary during linking. 658357f1050SThomas Veerman# This must work even if \$libdir does not exist. 659357f1050SThomas Veermanhardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec" 660357f1050SThomas Veerman 661357f1050SThomas Veerman# Whether we need a single -rpath flag with a separated argument. 662357f1050SThomas Veermanhardcode_libdir_separator="$hardcode_libdir_separator" 663357f1050SThomas Veerman 664357f1050SThomas Veerman# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the 665357f1050SThomas Veerman# resulting binary. 666357f1050SThomas Veermanhardcode_direct="$hardcode_direct" 667357f1050SThomas Veerman 668357f1050SThomas Veerman# Set to yes if using the -LDIR flag during linking hardcodes DIR into the 669357f1050SThomas Veerman# resulting binary. 670357f1050SThomas Veermanhardcode_minus_L="$hardcode_minus_L" 671357f1050SThomas Veerman 672357f1050SThomas VeermanEOF 673