# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2006 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# modifications, as long as this notice is preserved.
#
# 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.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
host="$1"
# Code taken from libtool.m4's _LT_CC_BASENAME.
\-*) ;;
*) break;;
esac
done
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
wl=
wl='-Wl,'
else
aix*)
wl='-Wl,'
;;
darwin*)
case $cc_basename in
xlc*)
wl='-Wl,'
;;
esac
;;
;;
wl='-Wl,'
;;
wl='-Wl,'
;;
;;
linux*)
case $cc_basename in
wl='-Wl,'
;;
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
wl='-Wl,'
;;
;;
solaris*)
wl='-Wl,'
;;
sunos4*)
wl='-Qoption ld '
;;
wl='-Wl,'
;;
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
# 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++.
fi
;;
interix*)
;;
openbsd*)
;;
esac
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
# 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 cannot use
# them.
;;
beos*)
:
else
fi
;;
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
:
else
fi
;;
interix3*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
linux*)
:
else
fi
;;
netbsd*)
;;
solaris*)
:
else
fi
;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
;;
*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
fi
;;
esac
;;
sunos4*)
;;
*)
:
else
fi
;;
esac
if test "$ld_shlibs" = no; then
fi
else
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
fi
;;
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
else
# 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.
break
fi
done
;;
esac
fi
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
then
# We have reworked collect2
else
# We have old collect2
hardcode_libdir_flag_spec='-L$libdir'
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
else
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
fi
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
# see comment about different semantics on the GNU ld section
;;
bsdi[45]*)
;;
# 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.
;;
:
else
case $cc_basename in
xlc*)
;;
*)
;;
esac
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
;;
freebsd2*)
;;
hardcode_libdir_flag_spec='-R$libdir'
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
;;
*)
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
;;
esac
fi
;;
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
;;
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
;;
openbsd*)
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
;;
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
case $host_vendor in
sni)
;;
;;
;;
esac
;;
sysv4.3*)
;;
fi
;;
;;
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
libname_spec='lib$name'
aix3*)
;;
;;
amigaos*)
;;
beos*)
;;
bsdi[45]*)
;;
;;
;;
dgux*)
;;
freebsd1*)
;;
;;
;;
gnu*)
;;
ia64*)
;;
hppa*64*)
;;
*)
;;
esac
;;
interix3*)
;;
;;
*)
esac
;;
esac
;;
;;
linux*)
;;
;;
netbsd*)
;;
;;
;;
openbsd*)
;;
os2*)
libname_spec='$name'
;;
;;
solaris*)
;;
sunos4*)
;;
;;
;;
;;
uts4*)
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
# 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"
EOF