#! /bin/sh# Output a system dependent set of variables, describing how to set the# run time search path of shared libraries in an executable.## Copyright 1996-2002 Free Software Foundation, Inc.# Taken from GNU libtool, 2001# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful, but# WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU# General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.## As a special exception to the GNU General Public License, if you# distribute this file as part of a program that contains a# configuration script generated by Autoconf, you may include it under# the same distribution terms that you use for the rest of that program.## The first argument passed to this file is the canonical host specification,# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM# or# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld# should be set by the caller.## The set of defined variables is at the end of this script.# All known linkers require a `.a' archive for static linking (except M$VC,# which needs '.lib').libext=ashlibext=host="$1"host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`wl=if test "$GCC" = yes; thenwl='-Wl,'elsecase "$host_os" inaix3* | aix4* | aix5*)wl='-Wl,';;hpux9* | hpux10* | hpux11*)wl='-Wl,';;irix5* | irix6*)wl='-Wl,';;linux*)echo '__INTEL_COMPILER' > conftest.$ac_extif $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/nullthen:else# Intel iccwl='-Qoption,ld,'fi;;osf3* | osf4* | osf5*)wl='-Wl,';;solaris*)wl='-Wl,';;sunos4*)wl='-Qoption ld ';;sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)if test "x$host_vendor" = xsni; thenwl='-LD'elsewl='-Wl,'fi;;esacfihardcode_libdir_flag_spec=hardcode_libdir_separator=hardcode_direct=nohardcode_minus_L=nocase "$host_os" incygwin* | mingw* | pw32*)# FIXME: the MSVC++ port hasn't been tested in a loooong time# When not using gcc, we currently assume that we are using# Microsoft Visual C++.if test "$GCC" != yes; thenwith_gnu_ld=nofi;;openbsd*)with_gnu_ld=no;;esacld_shlibs=yesif test "$with_gnu_ld" = yes; thencase "$host_os" inaix3* | aix4* | aix5*)# On AIX, the GNU linker is very brokenld_shlibs=no;;amigaos*)hardcode_libdir_flag_spec='-L$libdir'hardcode_minus_L=yes# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports# that the semantics of dynamic libraries on AmigaOS, at least up# to version 4, is to share data among multiple programs linked# with the same dynamic library. Since this doesn't match the# behavior of shared libraries on other platforms, we can use# them.ld_shlibs=no;;beos*)if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then:elseld_shlibs=nofi;;cygwin* | mingw* | pw32*)# hardcode_libdir_flag_spec is actually meaningless, as there is# no search path for DLLs.hardcode_libdir_flag_spec='-L$libdir';;solaris* | sysv5*)if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; thenld_shlibs=noelif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then:elseld_shlibs=nofi;;sunos4*)hardcode_direct=yes;;*)if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then:elseld_shlibs=nofi;;esacif test "$ld_shlibs" = yes; thenhardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'fielsecase "$host_os" inaix3*)# Note: this linker hardcodes the directories in LIBPATH if there# are no directories specified by -L.hardcode_minus_L=yesif test "$GCC" = yes; then# Neither direct hardcoding nor static linking is supported with a# broken collect2.hardcode_direct=unsupportedfi;;aix4* | aix5*)if test "$host_cpu" = ia64; then# On IA64, the linker does run time linking by default, so we don't# have to do anything special.aix_use_runtimelinking=noelseaix_use_runtimelinking=no# Test if we are trying to use run time linking or normal# AIX style linking. If -brtl is somewhere in LDFLAGS, we# need to do runtime linking.case $host_os in aix4.[23]|aix4.[23].*|aix5*)for ld_flag in $LDFLAGS; doif (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); thenaix_use_runtimelinking=yesbreakfidoneesacfihardcode_direct=yeshardcode_libdir_separator=':'if test "$GCC" = yes; thencase $host_os in aix4.[012]|aix4.[012].*)collect2name=`${CC} -print-prog-name=collect2`if test -f "$collect2name" && \strings "$collect2name" | grep resolve_lib_name >/dev/nullthen# We have reworked collect2hardcode_direct=yeselse# We have old collect2hardcode_direct=unsupportedhardcode_minus_L=yeshardcode_libdir_flag_spec='-L$libdir'hardcode_libdir_separator=fiesacfiif test "$aix_use_runtimelinking" = yes; thenhardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'elseif test "$host_cpu" = ia64; thenhardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'elsehardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'fifi;;amigaos*)hardcode_libdir_flag_spec='-L$libdir'hardcode_minus_L=yes# see comment about different semantics on the GNU ld sectionld_shlibs=no;;cygwin* | mingw* | pw32*)# When not using gcc, we currently assume that we are using# Microsoft Visual C++.# hardcode_libdir_flag_spec is actually meaningless, as there is# no search path for DLLs.hardcode_libdir_flag_spec=' 'libext=lib;;darwin* | rhapsody*)hardcode_direct=yes;;freebsd1*)ld_shlibs=no;;freebsd2.2*)hardcode_libdir_flag_spec='-R$libdir'hardcode_direct=yes;;freebsd2*)hardcode_direct=yeshardcode_minus_L=yes;;freebsd*)hardcode_libdir_flag_spec='-R$libdir'hardcode_direct=yes;;hpux9* | hpux10* | hpux11*)hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'hardcode_libdir_separator=:hardcode_direct=yeshardcode_minus_L=yes # Not in the search PATH, but as the default# location of the library.;;irix5* | irix6*)hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'hardcode_libdir_separator=:;;netbsd*)hardcode_libdir_flag_spec='-R$libdir'hardcode_direct=yes;;newsos6)hardcode_direct=yeshardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'hardcode_libdir_separator=:;;openbsd*)hardcode_direct=yesif test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; thenhardcode_libdir_flag_spec='${wl}-rpath,$libdir'elsecase "$host_os" inopenbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)hardcode_libdir_flag_spec='-R$libdir';;*)hardcode_libdir_flag_spec='${wl}-rpath,$libdir';;esacfi;;os2*)hardcode_libdir_flag_spec='-L$libdir'hardcode_minus_L=yes;;osf3*)hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'hardcode_libdir_separator=:;;osf4* | osf5*)if test "$GCC" = yes; thenhardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'else# Both cc and cxx compiler support -rpath directlyhardcode_libdir_flag_spec='-rpath $libdir'fihardcode_libdir_separator=:;;sco3.2v5*);;solaris*)hardcode_libdir_flag_spec='-R$libdir';;sunos4*)hardcode_libdir_flag_spec='-L$libdir'hardcode_direct=yeshardcode_minus_L=yes;;sysv4)if test "x$host_vendor" = xsno; thenhardcode_direct=yes # is this really true???elsehardcode_direct=no # Motorola manual says yes, but my tests say they liefi;;sysv4.3*);;sysv5*)hardcode_libdir_flag_spec=;;uts4*)hardcode_libdir_flag_spec='-L$libdir';;dgux*)hardcode_libdir_flag_spec='-L$libdir';;sysv4*MP*)if test -d /usr/nec; thenld_shlibs=yesfi;;sysv4.2uw2*)hardcode_direct=yeshardcode_minus_L=no;;sysv5uw7* | unixware7*);;*)ld_shlibs=no;;esacfi# Check dynamic linker characteristicslibname_spec='lib$name'sys_lib_dlsearch_path_spec="/lib /usr/lib"sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"case "$host_os" inaix3*)shlibext=so;;aix4* | aix5*)shlibext=so;;amigaos*)shlibext=ixlibrary;;beos*)shlibext=so;;bsdi4*)shlibext=sosys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib";;cygwin* | mingw* | pw32*)case $GCC,$host_os inyes,cygwin*)shlibext=dll.a;;yes,mingw*)shlibext=dllsys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`;;yes,pw32*)shlibext=dll;;*)shlibext=dll;;esac;;darwin* | rhapsody*)shlibext=dylib;;freebsd1*);;freebsd*)shlibext=so;;gnu*)shlibext=so;;hpux9* | hpux10* | hpux11*)shlibext=sl;;irix5* | irix6*)shlibext=socase "$host_os" inirix5*)libsuff= shlibsuff=;;*)case $LD in*-32|*"-32 ") libsuff= shlibsuff= ;;*-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;*-64|*"-64 ") libsuff=64 shlibsuff=64 ;;*) libsuff= shlibsuff= ;;esac;;esacsys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}";;linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*);;linux-gnu*)shlibext=so;;netbsd*)shlibext=so;;newsos6)shlibext=so;;openbsd*)shlibext=so;;os2*)libname_spec='$name'shlibext=dll;;osf3* | osf4* | osf5*)shlibext=sosys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec";;sco3.2v5*)shlibext=so;;solaris*)shlibext=so;;sunos4*)shlibext=so;;sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)shlibext=socase "$host_vendor" inmotorola)sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib';;esac;;uts4*)shlibext=so;;dgux*)shlibext=so;;sysv4*MP*)if test -d /usr/nec; thenshlibext=sofi;;esacsed_quote_subst='s/\(["`$\\]\)/\\\1/g'escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF# How to pass a linker flag through the compiler.wl="$escaped_wl"# Static library suffix (normally "a").libext="$libext"# Shared library suffix (normally "so").shlibext="$shlibext"# Flag to hardcode \$libdir into a binary during linking.# This must work even if \$libdir does not exist.hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"# Whether we need a single -rpath flag with a separated argument.hardcode_libdir_separator="$hardcode_libdir_separator"# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the# resulting binary.hardcode_direct="$hardcode_direct"# Set to yes if using the -LDIR flag during linking hardcodes DIR into the# resulting binary.hardcode_minus_L="$hardcode_minus_L"# Compile-time system search path for librariessys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"# Run-time system search path for librariessys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"EOF