summaryrefslogtreecommitdiff
path: root/scripts/config.rpath
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2008-10-22 13:58:49 +0100
committerRoger Leigh <rleigh@debian.org>2008-10-26 17:29:17 +0000
commitfdaec3d7655dfc557045e6cf9658808540e9f215 (patch)
tree79ec1d0fb751d3b6929dfa57d9a78319b3eca4e9 /scripts/config.rpath
parentda96e492f10c14d264544702e8be26bc428c6916 (diff)
Imported Debian patch 5.2.1-1
Diffstat (limited to 'scripts/config.rpath')
-rwxr-xr-xscripts/config.rpath403
1 files changed, 252 insertions, 151 deletions
diff --git a/scripts/config.rpath b/scripts/config.rpath
index 5ead758..c492a93 100755
--- a/scripts/config.rpath
+++ b/scripts/config.rpath
@@ -2,28 +2,13 @@
# 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.
+# Copyright 1996-2006 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.
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# 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
@@ -34,43 +19,89 @@
#
# 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,
+# 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
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
-shlibext=
+shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
- aix3* | aix4* | aix5*)
+ aix*)
wl='-Wl,'
;;
+ darwin*)
+ case $cc_basename in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | pw32* | os2*)
+ ;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
- irix5* | irix6*)
+ irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
+ newsos6)
+ ;;
linux*)
- echo '__INTEL_COMPILER' > conftest.$ac_ext
- if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
- then
- :
- else
- # Intel icc
- wl='-Qoption,ld,'
- fi
+ case $cc_basename in
+ icc* | ecc*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
+ sco3.2v5*)
+ ;;
solaris*)
wl='-Wl,'
;;
@@ -78,15 +109,20 @@ else
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- if test "x$host_vendor" = xsni; then
- wl='-LD'
- else
- wl='-Wl,'
- fi
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
;;
esac
fi
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
@@ -101,6 +137,10 @@ case "$host_os" in
with_gnu_ld=no
fi
;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
openbsd*)
with_gnu_ld=no
;;
@@ -108,10 +148,18 @@ esac
ld_shlibs=yes
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'
case "$host_os" in
aix3* | aix4* | aix5*)
- # On AIX, the GNU linker is very broken
- ld_shlibs=no
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
@@ -120,12 +168,12 @@ if test "$with_gnu_ld" = yes; then
# 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
+ # behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;;
beos*)
- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
@@ -135,29 +183,61 @@ if test "$with_gnu_ld" = yes; then
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ interix3*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
;;
- solaris* | sysv5*)
- if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
- elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
sunos4*)
hardcode_direct=yes
;;
*)
- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
- if test "$ld_shlibs" = yes; then
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
@@ -188,6 +268,7 @@ else
break
fi
done
+ ;;
esac
fi
hardcode_direct=yes
@@ -207,15 +288,30 @@ else
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
+ ;;
esac
fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ 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
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
- hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
@@ -225,6 +321,8 @@ else
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
+ bsdi[45]*)
+ ;;
cygwin* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -234,7 +332,21 @@ else
libext=lib
;;
darwin* | rhapsody*)
- hardcode_direct=yes
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case $cc_basename in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
ld_shlibs=no
@@ -247,18 +359,46 @@ else
hardcode_direct=yes
hardcode_minus_L=yes
;;
- freebsd*)
+ freebsd* | kfreebsd*-gnu | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
- hpux9* | hpux10* | hpux11*)
+ hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
- hardcode_minus_L=yes # Not in the search PATH, but as the default
- # location of the library.
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
;;
- irix5* | irix6*)
+ irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
@@ -303,8 +443,6 @@ else
fi
hardcode_libdir_separator=:
;;
- sco3.2v5*)
- ;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
@@ -314,33 +452,33 @@ else
hardcode_minus_L=yes
;;
sysv4)
- if test "x$host_vendor" = xsno; then
- hardcode_direct=yes # is this really true???
- else
- hardcode_direct=no # Motorola manual says yes, but my tests say they lie
- fi
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
;;
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; then
ld_shlibs=yes
fi
;;
- sysv4.2uw2*)
- hardcode_direct=yes
- hardcode_minus_L=no
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
;;
- sysv5uw7* | unixware7*)
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
@@ -349,136 +487,105 @@ else
fi
# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
libname_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" in
aix3*)
- shlibext=so
;;
aix4* | aix5*)
- shlibext=so
;;
amigaos*)
- shlibext=ixlibrary
;;
beos*)
- shlibext=so
;;
- bsdi4*)
- shlibext=so
- sys_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"
+ bsdi[45]*)
;;
cygwin* | mingw* | pw32*)
- case $GCC,$host_os in
- yes,cygwin*)
- shlibext=dll.a
- ;;
- yes,mingw*)
- shlibext=dll
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
- ;;
- yes,pw32*)
- shlibext=dll
- ;;
- *)
- shlibext=dll
- ;;
- esac
+ shrext=.dll
;;
darwin* | rhapsody*)
- shlibext=dylib
+ shrext=.dylib
+ ;;
+ dgux*)
;;
freebsd1*)
;;
- freebsd*)
- shlibext=so
+ kfreebsd*-gnu)
+ ;;
+ freebsd* | dragonfly*)
;;
gnu*)
- shlibext=so
;;
hpux9* | hpux10* | hpux11*)
- shlibext=sl
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
;;
- irix5* | irix6*)
- shlibext=so
+ interix3*)
+ ;;
+ irix5* | irix6* | nonstopux*)
case "$host_os" in
- irix5*)
+ irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
- *-32|*"-32 ") libsuff= shlibsuff= ;;
- *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
- *-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
- sys_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*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux*)
;;
- linux-gnu*)
- shlibext=so
+ knetbsd*-gnu)
;;
netbsd*)
- shlibext=so
;;
newsos6)
- shlibext=so
+ ;;
+ nto-qnx*)
;;
openbsd*)
- shlibext=so
;;
os2*)
libname_spec='$name'
- shlibext=dll
+ shrext=.dll
;;
osf3* | osf4* | osf5*)
- shlibext=so
- sys_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=so
- case "$host_vendor" in
- motorola)
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
+ sysv4 | sysv4.3*)
;;
- uts4*)
- shlibext=so
+ sysv4*MP*)
;;
- dgux*)
- shlibext=so
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
;;
- sysv4*MP*)
- if test -d /usr/nec; then
- shlibext=so
- fi
+ uts4*)
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
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
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
@@ -504,10 +611,4 @@ hardcode_direct="$hardcode_direct"
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
-# Compile-time system search path for libraries
-sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
-
EOF