summaryrefslogtreecommitdiff
path: root/tests/havelib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-04-02 18:09:43 +0200
committerBruno Haible <bruno@clisp.org>2010-04-02 18:12:09 +0200
commit1fe927756ca51f3e7efd868b29a8d4299e91a331 (patch)
tree72d20a4c97394e8b885b0a1b7f3b572f4665e5e0 /tests/havelib
parent078dac83a231a9cac7d7d38f28f0bdace52111a6 (diff)
downloadgnulib-1fe927756ca51f3e7efd868b29a8d4299e91a331.tar.gz
Tests for module 'havelib', moved here from GNU gettext.
Diffstat (limited to 'tests/havelib')
-rw-r--r--tests/havelib/Makefile.am79
-rw-r--r--tests/havelib/README77
-rw-r--r--tests/havelib/rpath-140
-rwxr-xr-xtests/havelib/rpath-1a9
-rwxr-xr-xtests/havelib/rpath-1b9
-rw-r--r--tests/havelib/rpath-2_a56
-rw-r--r--tests/havelib/rpath-2_b69
-rwxr-xr-xtests/havelib/rpath-2aaa12
-rwxr-xr-xtests/havelib/rpath-2aab12
-rwxr-xr-xtests/havelib/rpath-2aac12
-rwxr-xr-xtests/havelib/rpath-2aad12
-rwxr-xr-xtests/havelib/rpath-2aba13
-rwxr-xr-xtests/havelib/rpath-2abb13
-rwxr-xr-xtests/havelib/rpath-2abc13
-rwxr-xr-xtests/havelib/rpath-2abd13
-rwxr-xr-xtests/havelib/rpath-2baa14
-rwxr-xr-xtests/havelib/rpath-2bab14
-rwxr-xr-xtests/havelib/rpath-2bac14
-rwxr-xr-xtests/havelib/rpath-2bad14
-rwxr-xr-xtests/havelib/rpath-2bba15
-rwxr-xr-xtests/havelib/rpath-2bbb15
-rwxr-xr-xtests/havelib/rpath-2bbc15
-rwxr-xr-xtests/havelib/rpath-2bbd15
-rw-r--r--tests/havelib/rpath-3_a69
-rw-r--r--tests/havelib/rpath-3_b86
-rwxr-xr-xtests/havelib/rpath-3aaa14
-rwxr-xr-xtests/havelib/rpath-3aab14
-rwxr-xr-xtests/havelib/rpath-3aac14
-rwxr-xr-xtests/havelib/rpath-3aad14
-rwxr-xr-xtests/havelib/rpath-3aae14
-rwxr-xr-xtests/havelib/rpath-3aaf14
-rwxr-xr-xtests/havelib/rpath-3aag14
-rwxr-xr-xtests/havelib/rpath-3aah14
-rwxr-xr-xtests/havelib/rpath-3aba15
-rwxr-xr-xtests/havelib/rpath-3abb15
-rwxr-xr-xtests/havelib/rpath-3abc15
-rwxr-xr-xtests/havelib/rpath-3abd15
-rwxr-xr-xtests/havelib/rpath-3abe15
-rwxr-xr-xtests/havelib/rpath-3abf15
-rwxr-xr-xtests/havelib/rpath-3abg15
-rwxr-xr-xtests/havelib/rpath-3abh15
-rwxr-xr-xtests/havelib/rpath-3baa16
-rwxr-xr-xtests/havelib/rpath-3bab16
-rwxr-xr-xtests/havelib/rpath-3bac16
-rwxr-xr-xtests/havelib/rpath-3bad16
-rwxr-xr-xtests/havelib/rpath-3bae16
-rwxr-xr-xtests/havelib/rpath-3baf16
-rwxr-xr-xtests/havelib/rpath-3bag16
-rwxr-xr-xtests/havelib/rpath-3bah16
-rwxr-xr-xtests/havelib/rpath-3bba17
-rwxr-xr-xtests/havelib/rpath-3bbb17
-rwxr-xr-xtests/havelib/rpath-3bbc17
-rwxr-xr-xtests/havelib/rpath-3bbd17
-rwxr-xr-xtests/havelib/rpath-3bbe17
-rwxr-xr-xtests/havelib/rpath-3bbf17
-rwxr-xr-xtests/havelib/rpath-3bbg17
-rwxr-xr-xtests/havelib/rpath-3bbh17
-rwxr-xr-xtests/havelib/rpathcfg.sh232
-rw-r--r--tests/havelib/rpathlx/Makefile.am7
-rw-r--r--tests/havelib/rpathlx/configure.ac24
-rw-r--r--tests/havelib/rpathlx/usex.c2
-rw-r--r--tests/havelib/rpathly/Makefile.am7
-rw-r--r--tests/havelib/rpathly/configure.ac24
-rw-r--r--tests/havelib/rpathly/usey.c2
-rw-r--r--tests/havelib/rpathlyx/Makefile.am7
-rw-r--r--tests/havelib/rpathlyx/configure.ac26
-rw-r--r--tests/havelib/rpathlyx/usey.c2
-rw-r--r--tests/havelib/rpathlz/Makefile.am7
-rw-r--r--tests/havelib/rpathlz/configure.ac24
-rw-r--r--tests/havelib/rpathlz/usez.c2
-rw-r--r--tests/havelib/rpathlzyx/Makefile.am7
-rw-r--r--tests/havelib/rpathlzyx/configure.ac27
-rw-r--r--tests/havelib/rpathlzyx/usez.c2
-rw-r--r--tests/havelib/rpathx/Makefile.am4
-rw-r--r--tests/havelib/rpathx/configure.ac25
-rw-r--r--tests/havelib/rpathx/rpathx.c1
-rw-r--r--tests/havelib/rpathy/Makefile.am4
-rw-r--r--tests/havelib/rpathy/configure.ac26
-rw-r--r--tests/havelib/rpathy/rpathy.c2
-rw-r--r--tests/havelib/rpathz/Makefile.am4
-rw-r--r--tests/havelib/rpathz/configure.ac27
-rw-r--r--tests/havelib/rpathz/rpathz.c3
82 files changed, 1704 insertions, 0 deletions
diff --git a/tests/havelib/Makefile.am b/tests/havelib/Makefile.am
new file mode 100644
index 0000000000..57dcbf3578
--- /dev/null
+++ b/tests/havelib/Makefile.am
@@ -0,0 +1,79 @@
+## Makefile for the autoconf-lib-link/tests subdirectory of GNU gettext
+## Copyright (C) 1995-1997, 2001-2003, 2006, 2009-2010 Free Software Foundation, Inc.
+##
+## 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 3 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, see <http://www.gnu.org/licenses/>.
+
+## Process this file with automake to produce Makefile.in.
+
+AUTOMAKE_OPTIONS = 1.11 gnits no-dependencies color-tests
+MOSTLYCLEANFILES =
+
+TESTS = rpath-1a rpath-1b \
+ rpath-2aaa rpath-2aab rpath-2aad \
+ rpath-2aba rpath-2abb rpath-2abd \
+ rpath-2baa rpath-2bab rpath-2bad \
+ rpath-2bba rpath-2bbb rpath-2bbd \
+ rpath-3aaa rpath-3aab rpath-3aad \
+ rpath-3aah \
+ rpath-3aba rpath-3abb rpath-3abd \
+ rpath-3abh \
+ rpath-3baa rpath-3bab rpath-3bad \
+ rpath-3bah \
+ rpath-3bba rpath-3bbb rpath-3bbd \
+ rpath-3bbh
+
+EXTRA_DIST = $(TESTS) \
+ rpathx/configure.ac rpathx/aclocal.m4 rpathx/configure \
+ rpathx/Makefile.am rpathx/Makefile.in rpathx/rpathx.c \
+ rpathy/configure.ac rpathy/aclocal.m4 rpathy/configure \
+ rpathy/Makefile.am rpathy/Makefile.in rpathy/rpathy.c \
+ rpathz/configure.ac rpathz/aclocal.m4 rpathz/configure \
+ rpathz/Makefile.am rpathz/Makefile.in rpathz/rpathz.c \
+ rpathlx/configure.ac rpathlx/aclocal.m4 rpathlx/configure \
+ rpathlx/Makefile.am rpathlx/Makefile.in rpathlx/usex.c \
+ rpathly/configure.ac rpathly/aclocal.m4 rpathly/configure \
+ rpathly/Makefile.am rpathly/Makefile.in rpathly/usey.c \
+ rpathlyx/configure.ac rpathlyx/aclocal.m4 rpathlyx/configure \
+ rpathlyx/Makefile.am rpathlyx/Makefile.in rpathlyx/usey.c \
+ rpathlz/configure.ac rpathlz/aclocal.m4 rpathlz/configure \
+ rpathlz/Makefile.am rpathlz/Makefile.in rpathlz/usez.c \
+ rpathlzyx/configure.ac rpathlzyx/aclocal.m4 rpathlzyx/configure \
+ rpathlzyx/Makefile.am rpathlzyx/Makefile.in rpathlzyx/usez.c \
+ rpath-1 rpath-2_a rpath-2_b rpath-3_a rpath-3_b README \
+ rpath-3aae rpath-3aag rpath-3abe rpath-3abg \
+ rpathcfg.sh
+
+TESTS_ENVIRONMENT = top_srcdir=$(srcdir)/../.. srcdir=$(srcdir) \
+ OBJEXT='@OBJEXT@' EXEEXT='@EXEEXT@' \
+ LIBTOOL='@LIBTOOL@' \
+ CC='@CC@' CFLAGS='@CFLAGS@' \
+ CPPFLAGS='@CPPFLAGS@' LDFLAGS='@LDFLAGS@' \
+ LIBDIRSTEM='@LIBDIRSTEM@' \
+ CONFIG_SHELL='$(SHELL)' \
+ $(SHELL)
+
+# Help maintaining config.rpath.
+rpathcfg: rpathcfg.sh
+ top_srcdir=$(srcdir)/../.. srcdir=$(srcdir) \
+ CONFIG_SHELL='$(SHELL)' \
+ CC='@CC@' GCC='@GCC@' \
+ LDFLAGS='@LDFLAGS@' \
+ LD='@LD@' with_gnu_ld='@with_gnu_ld@' \
+ host='@host@' \
+ $(SHELL) $(srcdir)/rpathcfg.sh > rpathcfg 2> rpathcfg.log
+MOSTLYCLEANFILES += rpathcfg rpathcfg.log
+
+# Clean up the intermediate directory created by running the tests.
+distclean-local:
+ rm -rf ../havelib-tstdir
diff --git a/tests/havelib/README b/tests/havelib/README
new file mode 100644
index 0000000000..add09ad8a3
--- /dev/null
+++ b/tests/havelib/README
@@ -0,0 +1,77 @@
+Tests for config.rpath and lib-link.m4.
+
+rpath-1 w
+ |
+ +---- a = static, b = shared
+
+rpath-2 u v w
+ | | |
+ | | +---- a = static/static, b = static/shared,
+ | | c = shared/static, d = shared/shared.
+ | |
+ | +------ a = all libraries and the program have the same prefix,
+ | b = the libraries are in different directories.
+ |
+ +-------- a = all shared libraries use the libtool *.la files for
+ resolving dependencies, b = dependencies are given as
+ AC_LIB_LINKFLAGS argument instead.
+
+rpath-3 u v w
+ | | |
+ | | +---- a = static/static/static, b = static/static/shared,
+ | | c = static/shared/static, d = static/shared/shared,
+ | | e = shared/static/static, f = shared/static/shared,
+ | | g = shared/shared/static, h = shared/shared/shared.
+ | |
+ | +------ a = all libraries and the program have the same prefix,
+ | b = the libraries are in different directories.
+ |
+ +-------- a = all shared libraries use the libtool *.la files for
+ resolving dependencies, b = dependencies are given as
+ AC_LIB_LINKFLAGS argument instead.
+
+The rpath-2* tests are sensitive to
+ - incomplete shared library support in the system,
+ - bugs in libtool that creates the shared libraries,
+ - bugs in lib-link.m4.
+
+The rpath-3* tests are sensitive to
+ - incomplete shared library support in the system,
+ - bugs in libtool that creates the shared libraries.
+
+Known failures:
+
+* On all platforms supporting shared libraries,
+ rpath-3aae rpath-3aag
+ rpath-3abe rpath-3abg
+ fail. This is a libtool 1.4.2 bug: When a shared library depends on a
+ static library indirectly through two different dependency paths,
+ libtool attempts to link together invalid sets of object files.
+
+* OSF/1 4.0: the tests
+ rpath-2bbd
+ rpath-3bbd rpath-3bbf rpath-3bbg rpath-3bbh
+ fail, because -rpath options are not cumulative:
+ The last -rpath option overrides all previous ones. One would need to
+ pass all directories, separated by colons, in a single -rpath option.
+
+* On Linux/x86_64: the tests
+ rpath-2aac rpath-2abc rpath-2bac rpath-2bbc
+ rpath-3aac rpath-3aaf rpath-3abc rpath-3abf
+ rpath-3bac rpath-3bae rpath-3baf rpath-3bag
+ rpath-3bbc rpath-3bbe rpath-3bbf rpath-3bbg
+ fail, because code from static libraries not compiled with -fPIC cannot
+ be integrated into shared libraries: linker error about relocations.
+
+* Solaris: the tests
+ rpath-3bae rpath-3bbe
+ rpath-3aaf rpath-3abf
+ rpath-3baf rpath-3bbf
+ fail, because code from static libraries not compiled with -fPIC cannot
+ be integrated into shared libraries: linker error "Text relocation remains".
+
+* Cygwin: The tests
+ rpath-2aac rpath-2abc
+ rpath-3aac rpath-3aaf
+ rpath-3abc rpath-3abf
+ fail.
diff --git a/tests/havelib/rpath-1 b/tests/havelib/rpath-1
new file mode 100644
index 0000000000..2d14f04546
--- /dev/null
+++ b/tests/havelib/rpath-1
@@ -0,0 +1,40 @@
+# Common portion of all rpath-1* tests.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+builddir=`pwd`
+global_top_auxdir=`cd "$top_srcdir"/build-aux && pwd`
+export global_top_auxdir
+
+tstdir='tst/dir'
+test -d $tstdir || { mkdir tst && mkdir $tstdir; }
+
+tmpfiles="$tmpfiles $rp-prefix"
+rm -rf $rp-prefix
+mkdir $rp-prefix
+
+tmpfiles="$tmpfiles $tstdir/$rp-build1"
+rm -rf $tstdir/$rp-build1
+mkdir $tstdir/$rp-build1
+(cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/$rp-build1 && tar xf -)
+(cd $tstdir/$rp-build1
+ ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+
+tmpfiles="$tmpfiles $tstdir/$rp-build2"
+rm -rf $tstdir/$rp-build2
+mkdir $tstdir/$rp-build2
+(cd $srcdir/rpathlx && tar cf - *) | (cd $tstdir/$rp-build2 && tar xf -)
+(cd $tstdir/$rp-build2
+ ${CONFIG_SHELL-/bin/sh} ./configure --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make check >> make.log
+)
+result=$?
+
+rm -rf $tmpfiles
+
+exit $result
diff --git a/tests/havelib/rpath-1a b/tests/havelib/rpath-1a
new file mode 100755
index 0000000000..413a48c683
--- /dev/null
+++ b/tests/havelib/rpath-1a
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# Simple case: a static library.
+
+rp=rp1a
+build1_configure_flags=--disable-shared
+
+. $srcdir/rpath-1
diff --git a/tests/havelib/rpath-1b b/tests/havelib/rpath-1b
new file mode 100755
index 0000000000..3170d81a47
--- /dev/null
+++ b/tests/havelib/rpath-1b
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# Simple case: a shared library.
+
+rp=rp1b
+build1_configure_flags=
+
+. $srcdir/rpath-1
diff --git a/tests/havelib/rpath-2_a b/tests/havelib/rpath-2_a
new file mode 100644
index 0000000000..3570e44441
--- /dev/null
+++ b/tests/havelib/rpath-2_a
@@ -0,0 +1,56 @@
+# Common portion of all rpath-2?a? tests.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+builddir=`pwd`
+global_top_auxdir=`cd "$top_srcdir"/build-aux && pwd`
+export global_top_auxdir
+
+tstdir='tst/dir'
+test -d $tstdir || { mkdir tst && mkdir $tstdir; }
+
+tmpfiles="$tmpfiles $rp-prefix"
+rm -rf $rp-prefix
+mkdir $rp-prefix
+
+tmpfiles="$tmpfiles $tstdir/$rp-build1"
+rm -rf $tstdir/$rp-build1
+mkdir $tstdir/$rp-build1
+(cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/$rp-build1 && tar xf -)
+(cd $tstdir/$rp-build1
+ ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix/lib/librpathx.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build2"
+rm -rf $tstdir/$rp-build2
+mkdir $tstdir/$rp-build2
+(cd $srcdir/rpathy && tar cf - *) | (cd $tstdir/$rp-build2 && tar xf -)
+(cd $tstdir/$rp-build2
+ ${CONFIG_SHELL-/bin/sh} ./configure $build2_configure_flags --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix/lib/librpathy.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build3"
+rm -rf $tstdir/$rp-build3
+mkdir $tstdir/$rp-build3
+(cd $srcdir/$build3_package && tar cf - *) | (cd $tstdir/$rp-build3 && tar xf -)
+(cd $tstdir/$rp-build3
+ ${CONFIG_SHELL-/bin/sh} ./configure --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make check >> make.log
+)
+result=$?
+
+rm -rf $tmpfiles
+
+exit $result
diff --git a/tests/havelib/rpath-2_b b/tests/havelib/rpath-2_b
new file mode 100644
index 0000000000..e851d0190d
--- /dev/null
+++ b/tests/havelib/rpath-2_b
@@ -0,0 +1,69 @@
+# Common portion of all rpath-2?b? tests.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+builddir=`pwd`
+global_top_auxdir=`cd "$top_srcdir"/build-aux && pwd`
+export global_top_auxdir
+
+tstdir='tst/dir'
+test -d $tstdir || { mkdir tst && mkdir $tstdir; }
+
+tmpfiles="$tmpfiles $rp-prefix1"
+rm -rf $rp-prefix1
+mkdir $rp-prefix1
+
+tmpfiles="$tmpfiles $rp-prefix2"
+rm -rf $rp-prefix2
+mkdir $rp-prefix2
+
+tmpfiles="$tmpfiles $rp-prefix"
+rm -rf $rp-prefix
+mkdir $rp-prefix
+
+tmpfiles="$tmpfiles $tstdir/$rp-build1"
+rm -rf $tstdir/$rp-build1
+mkdir $tstdir/$rp-build1
+(cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/$rp-build1 && tar xf -)
+(cd $tstdir/$rp-build1
+ ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --prefix=$builddir/$rp-prefix1 --libdir=$builddir/$rp-prefix1/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix1/lib/librpathx.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build2"
+rm -rf $tstdir/$rp-build2
+mkdir $tstdir/$rp-build2
+(cd $srcdir/rpathy && tar cf - *) | (cd $tstdir/$rp-build2 && tar xf -)
+(cd $tstdir/$rp-build2
+ ${CONFIG_SHELL-/bin/sh} ./configure $build2_configure_flags --prefix=$builddir/$rp-prefix2 --libdir=$builddir/$rp-prefix2/$LIBDIRSTEM --with-librpathx-prefix=$builddir/$rp-prefix1 > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix2/lib/librpathy.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build3"
+rm -rf $tstdir/$rp-build3
+mkdir $tstdir/$rp-build3
+(cd $srcdir/$build3_package && tar cf - *) | (cd $tstdir/$rp-build3 && tar xf -)
+(cd $tstdir/$rp-build3
+ if test $remove_la = yes; then
+ build3_configure_flags=--with-librpathx-prefix=$builddir/$rp-prefix1
+ else
+ build3_configure_flags=
+ fi
+ ${CONFIG_SHELL-/bin/sh} ./configure --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM --with-librpathy-prefix=$builddir/$rp-prefix2 $build3_configure_flags > configure.log 2>&1
+ make > make.log 2>&1
+ make check >> make.log
+)
+result=$?
+
+rm -rf $tmpfiles
+
+exit $result
diff --git a/tests/havelib/rpath-2aaa b/tests/havelib/rpath-2aaa
new file mode 100755
index 0000000000..02b0bdda53
--- /dev/null
+++ b/tests/havelib/rpath-2aaa
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library.
+
+rp=rp2aaa
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_package=rpathly
+remove_la=no
+
+. $srcdir/rpath-2_a
diff --git a/tests/havelib/rpath-2aab b/tests/havelib/rpath-2aab
new file mode 100755
index 0000000000..a8e8760be8
--- /dev/null
+++ b/tests/havelib/rpath-2aab
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library.
+
+rp=rp2aab
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_package=rpathly
+remove_la=no
+
+. $srcdir/rpath-2_a
diff --git a/tests/havelib/rpath-2aac b/tests/havelib/rpath-2aac
new file mode 100755
index 0000000000..9bf805e1c1
--- /dev/null
+++ b/tests/havelib/rpath-2aac
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library.
+
+rp=rp2aac
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_package=rpathly
+remove_la=no
+
+. $srcdir/rpath-2_a
diff --git a/tests/havelib/rpath-2aad b/tests/havelib/rpath-2aad
new file mode 100755
index 0000000000..17ac5d6e64
--- /dev/null
+++ b/tests/havelib/rpath-2aad
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library.
+
+rp=rp2aad
+build1_configure_flags=
+build2_configure_flags=
+build3_package=rpathly
+remove_la=no
+
+. $srcdir/rpath-2_a
diff --git a/tests/havelib/rpath-2aba b/tests/havelib/rpath-2aba
new file mode 100755
index 0000000000..507e7de734
--- /dev/null
+++ b/tests/havelib/rpath-2aba
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library.
+# Each library installed with a different prefix.
+
+rp=rp2aba
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_package=rpathly
+remove_la=no
+
+. $srcdir/rpath-2_b
diff --git a/tests/havelib/rpath-2abb b/tests/havelib/rpath-2abb
new file mode 100755
index 0000000000..95ce66e0e8
--- /dev/null
+++ b/tests/havelib/rpath-2abb
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library.
+# Each library installed with a different prefix.
+
+rp=rp2abb
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_package=rpathly
+remove_la=no
+
+. $srcdir/rpath-2_b
diff --git a/tests/havelib/rpath-2abc b/tests/havelib/rpath-2abc
new file mode 100755
index 0000000000..39b39fc7dc
--- /dev/null
+++ b/tests/havelib/rpath-2abc
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library.
+# Each library installed with a different prefix.
+
+rp=rp2abc
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_package=rpathly
+remove_la=no
+
+. $srcdir/rpath-2_b
diff --git a/tests/havelib/rpath-2abd b/tests/havelib/rpath-2abd
new file mode 100755
index 0000000000..7182fb3643
--- /dev/null
+++ b/tests/havelib/rpath-2abd
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library.
+# Each library installed with a different prefix.
+
+rp=rp2abd
+build1_configure_flags=
+build2_configure_flags=
+build3_package=rpathly
+remove_la=no
+
+. $srcdir/rpath-2_b
diff --git a/tests/havelib/rpath-2baa b/tests/havelib/rpath-2baa
new file mode 100755
index 0000000000..916c6fdad8
--- /dev/null
+++ b/tests/havelib/rpath-2baa
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp2baa
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_package=rpathlyx
+remove_la=yes
+
+. $srcdir/rpath-2_a
diff --git a/tests/havelib/rpath-2bab b/tests/havelib/rpath-2bab
new file mode 100755
index 0000000000..00b35aa8d7
--- /dev/null
+++ b/tests/havelib/rpath-2bab
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp2bab
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_package=rpathlyx
+remove_la=yes
+
+. $srcdir/rpath-2_a
diff --git a/tests/havelib/rpath-2bac b/tests/havelib/rpath-2bac
new file mode 100755
index 0000000000..ba379b998f
--- /dev/null
+++ b/tests/havelib/rpath-2bac
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp2bac
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_package=rpathlyx
+remove_la=yes
+
+. $srcdir/rpath-2_a
diff --git a/tests/havelib/rpath-2bad b/tests/havelib/rpath-2bad
new file mode 100755
index 0000000000..0dabed0d37
--- /dev/null
+++ b/tests/havelib/rpath-2bad
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp2bad
+build1_configure_flags=
+build2_configure_flags=
+build3_package=rpathlyx
+remove_la=yes
+
+. $srcdir/rpath-2_a
diff --git a/tests/havelib/rpath-2bba b/tests/havelib/rpath-2bba
new file mode 100755
index 0000000000..64f8a648e1
--- /dev/null
+++ b/tests/havelib/rpath-2bba
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp2bba
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_package=rpathlyx
+remove_la=yes
+
+. $srcdir/rpath-2_b
diff --git a/tests/havelib/rpath-2bbb b/tests/havelib/rpath-2bbb
new file mode 100755
index 0000000000..259104771c
--- /dev/null
+++ b/tests/havelib/rpath-2bbb
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp2bbb
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_package=rpathlyx
+remove_la=yes
+
+. $srcdir/rpath-2_b
diff --git a/tests/havelib/rpath-2bbc b/tests/havelib/rpath-2bbc
new file mode 100755
index 0000000000..0423d3ef5f
--- /dev/null
+++ b/tests/havelib/rpath-2bbc
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp2bbc
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_package=rpathlyx
+remove_la=yes
+
+. $srcdir/rpath-2_b
diff --git a/tests/havelib/rpath-2bbd b/tests/havelib/rpath-2bbd
new file mode 100755
index 0000000000..921d014702
--- /dev/null
+++ b/tests/havelib/rpath-2bbd
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp2bbd
+build1_configure_flags=
+build2_configure_flags=
+build3_package=rpathlyx
+remove_la=yes
+
+. $srcdir/rpath-2_b
diff --git a/tests/havelib/rpath-3_a b/tests/havelib/rpath-3_a
new file mode 100644
index 0000000000..6ccc3f8683
--- /dev/null
+++ b/tests/havelib/rpath-3_a
@@ -0,0 +1,69 @@
+# Common portion of all rpath-3?a? tests.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+builddir=`pwd`
+global_top_auxdir=`cd "$top_srcdir"/build-aux && pwd`
+export global_top_auxdir
+
+tstdir='tst/dir'
+test -d $tstdir || { mkdir tst && mkdir $tstdir; }
+
+tmpfiles="$tmpfiles $rp-prefix"
+rm -rf $rp-prefix
+mkdir $rp-prefix
+
+tmpfiles="$tmpfiles $tstdir/$rp-build1"
+rm -rf $tstdir/$rp-build1
+mkdir $tstdir/$rp-build1
+(cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/$rp-build1 && tar xf -)
+(cd $tstdir/$rp-build1
+ ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix/lib/librpathx.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build2"
+rm -rf $tstdir/$rp-build2
+mkdir $tstdir/$rp-build2
+(cd $srcdir/rpathy && tar cf - *) | (cd $tstdir/$rp-build2 && tar xf -)
+(cd $tstdir/$rp-build2
+ ${CONFIG_SHELL-/bin/sh} ./configure $build2_configure_flags --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix/lib/librpathy.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build3"
+rm -rf $tstdir/$rp-build3
+mkdir $tstdir/$rp-build3
+(cd $srcdir/rpathz && tar cf - *) | (cd $tstdir/$rp-build3 && tar xf -)
+(cd $tstdir/$rp-build3
+ ${CONFIG_SHELL-/bin/sh} ./configure $build3_configure_flags --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix/lib/librpathz.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build4"
+rm -rf $tstdir/$rp-build4
+mkdir $tstdir/$rp-build4
+(cd $srcdir/$build4_package && tar cf - *) | (cd $tstdir/$rp-build4 && tar xf -)
+(cd $tstdir/$rp-build4
+ ${CONFIG_SHELL-/bin/sh} ./configure --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make check >> make.log
+)
+result=$?
+
+rm -rf $tmpfiles
+
+exit $result
diff --git a/tests/havelib/rpath-3_b b/tests/havelib/rpath-3_b
new file mode 100644
index 0000000000..71b4212881
--- /dev/null
+++ b/tests/havelib/rpath-3_b
@@ -0,0 +1,86 @@
+# Common portion of all rpath-3?b? tests.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+builddir=`pwd`
+global_top_auxdir=`cd "$top_srcdir"/build-aux && pwd`
+export global_top_auxdir
+
+tstdir='tst/dir'
+test -d $tstdir || { mkdir tst && mkdir $tstdir; }
+
+tmpfiles="$tmpfiles $rp-prefix1"
+rm -rf $rp-prefix1
+mkdir $rp-prefix1
+
+tmpfiles="$tmpfiles $rp-prefix2"
+rm -rf $rp-prefix2
+mkdir $rp-prefix2
+
+tmpfiles="$tmpfiles $rp-prefix3"
+rm -rf $rp-prefix3
+mkdir $rp-prefix3
+
+tmpfiles="$tmpfiles $rp-prefix"
+rm -rf $rp-prefix
+mkdir $rp-prefix
+
+tmpfiles="$tmpfiles $tstdir/$rp-build1"
+rm -rf $tstdir/$rp-build1
+mkdir $tstdir/$rp-build1
+(cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/$rp-build1 && tar xf -)
+(cd $tstdir/$rp-build1
+ ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --prefix=$builddir/$rp-prefix1 --libdir=$builddir/$rp-prefix1/$LIBDIRSTEM > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix1/lib/librpathx.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build2"
+rm -rf $tstdir/$rp-build2
+mkdir $tstdir/$rp-build2
+(cd $srcdir/rpathy && tar cf - *) | (cd $tstdir/$rp-build2 && tar xf -)
+(cd $tstdir/$rp-build2
+ ${CONFIG_SHELL-/bin/sh} ./configure $build2_configure_flags --prefix=$builddir/$rp-prefix2 --libdir=$builddir/$rp-prefix2/$LIBDIRSTEM --with-librpathx-prefix=$builddir/$rp-prefix1 > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix2/lib/librpathy.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build3"
+rm -rf $tstdir/$rp-build3
+mkdir $tstdir/$rp-build3
+(cd $srcdir/rpathz && tar cf - *) | (cd $tstdir/$rp-build3 && tar xf -)
+(cd $tstdir/$rp-build3
+ ${CONFIG_SHELL-/bin/sh} ./configure $build3_configure_flags --prefix=$builddir/$rp-prefix3 --libdir=$builddir/$rp-prefix3/$LIBDIRSTEM --with-librpathx-prefix=$builddir/$rp-prefix1 --with-librpathy-prefix=$builddir/$rp-prefix2 > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+if test $remove_la = yes; then
+ rm -f $rp-prefix3/lib/librpathz.la
+fi
+
+tmpfiles="$tmpfiles $tstdir/$rp-build4"
+rm -rf $tstdir/$rp-build4
+mkdir $tstdir/$rp-build4
+(cd $srcdir/$build4_package && tar cf - *) | (cd $tstdir/$rp-build4 && tar xf -)
+(cd $tstdir/$rp-build4
+ if test $remove_la = yes; then
+ build4_configure_flags="--with-librpathx-prefix=$builddir/$rp-prefix1 --with-librpathy-prefix=$builddir/$rp-prefix2"
+ else
+ build4_configure_flags=
+ fi
+ ${CONFIG_SHELL-/bin/sh} ./configure --prefix=$builddir/$rp-prefix --libdir=$builddir/$rp-prefix/$LIBDIRSTEM --with-librpathz-prefix=$builddir/$rp-prefix3 $build4_configure_flags > configure.log 2>&1
+ make > make.log 2>&1
+ make check >> make.log
+)
+result=$?
+
+rm -rf $tmpfiles
+
+exit $result
diff --git a/tests/havelib/rpath-3aaa b/tests/havelib/rpath-3aaa
new file mode 100755
index 0000000000..f353d80713
--- /dev/null
+++ b/tests/havelib/rpath-3aaa
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library,
+# and a static library depending on both.
+
+rp=rp3aaa
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_configure_flags=--disable-shared
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3aab b/tests/havelib/rpath-3aab
new file mode 100755
index 0000000000..93d157eaf3
--- /dev/null
+++ b/tests/havelib/rpath-3aab
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library,
+# and a static library depending on both.
+
+rp=rp3aab
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_configure_flags=--disable-shared
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3aac b/tests/havelib/rpath-3aac
new file mode 100755
index 0000000000..3d2d6cc4c3
--- /dev/null
+++ b/tests/havelib/rpath-3aac
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library,
+# and a static library depending on both.
+
+rp=rp3aac
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_configure_flags=--disable-shared
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3aad b/tests/havelib/rpath-3aad
new file mode 100755
index 0000000000..3e35be000b
--- /dev/null
+++ b/tests/havelib/rpath-3aad
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library,
+# and a static library depending on both.
+
+rp=rp3aad
+build1_configure_flags=
+build2_configure_flags=
+build3_configure_flags=--disable-shared
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3aae b/tests/havelib/rpath-3aae
new file mode 100755
index 0000000000..6bea00fa4c
--- /dev/null
+++ b/tests/havelib/rpath-3aae
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library,
+# and a shared library depending on both.
+
+rp=rp3aae
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_configure_flags=
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3aaf b/tests/havelib/rpath-3aaf
new file mode 100755
index 0000000000..102d4eb960
--- /dev/null
+++ b/tests/havelib/rpath-3aaf
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library,
+# and a shared library depending on both.
+
+rp=rp3aaf
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_configure_flags=
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3aag b/tests/havelib/rpath-3aag
new file mode 100755
index 0000000000..e7f636829c
--- /dev/null
+++ b/tests/havelib/rpath-3aag
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library,
+# and a shared library depending on both.
+
+rp=rp3aag
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_configure_flags=
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3aah b/tests/havelib/rpath-3aah
new file mode 100755
index 0000000000..21677ee377
--- /dev/null
+++ b/tests/havelib/rpath-3aah
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library,
+# and a shared library depending on both.
+
+rp=rp3aah
+build1_configure_flags=
+build2_configure_flags=
+build3_configure_flags=
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3aba b/tests/havelib/rpath-3aba
new file mode 100755
index 0000000000..020cf211d0
--- /dev/null
+++ b/tests/havelib/rpath-3aba
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library,
+# and a static library depending on both.
+# Each library installed with a different prefix.
+
+rp=rp3aba
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_configure_flags=--disable-shared
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3abb b/tests/havelib/rpath-3abb
new file mode 100755
index 0000000000..89542f69c2
--- /dev/null
+++ b/tests/havelib/rpath-3abb
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library,
+# and a static library depending on both.
+# Each library installed with a different prefix.
+
+rp=rp3abb
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_configure_flags=--disable-shared
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3abc b/tests/havelib/rpath-3abc
new file mode 100755
index 0000000000..9fd9896194
--- /dev/null
+++ b/tests/havelib/rpath-3abc
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library,
+# and a static library depending on both.
+# Each library installed with a different prefix.
+
+rp=rp3abc
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_configure_flags=--disable-shared
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3abd b/tests/havelib/rpath-3abd
new file mode 100755
index 0000000000..ecf34b9f54
--- /dev/null
+++ b/tests/havelib/rpath-3abd
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library,
+# and a static library depending on both.
+# Each library installed with a different prefix.
+
+rp=rp3abd
+build1_configure_flags=
+build2_configure_flags=
+build3_configure_flags=--disable-shared
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3abe b/tests/havelib/rpath-3abe
new file mode 100755
index 0000000000..2590a85a20
--- /dev/null
+++ b/tests/havelib/rpath-3abe
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library,
+# and a shared library depending on both.
+# Each library installed with a different prefix.
+
+rp=rp3abe
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_configure_flags=
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3abf b/tests/havelib/rpath-3abf
new file mode 100755
index 0000000000..860c77ae85
--- /dev/null
+++ b/tests/havelib/rpath-3abf
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library,
+# and a shared library depending on both.
+# Each library installed with a different prefix.
+
+rp=rp3abf
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_configure_flags=
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3abg b/tests/havelib/rpath-3abg
new file mode 100755
index 0000000000..56c6db5946
--- /dev/null
+++ b/tests/havelib/rpath-3abg
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library,
+# and a shared library depending on both.
+# Each library installed with a different prefix.
+
+rp=rp3abg
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_configure_flags=
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3abh b/tests/havelib/rpath-3abh
new file mode 100755
index 0000000000..c088dbd55b
--- /dev/null
+++ b/tests/havelib/rpath-3abh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library,
+# and a shared library depending on both.
+# Each library installed with a different prefix.
+
+rp=rp3abh
+build1_configure_flags=
+build2_configure_flags=
+build3_configure_flags=
+build4_package=rpathlz
+remove_la=no
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3baa b/tests/havelib/rpath-3baa
new file mode 100755
index 0000000000..721d4f4f80
--- /dev/null
+++ b/tests/havelib/rpath-3baa
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library,
+# and a static library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp3baa
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_configure_flags=--disable-shared
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3bab b/tests/havelib/rpath-3bab
new file mode 100755
index 0000000000..ed5038b722
--- /dev/null
+++ b/tests/havelib/rpath-3bab
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library,
+# and a static library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp3bab
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_configure_flags=--disable-shared
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3bac b/tests/havelib/rpath-3bac
new file mode 100755
index 0000000000..27f5b49c2f
--- /dev/null
+++ b/tests/havelib/rpath-3bac
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library,
+# and a static library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp3bac
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_configure_flags=--disable-shared
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3bad b/tests/havelib/rpath-3bad
new file mode 100755
index 0000000000..95b3c2f5b4
--- /dev/null
+++ b/tests/havelib/rpath-3bad
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library,
+# and a static library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp3bad
+build1_configure_flags=
+build2_configure_flags=
+build3_configure_flags=--disable-shared
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3bae b/tests/havelib/rpath-3bae
new file mode 100755
index 0000000000..c90beb3629
--- /dev/null
+++ b/tests/havelib/rpath-3bae
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library,
+# and a shared library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp3bae
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_configure_flags=
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3baf b/tests/havelib/rpath-3baf
new file mode 100755
index 0000000000..57b906d9c3
--- /dev/null
+++ b/tests/havelib/rpath-3baf
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library,
+# and a shared library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp3baf
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_configure_flags=
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3bag b/tests/havelib/rpath-3bag
new file mode 100755
index 0000000000..52a83a3a8d
--- /dev/null
+++ b/tests/havelib/rpath-3bag
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library,
+# and a shared library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp3bag
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_configure_flags=
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3bah b/tests/havelib/rpath-3bah
new file mode 100755
index 0000000000..2ec95194ae
--- /dev/null
+++ b/tests/havelib/rpath-3bah
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library,
+# and a shared library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+
+rp=rp3bah
+build1_configure_flags=
+build2_configure_flags=
+build3_configure_flags=
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_a
diff --git a/tests/havelib/rpath-3bba b/tests/havelib/rpath-3bba
new file mode 100755
index 0000000000..33fa2d9b5e
--- /dev/null
+++ b/tests/havelib/rpath-3bba
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library,
+# and a static library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp3bba
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_configure_flags=--disable-shared
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3bbb b/tests/havelib/rpath-3bbb
new file mode 100755
index 0000000000..32dcde7e57
--- /dev/null
+++ b/tests/havelib/rpath-3bbb
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library,
+# and a static library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp3bbb
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_configure_flags=--disable-shared
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3bbc b/tests/havelib/rpath-3bbc
new file mode 100755
index 0000000000..f37295a2f6
--- /dev/null
+++ b/tests/havelib/rpath-3bbc
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library,
+# and a static library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp3bbc
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_configure_flags=--disable-shared
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3bbd b/tests/havelib/rpath-3bbd
new file mode 100755
index 0000000000..9d5faef465
--- /dev/null
+++ b/tests/havelib/rpath-3bbd
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library,
+# and a static library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp3bbd
+build1_configure_flags=
+build2_configure_flags=
+build3_configure_flags=--disable-shared
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3bbe b/tests/havelib/rpath-3bbe
new file mode 100755
index 0000000000..3e2d96dc65
--- /dev/null
+++ b/tests/havelib/rpath-3bbe
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a static library,
+# and a shared library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp3bbe
+build1_configure_flags=--disable-shared
+build2_configure_flags=--disable-shared
+build3_configure_flags=
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3bbf b/tests/havelib/rpath-3bbf
new file mode 100755
index 0000000000..b03f0db79c
--- /dev/null
+++ b/tests/havelib/rpath-3bbf
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a static library depending on a shared library,
+# and a shared library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp3bbf
+build1_configure_flags=
+build2_configure_flags=--disable-shared
+build3_configure_flags=
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3bbg b/tests/havelib/rpath-3bbg
new file mode 100755
index 0000000000..0a6476c139
--- /dev/null
+++ b/tests/havelib/rpath-3bbg
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a static library,
+# and a shared library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp3bbg
+build1_configure_flags=--disable-shared
+build2_configure_flags=
+build3_configure_flags=
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpath-3bbh b/tests/havelib/rpath-3bbh
new file mode 100755
index 0000000000..02c0bda477
--- /dev/null
+++ b/tests/havelib/rpath-3bbh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Test config.rpath and AC_LIB_LINKFLAGS macro.
+# With dependencies: a shared library depending on a shared library,
+# and a shared library depending on both.
+# No libtool *.la files are assumed, dependencies given as AC_LIB_LINKFLAGS
+# argument instead.
+# Each library installed with a different prefix.
+
+rp=rp3bbh
+build1_configure_flags=
+build2_configure_flags=
+build3_configure_flags=
+build4_package=rpathlzyx
+remove_la=yes
+
+. $srcdir/rpath-3_b
diff --git a/tests/havelib/rpathcfg.sh b/tests/havelib/rpathcfg.sh
new file mode 100755
index 0000000000..89a98a7ab1
--- /dev/null
+++ b/tests/havelib/rpathcfg.sh
@@ -0,0 +1,232 @@
+#!/bin/sh
+# Prints information for maintaining config.rpath.
+
+# The caller should set the environment variables
+# top_srcdir, srcdir, CONFIG_SHELL, CC, GCC, LDFLAGS, LD, LIBDIRSTEM, with_gnu_ld, host.
+
+if test -f $top_srcdir/build-aux/config.rpath; then
+ build_aux_dir=$top_srcdir/build-aux
+else
+ build_aux_dir=$top_srcdir/../build-aux
+fi
+
+echo "=============== rpathcfg for $host ==============="
+echo
+echo "--------------- config.rpath output ---------------"
+${CONFIG_SHELL-/bin/sh} $build_aux_dir/config.rpath "$host" | sed -e 's/^acl_cv_//'
+echo "--------------- experimentally determined ---------------"
+builddir=`pwd`
+global_top_auxdir=`cd "$top_srcdir"/build-aux && pwd`
+export global_top_auxdir
+
+tstdir='tst/dir'
+test -d $tstdir || { mkdir tst && mkdir $tstdir; }
+
+rm -rf tstprefix $tstdir/build tstlib
+
+eval `${CONFIG_SHELL-/bin/sh} $build_aux_dir/config.rpath "$host" | grep '^acl_cv_wl='`
+wl="$acl_cv_wl"
+
+# Static library suffix (normally "a").
+mkdir tstprefix
+mkdir $tstdir/build
+(cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/build && tar xf -)
+(cd $tstdir/build
+ ${CONFIG_SHELL-/bin/sh} ./configure --disable-shared --prefix=$builddir/tstprefix --libdir=$builddir/tstprefix/${LIBDIRSTEM-lib} > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+rm -rf $tstdir/build
+libext=
+cd tstprefix/lib
+for f in *; do
+ case $f in
+ *.la) ;;
+ *[0-9]) ;;
+ *) libext=`echo $f | sed -e 's/^.*\.//'`;;
+ esac
+ if test -n "$libext"; then
+ break
+ fi
+done
+cd ../..
+rm -rf tstprefix
+
+# Shared library suffix (normally "so").
+mkdir tstprefix
+mkdir $tstdir/build
+(cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/build && tar xf -)
+(cd $tstdir/build
+ ${CONFIG_SHELL-/bin/sh} ./configure --disable-static --prefix=$builddir/tstprefix --libdir=$builddir/tstprefix/${LIBDIRSTEM-lib} > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+rm -rf $tstdir/build
+shlibext=
+cd tstprefix/lib || exit 1
+for f in *; do
+ case $f in
+ *.la) ;;
+ *[0-9]) ;;
+ *) shlibext=`echo $f | sed -e 's/^.*\.//'`;;
+ esac
+ if test -n "$shlibext"; then
+ break
+ fi
+done
+cd ../..
+rm -rf tstprefix
+
+# Prepare hardcoding tests.
+mkdir tstprefix
+mkdir $tstdir/build
+(cd $srcdir/rpathx && tar cf - *) | (cd $tstdir/build && tar xf -)
+(cd $tstdir/build
+ ${CONFIG_SHELL-/bin/sh} ./configure --disable-static --prefix=$builddir/tstprefix --libdir=$builddir/tstprefix/${LIBDIRSTEM-lib} > configure.log 2>&1
+ make > make.log 2>&1
+ make install > install.log 2>&1
+)
+rm -rf $tstdir/build
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=
+for spec in \
+ '-L$libdir' \
+ '-R$libdir' \
+ '-rpath $libdir' '${wl}-rpath ${wl}$libdir' \
+ '${wl}+b ${wl}$libdir' \
+ '${wl}-R $libdir:/usr/lib:/lib' \
+ '${wl}-blibpath:$libdir:/usr/lib:/lib' \
+ '${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' \
+ ; do
+ mv tstprefix/lib tstlib
+ libdir=`pwd`/tstprefix/lib
+ eval flag=\"$spec\"
+ echo 1>&2
+ echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2
+ $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out
+ if test $? = 0; then
+ mv tstlib tstprefix/lib
+ echo "ok, running created a.out." 1>&2
+ if ./a.out; then
+ hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec$spec
+"
+ fi
+ else
+ mv tstlib tstprefix/lib
+ fi
+ rm -f a.out
+done
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=
+if test -n "$hardcode_libdir_flag_spec"; then
+ spec=`echo "$hardcode_libdir_flag_spec" | sed -e '2,$d'`
+ # Try with multiple -rpath flags.
+ mv tstprefix/lib tstlib
+ libdir=`pwd`/tstprefix/lib
+ eval flag1=\"$spec\"
+ libdir=/tmp
+ eval flag2=\"$spec\"
+ echo 1>&2
+ echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out" 1>&2
+ $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out
+ if test $? = 0; then
+ mv tstlib tstprefix/lib
+ echo "ok, running created a.out." 1>&2
+ if ./a.out; then
+ hardcode_libdir_separator=NONE
+ fi
+ else
+ mv tstlib tstprefix/lib
+ fi
+ rm -f a.out
+ if test -z "$hardcode_libdir_separator"; then
+ # Try with a single -rpath flag.
+ mv tstprefix/lib tstlib
+ libdir=`pwd`/tstprefix/lib:/tmp
+ eval flag=\"$spec\"
+ echo 1>&2
+ echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2
+ $CC $LDFLAGS $srcdir/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out
+ if test $? = 0; then
+ mv tstlib tstprefix/lib
+ echo "ok, running created a.out." 1>&2
+ if ./a.out; then
+ hardcode_libdir_separator=:
+ fi
+ else
+ mv tstlib tstprefix/lib
+ fi
+ rm -f a.out
+ fi
+ if test -z "$hardcode_libdir_separator"; then
+ echo "hardcode_libdir_separator test failed!" 1>&2
+ else
+ if test "$hardcode_libdir_separator" = NONE; then
+ hardcode_libdir_separator=
+ fi
+ fi
+fi
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+echo 1>&2
+echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out" 1>&2
+$CC $LDFLAGS $srcdir/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out
+if test $? = 0; then
+ echo "ok, running created a.out." 1>&2
+ if ./a.out; then
+ hardcode_direct=yes
+ fi
+fi
+rm -f a.out
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+echo 1>&2
+echo "$CC $LDFLAGS $srcdir/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out" 1>&2
+$CC $LDFLAGS $srcdir/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out
+if test $? = 0; then
+ echo "ok, running created a.out." 1>&2
+ if ./a.out; then
+ hardcode_minus_L=yes
+ fi
+fi
+rm -f a.out
+
+# Clean up.
+rm -rf tstprefix $tstdir
+
+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"`
+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"`
+
+cat <<EOF
+
+# 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
diff --git a/tests/havelib/rpathlx/Makefile.am b/tests/havelib/rpathlx/Makefile.am
new file mode 100644
index 0000000000..da6a22c516
--- /dev/null
+++ b/tests/havelib/rpathlx/Makefile.am
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = 1.5 foreign no-dependencies
+bin_PROGRAMS = usex
+usex_SOURCES = usex.c
+LDADD = @LIBRPATHX@
+
+check: all
+ ./usex
diff --git a/tests/havelib/rpathlx/configure.ac b/tests/havelib/rpathlx/configure.ac
new file mode 100644
index 0000000000..0ccd1429e9
--- /dev/null
+++ b/tests/havelib/rpathlx/configure.ac
@@ -0,0 +1,24 @@
+dnl Configuration of a program that links with librpathx.
+dnl
+dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_INIT([configure.ac])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AM_INIT_AUTOMAKE([gettext_rpathlx], [0])
+AC_PROG_CC
+AC_LIB_LINKFLAGS([rpathx])
+AC_SUBST([global_top_auxdir])
+AC_OUTPUT([Makefile])
diff --git a/tests/havelib/rpathlx/usex.c b/tests/havelib/rpathlx/usex.c
new file mode 100644
index 0000000000..d09b111766
--- /dev/null
+++ b/tests/havelib/rpathlx/usex.c
@@ -0,0 +1,2 @@
+extern int rpathx_value (void);
+int main () { return !(rpathx_value () == 5); }
diff --git a/tests/havelib/rpathly/Makefile.am b/tests/havelib/rpathly/Makefile.am
new file mode 100644
index 0000000000..44812b5bcb
--- /dev/null
+++ b/tests/havelib/rpathly/Makefile.am
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = 1.5 foreign no-dependencies
+bin_PROGRAMS = usey
+usey_SOURCES = usey.c
+LDADD = @LIBRPATHY@
+
+check: all
+ ./usey
diff --git a/tests/havelib/rpathly/configure.ac b/tests/havelib/rpathly/configure.ac
new file mode 100644
index 0000000000..379431f677
--- /dev/null
+++ b/tests/havelib/rpathly/configure.ac
@@ -0,0 +1,24 @@
+dnl Configuration of a program that links with librpathy.
+dnl
+dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_INIT([configure.ac])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AM_INIT_AUTOMAKE([gettext_rpathly], [0])
+AC_PROG_CC
+AC_LIB_LINKFLAGS([rpathy])
+AC_SUBST([global_top_auxdir])
+AC_OUTPUT([Makefile])
diff --git a/tests/havelib/rpathly/usey.c b/tests/havelib/rpathly/usey.c
new file mode 100644
index 0000000000..9fff7871ba
--- /dev/null
+++ b/tests/havelib/rpathly/usey.c
@@ -0,0 +1,2 @@
+extern int rpathy_value (void);
+int main () { return !(rpathy_value () == 57); }
diff --git a/tests/havelib/rpathlyx/Makefile.am b/tests/havelib/rpathlyx/Makefile.am
new file mode 100644
index 0000000000..44812b5bcb
--- /dev/null
+++ b/tests/havelib/rpathlyx/Makefile.am
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = 1.5 foreign no-dependencies
+bin_PROGRAMS = usey
+usey_SOURCES = usey.c
+LDADD = @LIBRPATHY@
+
+check: all
+ ./usey
diff --git a/tests/havelib/rpathlyx/configure.ac b/tests/havelib/rpathlyx/configure.ac
new file mode 100644
index 0000000000..18f817bbdf
--- /dev/null
+++ b/tests/havelib/rpathlyx/configure.ac
@@ -0,0 +1,26 @@
+dnl Configuration of a program that links with librpathy.
+dnl
+dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_INIT([configure.ac])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AM_INIT_AUTOMAKE([gettext_rpathlyx], [0])
+AC_PROG_CC
+AC_LIB_LINKFLAGS([rpathx])
+AC_LIB_LINKFLAGS([rpathy],[rpathx])
+LIBRPATHY="$LIBRPATHY $LIBRPATHX"
+AC_SUBST([global_top_auxdir])
+AC_OUTPUT([Makefile])
diff --git a/tests/havelib/rpathlyx/usey.c b/tests/havelib/rpathlyx/usey.c
new file mode 100644
index 0000000000..9fff7871ba
--- /dev/null
+++ b/tests/havelib/rpathlyx/usey.c
@@ -0,0 +1,2 @@
+extern int rpathy_value (void);
+int main () { return !(rpathy_value () == 57); }
diff --git a/tests/havelib/rpathlz/Makefile.am b/tests/havelib/rpathlz/Makefile.am
new file mode 100644
index 0000000000..ff0e6027ad
--- /dev/null
+++ b/tests/havelib/rpathlz/Makefile.am
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = 1.5 foreign no-dependencies
+bin_PROGRAMS = usez
+usez_SOURCES = usez.c
+LDADD = @LIBRPATHZ@
+
+check: all
+ ./usez
diff --git a/tests/havelib/rpathlz/configure.ac b/tests/havelib/rpathlz/configure.ac
new file mode 100644
index 0000000000..3b9c99f65e
--- /dev/null
+++ b/tests/havelib/rpathlz/configure.ac
@@ -0,0 +1,24 @@
+dnl Configuration of a program that links with librpathz.
+dnl
+dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_INIT([configure.ac])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AM_INIT_AUTOMAKE([gettext_rpathlz], [0])
+AC_PROG_CC
+AC_LIB_LINKFLAGS([rpathz])
+AC_SUBST([global_top_auxdir])
+AC_OUTPUT([Makefile])
diff --git a/tests/havelib/rpathlz/usez.c b/tests/havelib/rpathlz/usez.c
new file mode 100644
index 0000000000..18d86897b0
--- /dev/null
+++ b/tests/havelib/rpathlz/usez.c
@@ -0,0 +1,2 @@
+extern int rpathz_value (void);
+int main () { return !(rpathz_value () == 5171); }
diff --git a/tests/havelib/rpathlzyx/Makefile.am b/tests/havelib/rpathlzyx/Makefile.am
new file mode 100644
index 0000000000..ff0e6027ad
--- /dev/null
+++ b/tests/havelib/rpathlzyx/Makefile.am
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = 1.5 foreign no-dependencies
+bin_PROGRAMS = usez
+usez_SOURCES = usez.c
+LDADD = @LIBRPATHZ@
+
+check: all
+ ./usez
diff --git a/tests/havelib/rpathlzyx/configure.ac b/tests/havelib/rpathlzyx/configure.ac
new file mode 100644
index 0000000000..29c45a33c1
--- /dev/null
+++ b/tests/havelib/rpathlzyx/configure.ac
@@ -0,0 +1,27 @@
+dnl Configuration of a program that links with librpathz.
+dnl
+dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_INIT([configure.ac])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AM_INIT_AUTOMAKE([gettext_rpathlzyx], [0])
+AC_PROG_CC
+AC_LIB_LINKFLAGS([rpathx])
+AC_LIB_LINKFLAGS([rpathy],[rpathx])
+AC_LIB_LINKFLAGS([rpathz],[rpathx rpathy])
+LIBRPATHZ="$LIBRPATHZ $LIBRPATHY $LIBRPATHX"
+AC_SUBST([global_top_auxdir])
+AC_OUTPUT([Makefile])
diff --git a/tests/havelib/rpathlzyx/usez.c b/tests/havelib/rpathlzyx/usez.c
new file mode 100644
index 0000000000..18d86897b0
--- /dev/null
+++ b/tests/havelib/rpathlzyx/usez.c
@@ -0,0 +1,2 @@
+extern int rpathz_value (void);
+int main () { return !(rpathz_value () == 5171); }
diff --git a/tests/havelib/rpathx/Makefile.am b/tests/havelib/rpathx/Makefile.am
new file mode 100644
index 0000000000..69b4cc9873
--- /dev/null
+++ b/tests/havelib/rpathx/Makefile.am
@@ -0,0 +1,4 @@
+AUTOMAKE_OPTIONS = 1.5 foreign no-dependencies
+lib_LTLIBRARIES = librpathx.la
+librpathx_la_SOURCES = rpathx.c
+librpathx_la_LDFLAGS = -lc -no-undefined
diff --git a/tests/havelib/rpathx/configure.ac b/tests/havelib/rpathx/configure.ac
new file mode 100644
index 0000000000..c781d1622f
--- /dev/null
+++ b/tests/havelib/rpathx/configure.ac
@@ -0,0 +1,25 @@
+dnl Configuration of librpathx.
+dnl
+dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_INIT([configure.ac])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AC_CONFIG_MACRO_DIR([../ltm4])
+AM_INIT_AUTOMAKE([gettext_rpathx], [0])
+AC_PROG_CC
+AM_PROG_LIBTOOL
+AC_SUBST([global_top_auxdir])
+AC_OUTPUT([Makefile])
diff --git a/tests/havelib/rpathx/rpathx.c b/tests/havelib/rpathx/rpathx.c
new file mode 100644
index 0000000000..fd1a3772ff
--- /dev/null
+++ b/tests/havelib/rpathx/rpathx.c
@@ -0,0 +1 @@
+int rpathx_value () { return 5; }
diff --git a/tests/havelib/rpathy/Makefile.am b/tests/havelib/rpathy/Makefile.am
new file mode 100644
index 0000000000..6b44f37f64
--- /dev/null
+++ b/tests/havelib/rpathy/Makefile.am
@@ -0,0 +1,4 @@
+AUTOMAKE_OPTIONS = 1.5 foreign no-dependencies
+lib_LTLIBRARIES = librpathy.la
+librpathy_la_SOURCES = rpathy.c
+librpathy_la_LDFLAGS = @LTLIBRPATHX@ -lc -no-undefined
diff --git a/tests/havelib/rpathy/configure.ac b/tests/havelib/rpathy/configure.ac
new file mode 100644
index 0000000000..0df1fe66bb
--- /dev/null
+++ b/tests/havelib/rpathy/configure.ac
@@ -0,0 +1,26 @@
+dnl Configuration of librpathy that depends on librpathx.
+dnl
+dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_INIT([configure.ac])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AC_CONFIG_MACRO_DIR([../ltm4])
+AM_INIT_AUTOMAKE([gettext_rpathy], [0])
+AC_PROG_CC
+AM_PROG_LIBTOOL
+AC_LIB_LINKFLAGS([rpathx])
+AC_SUBST([global_top_auxdir])
+AC_OUTPUT([Makefile])
diff --git a/tests/havelib/rpathy/rpathy.c b/tests/havelib/rpathy/rpathy.c
new file mode 100644
index 0000000000..42514bf1af
--- /dev/null
+++ b/tests/havelib/rpathy/rpathy.c
@@ -0,0 +1,2 @@
+extern int rpathx_value (void);
+int rpathy_value () { return 10 * rpathx_value () + 7; }
diff --git a/tests/havelib/rpathz/Makefile.am b/tests/havelib/rpathz/Makefile.am
new file mode 100644
index 0000000000..675dda261c
--- /dev/null
+++ b/tests/havelib/rpathz/Makefile.am
@@ -0,0 +1,4 @@
+AUTOMAKE_OPTIONS = 1.5 foreign no-dependencies
+lib_LTLIBRARIES = librpathz.la
+librpathz_la_SOURCES = rpathz.c
+librpathz_la_LDFLAGS = @LTLIBRPATHX@ @LTLIBRPATHY@ -lc -no-undefined
diff --git a/tests/havelib/rpathz/configure.ac b/tests/havelib/rpathz/configure.ac
new file mode 100644
index 0000000000..e03e2546e0
--- /dev/null
+++ b/tests/havelib/rpathz/configure.ac
@@ -0,0 +1,27 @@
+dnl Configuration of librpathz that depends on librpathx and librpathy.
+dnl
+dnl Copyright (C) 2002-2003, 2005, 2010 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AC_INIT([configure.ac])
+AC_CONFIG_AUX_DIR([../../../build-aux])
+AC_CONFIG_MACRO_DIR([../ltm4])
+AM_INIT_AUTOMAKE([gettext_rpathz], [0])
+AC_PROG_CC
+AM_PROG_LIBTOOL
+AC_LIB_LINKFLAGS([rpathx])
+AC_LIB_LINKFLAGS([rpathy],[rpathx])
+AC_SUBST([global_top_auxdir])
+AC_OUTPUT([Makefile])
diff --git a/tests/havelib/rpathz/rpathz.c b/tests/havelib/rpathz/rpathz.c
new file mode 100644
index 0000000000..da34af1c87
--- /dev/null
+++ b/tests/havelib/rpathz/rpathz.c
@@ -0,0 +1,3 @@
+extern int rpathx_value (void);
+extern int rpathy_value (void);
+int rpathz_value () { return 1000 * rpathx_value () + 3 * rpathy_value (); }