changeset 13108:9bcc8c4d90d6

Tests for module 'havelib', moved here from GNU gettext.
author Bruno Haible <bruno@clisp.org>
date Fri, 02 Apr 2010 18:09:43 +0200
parents ed335ebb55f0
children 18e03869bbd8
files ChangeLog modules/havelib-tests tests/havelib/Makefile.am tests/havelib/README tests/havelib/rpath-1 tests/havelib/rpath-1a tests/havelib/rpath-1b tests/havelib/rpath-2_a tests/havelib/rpath-2_b tests/havelib/rpath-2aaa tests/havelib/rpath-2aab tests/havelib/rpath-2aac tests/havelib/rpath-2aad tests/havelib/rpath-2aba tests/havelib/rpath-2abb tests/havelib/rpath-2abc tests/havelib/rpath-2abd tests/havelib/rpath-2baa tests/havelib/rpath-2bab tests/havelib/rpath-2bac tests/havelib/rpath-2bad tests/havelib/rpath-2bba tests/havelib/rpath-2bbb tests/havelib/rpath-2bbc tests/havelib/rpath-2bbd tests/havelib/rpath-3_a tests/havelib/rpath-3_b tests/havelib/rpath-3aaa tests/havelib/rpath-3aab tests/havelib/rpath-3aac tests/havelib/rpath-3aad tests/havelib/rpath-3aae tests/havelib/rpath-3aaf tests/havelib/rpath-3aag tests/havelib/rpath-3aah tests/havelib/rpath-3aba tests/havelib/rpath-3abb tests/havelib/rpath-3abc tests/havelib/rpath-3abd tests/havelib/rpath-3abe tests/havelib/rpath-3abf tests/havelib/rpath-3abg tests/havelib/rpath-3abh tests/havelib/rpath-3baa tests/havelib/rpath-3bab tests/havelib/rpath-3bac tests/havelib/rpath-3bad tests/havelib/rpath-3bae tests/havelib/rpath-3baf tests/havelib/rpath-3bag tests/havelib/rpath-3bah tests/havelib/rpath-3bba tests/havelib/rpath-3bbb tests/havelib/rpath-3bbc tests/havelib/rpath-3bbd tests/havelib/rpath-3bbe tests/havelib/rpath-3bbf tests/havelib/rpath-3bbg tests/havelib/rpath-3bbh tests/havelib/rpathcfg.sh tests/havelib/rpathlx/Makefile.am tests/havelib/rpathlx/configure.ac tests/havelib/rpathlx/usex.c tests/havelib/rpathly/Makefile.am tests/havelib/rpathly/configure.ac tests/havelib/rpathly/usey.c tests/havelib/rpathlyx/Makefile.am tests/havelib/rpathlyx/configure.ac tests/havelib/rpathlyx/usey.c tests/havelib/rpathlz/Makefile.am tests/havelib/rpathlz/configure.ac tests/havelib/rpathlz/usez.c tests/havelib/rpathlzyx/Makefile.am tests/havelib/rpathlzyx/configure.ac tests/havelib/rpathlzyx/usez.c tests/havelib/rpathx/Makefile.am tests/havelib/rpathx/configure.ac tests/havelib/rpathx/rpathx.c tests/havelib/rpathy/Makefile.am tests/havelib/rpathy/configure.ac tests/havelib/rpathy/rpathy.c tests/havelib/rpathz/Makefile.am tests/havelib/rpathz/configure.ac tests/havelib/rpathz/rpathz.c
diffstat 84 files changed, 2120 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,122 @@
+2010-04-02  Bruno Haible  <bruno@clisp.org>
+
+	Tests for module 'havelib', moved here from GNU gettext.
+	* modules/havelib-tests: New file, from gettext/autoconf-lib-link with
+	modifications.
+	* tests/havelib/README: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/Makefile.am: New file, from gettext/autoconf-lib-link
+	with modifications.
+	* tests/havelib/rpath-1: New file, from gettext/autoconf-lib-link with
+	modifications.
+	* tests/havelib/rpath-1a: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-1b: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2_a: New file, from gettext/autoconf-lib-link
+	with modifications.
+	* tests/havelib/rpath-2_b: New file, from gettext/autoconf-lib-link
+	with modifications.
+	* tests/havelib/rpath-2aaa: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2aab: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2aac: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2aad: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2aba: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2abb: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2abc: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2abd: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2baa: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2bab: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2bac: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2bad: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2bba: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2bbb: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2bbc: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-2bbd: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3_a: New file, from gettext/autoconf-lib-link
+	with modifications.
+	* tests/havelib/rpath-3_b: New file, from gettext/autoconf-lib-link
+	with modifications.
+	* tests/havelib/rpath-3aaa: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3aab: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3aac: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3aad: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3aae: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3aaf: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3aag: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3aah: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3aba: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3abb: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3abc: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3abd: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3abe: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3abf: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3abg: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3abh: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3baa: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bab: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bac: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bad: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bae: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3baf: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bag: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bah: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bba: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bbb: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bbc: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bbd: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bbe: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bbf: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bbg: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpath-3bbh: New file, from gettext/autoconf-lib-link.
+	* tests/havelib/rpathx/rpathx.c: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathx/Makefile.am: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathx/configure.ac: New file, from
+	gettext/autoconf-lib-link with modifications.
+	* tests/havelib/rpathy/rpathy.c: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathy/Makefile.am: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathy/configure.ac: New file, from
+	gettext/autoconf-lib-link with modifications.
+	* tests/havelib/rpathz/rpathz.c: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathz/Makefile.am: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathz/configure.ac: New file, from
+	gettext/autoconf-lib-link with modifications.
+	* tests/havelib/rpathlx/usex.c: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathlx/Makefile.am: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathlx/configure.ac: New file, from
+	gettext/autoconf-lib-link with modifications.
+	* tests/havelib/rpathly/usey.c: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathly/Makefile.am: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathly/configure.ac: New file, from
+	gettext/autoconf-lib-link with modifications.
+	* tests/havelib/rpathlz/usez.c: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathlz/Makefile.am: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathlz/configure.ac: New file, from
+	gettext/autoconf-lib-link with modifications.
+	* tests/havelib/rpathlyx/usey.c: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathlyx/Makefile.am: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathlyx/configure.ac: New file, from
+	gettext/autoconf-lib-link with modifications.
+	* tests/havelib/rpathlzyx/usez.c: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathlzyx/Makefile.am: New file, from
+	gettext/autoconf-lib-link.
+	* tests/havelib/rpathlzyx/configure.ac: New file, from
+	gettext/autoconf-lib-link with modifications.
+	* tests/havelib/rpathcfg.sh: New file, from gettext/autoconf-lib-link
+	with modifications.
+
 2010-04-02  Bruno Haible  <bruno@clisp.org>
 
 	gnulib-tool: Create distributed built sources also for the tests.
new file mode 100644
--- /dev/null
+++ b/modules/havelib-tests
@@ -0,0 +1,297 @@
+Status:
+longrunning-test
+unportable-test
+
+Files:
+tests/havelib/README
+tests/havelib/Makefile.am
+tests/havelib/rpath-1
+tests/havelib/rpath-1a
+tests/havelib/rpath-1b
+tests/havelib/rpath-2_a
+tests/havelib/rpath-2_b
+tests/havelib/rpath-2aaa
+tests/havelib/rpath-2aab
+tests/havelib/rpath-2aac
+tests/havelib/rpath-2aad
+tests/havelib/rpath-2aba
+tests/havelib/rpath-2abb
+tests/havelib/rpath-2abc
+tests/havelib/rpath-2abd
+tests/havelib/rpath-2baa
+tests/havelib/rpath-2bab
+tests/havelib/rpath-2bac
+tests/havelib/rpath-2bad
+tests/havelib/rpath-2bba
+tests/havelib/rpath-2bbb
+tests/havelib/rpath-2bbc
+tests/havelib/rpath-2bbd
+tests/havelib/rpath-3_a
+tests/havelib/rpath-3_b
+tests/havelib/rpath-3aaa
+tests/havelib/rpath-3aab
+tests/havelib/rpath-3aac
+tests/havelib/rpath-3aad
+tests/havelib/rpath-3aae
+tests/havelib/rpath-3aaf
+tests/havelib/rpath-3aag
+tests/havelib/rpath-3aah
+tests/havelib/rpath-3aba
+tests/havelib/rpath-3abb
+tests/havelib/rpath-3abc
+tests/havelib/rpath-3abd
+tests/havelib/rpath-3abe
+tests/havelib/rpath-3abf
+tests/havelib/rpath-3abg
+tests/havelib/rpath-3abh
+tests/havelib/rpath-3baa
+tests/havelib/rpath-3bab
+tests/havelib/rpath-3bac
+tests/havelib/rpath-3bad
+tests/havelib/rpath-3bae
+tests/havelib/rpath-3baf
+tests/havelib/rpath-3bag
+tests/havelib/rpath-3bah
+tests/havelib/rpath-3bba
+tests/havelib/rpath-3bbb
+tests/havelib/rpath-3bbc
+tests/havelib/rpath-3bbd
+tests/havelib/rpath-3bbe
+tests/havelib/rpath-3bbf
+tests/havelib/rpath-3bbg
+tests/havelib/rpath-3bbh
+tests/havelib/rpathx/rpathx.c
+tests/havelib/rpathx/Makefile.am
+tests/havelib/rpathx/configure.ac
+tests/havelib/rpathy/rpathy.c
+tests/havelib/rpathy/Makefile.am
+tests/havelib/rpathy/configure.ac
+tests/havelib/rpathz/rpathz.c
+tests/havelib/rpathz/Makefile.am
+tests/havelib/rpathz/configure.ac
+tests/havelib/rpathlx/usex.c
+tests/havelib/rpathlx/Makefile.am
+tests/havelib/rpathlx/configure.ac
+tests/havelib/rpathly/usey.c
+tests/havelib/rpathly/Makefile.am
+tests/havelib/rpathly/configure.ac
+tests/havelib/rpathlz/usez.c
+tests/havelib/rpathlz/Makefile.am
+tests/havelib/rpathlz/configure.ac
+tests/havelib/rpathlyx/usey.c
+tests/havelib/rpathlyx/Makefile.am
+tests/havelib/rpathlyx/configure.ac
+tests/havelib/rpathlzyx/usez.c
+tests/havelib/rpathlzyx/Makefile.am
+tests/havelib/rpathlzyx/configure.ac
+tests/havelib/rpathcfg.sh
+
+Depends-on:
+
+configure.ac:
+HAVELIB_M4_BASE="${gl_m4_base}"
+AC_SUBST([HAVELIB_M4_BASE])
+
+AC_LIB_PREPARE_MULTILIB
+LIBDIRSTEM=$acl_libdirstem
+AC_SUBST([LIBDIRSTEM])
+
+dnl Checks for tests/rpathcfg.
+AC_SUBST([GCC])
+AC_SUBST([LD])
+AC_SUBST([with_gnu_ld])
+
+AC_CONFIG_FILES([havelib/Makefile])
+
+Makefile.am:
+SUBDIRS += havelib
+
+
+# These variables can be overridden on the 'make' command line.
+ACLOCAL = aclocal
+AUTOCONF = autoconf
+AUTOMAKE = automake
+LIBTOOLIZE = libtoolize
+
+HAVELIB_GENERATED_FILES = \
+  havelib/Makefile.in \
+  havelib/rpathx/Makefile.in \
+  havelib/rpathx/aclocal.m4 \
+  havelib/rpathx/configure \
+  havelib/rpathy/Makefile.in \
+  havelib/rpathy/aclocal.m4 \
+  havelib/rpathy/configure \
+  havelib/rpathz/Makefile.in \
+  havelib/rpathz/aclocal.m4 \
+  havelib/rpathz/configure \
+  havelib/rpathlx/Makefile.in \
+  havelib/rpathlx/aclocal.m4 \
+  havelib/rpathlx/configure \
+  havelib/rpathly/Makefile.in \
+  havelib/rpathly/aclocal.m4 \
+  havelib/rpathly/configure \
+  havelib/rpathlz/Makefile.in \
+  havelib/rpathlz/aclocal.m4 \
+  havelib/rpathlz/configure \
+  havelib/rpathlyx/Makefile.in \
+  havelib/rpathlyx/aclocal.m4 \
+  havelib/rpathlyx/configure \
+  havelib/rpathlzyx/Makefile.in \
+  havelib/rpathlzyx/aclocal.m4 \
+  havelib/rpathlzyx/configure
+
+BUILT_SOURCES += \
+  havelib/Makefile.in \
+  havelib/rpathx/Makefile.in \
+  havelib/rpathx/aclocal.m4 \
+  havelib/rpathx/configure \
+  havelib/rpathy/Makefile.in \
+  havelib/rpathy/aclocal.m4 \
+  havelib/rpathy/configure \
+  havelib/rpathz/Makefile.in \
+  havelib/rpathz/aclocal.m4 \
+  havelib/rpathz/configure \
+  havelib/rpathlx/Makefile.in \
+  havelib/rpathlx/aclocal.m4 \
+  havelib/rpathlx/configure \
+  havelib/rpathly/Makefile.in \
+  havelib/rpathly/aclocal.m4 \
+  havelib/rpathly/configure \
+  havelib/rpathlz/Makefile.in \
+  havelib/rpathlz/aclocal.m4 \
+  havelib/rpathlz/configure \
+  havelib/rpathlyx/Makefile.in \
+  havelib/rpathlyx/aclocal.m4 \
+  havelib/rpathlyx/configure \
+  havelib/rpathlzyx/Makefile.in \
+  havelib/rpathlzyx/aclocal.m4 \
+  havelib/rpathlzyx/configure
+
+$(srcdir)/havelib/Makefile.in: $(srcdir)/havelib/Makefile.am
+	cd $(srcdir) && $(AUTOMAKE) havelib/Makefile
+
+# Subdirectories with separate autoconfiguration.
+
+$(srcdir)/havelib/rpathx/Makefile.in: $(srcdir)/havelib/rpathx/Makefile.am $(srcdir)/havelib/rpathx/configure.ac $(srcdir)/havelib/rpathx/aclocal.m4
+	cd $(srcdir)/havelib/rpathx && $(AUTOMAKE) Makefile
+$(srcdir)/havelib/rpathx/aclocal.m4: $(srcdir)/havelib/rpathx/configure.ac
+	cd $(srcdir)/havelib/rpathx && $(LIBTOOLIZE) --copy
+	abs_m4_dir=`cd $(top_srcdir)/@HAVELIB_M4_BASE@ && pwd`; cd $(srcdir)/havelib/rpathx && $(ACLOCAL) -I "$$abs_m4_dir" -I `cd ../ltm4 && pwd`
+$(srcdir)/havelib/rpathx/configure: $(srcdir)/havelib/rpathx/configure.ac $(srcdir)/havelib/rpathx/aclocal.m4
+	cd $(srcdir)/havelib/rpathx && $(AUTOCONF)
+
+$(srcdir)/havelib/rpathy/Makefile.in: $(srcdir)/havelib/rpathy/Makefile.am $(srcdir)/havelib/rpathy/configure.ac $(srcdir)/havelib/rpathy/aclocal.m4
+	cd $(srcdir)/havelib/rpathy && $(AUTOMAKE) Makefile
+$(srcdir)/havelib/rpathy/aclocal.m4: $(srcdir)/havelib/rpathy/configure.ac $(top_srcdir)/@HAVELIB_M4_BASE@/lib-link.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-prefix.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-ld.m4
+	cd $(srcdir)/havelib/rpathy && $(LIBTOOLIZE) --copy
+	abs_m4_dir=`cd $(top_srcdir)/@HAVELIB_M4_BASE@ && pwd`; cd $(srcdir)/havelib/rpathy && $(ACLOCAL) -I "$$abs_m4_dir" -I `cd ../ltm4 && pwd`
+$(srcdir)/havelib/rpathy/configure: $(srcdir)/havelib/rpathy/configure.ac $(srcdir)/havelib/rpathy/aclocal.m4
+	cd $(srcdir)/havelib/rpathy && $(AUTOCONF)
+
+$(srcdir)/havelib/rpathz/Makefile.in: $(srcdir)/havelib/rpathz/Makefile.am $(srcdir)/havelib/rpathz/configure.ac $(srcdir)/havelib/rpathz/aclocal.m4
+	cd $(srcdir)/havelib/rpathz && $(AUTOMAKE) Makefile
+$(srcdir)/havelib/rpathz/aclocal.m4: $(srcdir)/havelib/rpathz/configure.ac $(top_srcdir)/@HAVELIB_M4_BASE@/lib-link.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-prefix.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-ld.m4
+	cd $(srcdir)/havelib/rpathz && $(LIBTOOLIZE) --copy
+	abs_m4_dir=`cd $(top_srcdir)/@HAVELIB_M4_BASE@ && pwd`; cd $(srcdir)/havelib/rpathz && $(ACLOCAL) -I "$$abs_m4_dir" -I `cd ../ltm4 && pwd`
+$(srcdir)/havelib/rpathz/configure: $(srcdir)/havelib/rpathz/configure.ac $(srcdir)/havelib/rpathz/aclocal.m4
+	cd $(srcdir)/havelib/rpathz && $(AUTOCONF)
+
+$(srcdir)/havelib/rpathlx/Makefile.in: $(srcdir)/havelib/rpathlx/Makefile.am $(srcdir)/havelib/rpathlx/configure.ac $(srcdir)/havelib/rpathlx/aclocal.m4
+	cd $(srcdir)/havelib/rpathlx && $(AUTOMAKE) Makefile
+$(srcdir)/havelib/rpathlx/aclocal.m4: $(srcdir)/havelib/rpathlx/configure.ac $(top_srcdir)/@HAVELIB_M4_BASE@/lib-link.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-prefix.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-ld.m4
+	abs_m4_dir=`cd $(top_srcdir)/@HAVELIB_M4_BASE@ && pwd`; cd $(srcdir)/havelib/rpathlx && $(ACLOCAL) -I "$$abs_m4_dir"
+$(srcdir)/havelib/rpathlx/configure: $(srcdir)/havelib/rpathlx/configure.ac $(srcdir)/havelib/rpathlx/aclocal.m4
+	cd $(srcdir)/havelib/rpathlx && $(AUTOCONF)
+
+$(srcdir)/havelib/rpathly/Makefile.in: $(srcdir)/havelib/rpathly/Makefile.am $(srcdir)/havelib/rpathly/configure.ac $(srcdir)/havelib/rpathly/aclocal.m4
+	cd $(srcdir)/havelib/rpathly && $(AUTOMAKE) Makefile
+$(srcdir)/havelib/rpathly/aclocal.m4: $(srcdir)/havelib/rpathly/configure.ac $(top_srcdir)/@HAVELIB_M4_BASE@/lib-link.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-prefix.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-ld.m4
+	abs_m4_dir=`cd $(top_srcdir)/@HAVELIB_M4_BASE@ && pwd`; cd $(srcdir)/havelib/rpathly && $(ACLOCAL) -I "$$abs_m4_dir"
+$(srcdir)/havelib/rpathly/configure: $(srcdir)/havelib/rpathly/configure.ac $(srcdir)/havelib/rpathly/aclocal.m4
+	cd $(srcdir)/havelib/rpathly && $(AUTOCONF)
+
+$(srcdir)/havelib/rpathlyx/Makefile.in: $(srcdir)/havelib/rpathlyx/Makefile.am $(srcdir)/havelib/rpathlyx/configure.ac $(srcdir)/havelib/rpathlyx/aclocal.m4
+	cd $(srcdir)/havelib/rpathlyx && $(AUTOMAKE) Makefile
+$(srcdir)/havelib/rpathlyx/aclocal.m4: $(srcdir)/havelib/rpathlyx/configure.ac $(top_srcdir)/@HAVELIB_M4_BASE@/lib-link.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-prefix.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-ld.m4
+	abs_m4_dir=`cd $(top_srcdir)/@HAVELIB_M4_BASE@ && pwd`; cd $(srcdir)/havelib/rpathlyx && $(ACLOCAL) -I "$$abs_m4_dir"
+$(srcdir)/havelib/rpathlyx/configure: $(srcdir)/havelib/rpathlyx/configure.ac $(srcdir)/havelib/rpathlyx/aclocal.m4
+	cd $(srcdir)/havelib/rpathlyx && $(AUTOCONF)
+
+$(srcdir)/havelib/rpathlz/Makefile.in: $(srcdir)/havelib/rpathlz/Makefile.am $(srcdir)/havelib/rpathlz/configure.ac $(srcdir)/havelib/rpathlz/aclocal.m4
+	cd $(srcdir)/havelib/rpathlz && $(AUTOMAKE) Makefile
+$(srcdir)/havelib/rpathlz/aclocal.m4: $(srcdir)/havelib/rpathlz/configure.ac $(top_srcdir)/@HAVELIB_M4_BASE@/lib-link.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-prefix.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-ld.m4
+	abs_m4_dir=`cd $(top_srcdir)/@HAVELIB_M4_BASE@ && pwd`; cd $(srcdir)/havelib/rpathlz && $(ACLOCAL) -I "$$abs_m4_dir"
+$(srcdir)/havelib/rpathlz/configure: $(srcdir)/havelib/rpathlz/configure.ac $(srcdir)/havelib/rpathlz/aclocal.m4
+	cd $(srcdir)/havelib/rpathlz && $(AUTOCONF)
+
+$(srcdir)/havelib/rpathlzyx/Makefile.in: $(srcdir)/havelib/rpathlzyx/Makefile.am $(srcdir)/havelib/rpathlzyx/configure.ac $(srcdir)/havelib/rpathlzyx/aclocal.m4
+	cd $(srcdir)/havelib/rpathlzyx && $(AUTOMAKE) Makefile
+$(srcdir)/havelib/rpathlzyx/aclocal.m4: $(srcdir)/havelib/rpathlzyx/configure.ac $(top_srcdir)/@HAVELIB_M4_BASE@/lib-link.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-prefix.m4 $(top_srcdir)/@HAVELIB_M4_BASE@/lib-ld.m4
+	abs_m4_dir=`cd $(top_srcdir)/@HAVELIB_M4_BASE@ && pwd`; cd $(srcdir)/havelib/rpathlzyx && $(ACLOCAL) -I "$$abs_m4_dir"
+$(srcdir)/havelib/rpathlzyx/configure: $(srcdir)/havelib/rpathlzyx/configure.ac $(srcdir)/havelib/rpathlzyx/aclocal.m4
+	cd $(srcdir)/havelib/rpathlzyx && $(AUTOCONF)
+
+MAINTAINERCLEANFILES += $(HAVELIB_GENERATED_FILES)
+EXTRA_DIST           += $(HAVELIB_GENERATED_FILES)
+
+# Libtool's infrastructure is installed in
+# - $(top_srcdir)/build-aux/ltmain.sh, which gets distributed,
+# - $(srcdir)/havelib/ltm4/*.m4, which don't need to be distributed, because
+#   they are included in each havelib/rpath*/aclocal.m4 file.
+
+EXTRA_DIST += $(top_srcdir)/build-aux/ltmain.sh
+
+mostlyclean-local: mostlyclean-local-havelib
+
+mostlyclean-local-havelib:
+	rm -rf $(srcdir)/havelib/ltm4
+
+
+# The AC_CONFIG_AUX_DIR argument in the havelib/rpath*/configure.ac files is
+# interpreted in two different contexts:
+#   1. at "make distrib" time, when we call automake, relative to
+#      SRCDIR/havelib/rpath*/,
+#   2. at "make check" time, when the directory is copied and configured,
+#      relative to BUILDDIR/havelib/tst/dir/rp-*/.
+# We choose this argument to be '../../../build-aux', for case 1, and therefore
+# we need to make a local copy of the build-aux directory, for case 2.
+
+HAVELIB_COPIED_FILES = \
+  havelib/build-aux/config.guess \
+  havelib/build-aux/config.sub \
+  havelib/build-aux/install-sh \
+  havelib/build-aux/ltmain.sh \
+  havelib/build-aux/missing \
+  havelib/build-aux/config.rpath
+
+all-local: $(HAVELIB_COPIED_FILES)
+
+havelib/build-aux-dir:
+	test -d havelib/build-aux || mkdir havelib/build-aux
+	touch havelib/build-aux-dir
+
+havelib/build-aux/config.guess: $(top_srcdir)/build-aux/config.guess havelib/build-aux-dir
+	cp $(top_srcdir)/build-aux/config.guess havelib/build-aux/config.guess
+
+havelib/build-aux/config.sub: $(top_srcdir)/build-aux/config.sub havelib/build-aux-dir
+	cp $(top_srcdir)/build-aux/config.sub havelib/build-aux/config.sub
+
+havelib/build-aux/install-sh: $(top_srcdir)/build-aux/install-sh havelib/build-aux-dir
+	cp $(top_srcdir)/build-aux/install-sh havelib/build-aux/install-sh
+
+havelib/build-aux/ltmain.sh: $(top_srcdir)/build-aux/ltmain.sh havelib/build-aux-dir
+	cp $(top_srcdir)/build-aux/ltmain.sh havelib/build-aux/ltmain.sh
+
+havelib/build-aux/missing: $(top_srcdir)/build-aux/missing havelib/build-aux-dir
+	cp $(top_srcdir)/build-aux/missing havelib/build-aux/missing
+
+havelib/build-aux/config.rpath: $(top_srcdir)/build-aux/config.rpath havelib/build-aux-dir
+	cp $(top_srcdir)/build-aux/config.rpath havelib/build-aux/config.rpath
+
+DISTCLEANFILES += $(HAVELIB_COPIED_FILES)
+
+distclean-local: distclean-local-havelib
+
+distclean-local-havelib:
+	rm -rf havelib/build-aux havelib/build-aux-dir
+.PHONY: distclean-local-havelib
new file mode 100644
--- /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
new file mode 100644
--- /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.
new file mode 100644
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100755
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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])
new file mode 100644
--- /dev/null
+++ b/tests/havelib/rpathlx/usex.c
@@ -0,0 +1,2 @@
+extern int rpathx_value (void);
+int main () { return !(rpathx_value () == 5); }
new file mode 100644
--- /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
new file mode 100644
--- /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])
new file mode 100644
--- /dev/null
+++ b/tests/havelib/rpathly/usey.c
@@ -0,0 +1,2 @@
+extern int rpathy_value (void);
+int main () { return !(rpathy_value () == 57); }
new file mode 100644
--- /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
new file mode 100644
--- /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])
new file mode 100644
--- /dev/null
+++ b/tests/havelib/rpathlyx/usey.c
@@ -0,0 +1,2 @@
+extern int rpathy_value (void);
+int main () { return !(rpathy_value () == 57); }
new file mode 100644
--- /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
new file mode 100644
--- /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])
new file mode 100644
--- /dev/null
+++ b/tests/havelib/rpathlz/usez.c
@@ -0,0 +1,2 @@
+extern int rpathz_value (void);
+int main () { return !(rpathz_value () == 5171); }
new file mode 100644
--- /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
new file mode 100644
--- /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])
new file mode 100644
--- /dev/null
+++ b/tests/havelib/rpathlzyx/usez.c
@@ -0,0 +1,2 @@
+extern int rpathz_value (void);
+int main () { return !(rpathz_value () == 5171); }
new file mode 100644
--- /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
new file mode 100644
--- /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])
new file mode 100644
--- /dev/null
+++ b/tests/havelib/rpathx/rpathx.c
@@ -0,0 +1,1 @@
+int rpathx_value () { return 5; }
new file mode 100644
--- /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
new file mode 100644
--- /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])
new file mode 100644
--- /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; }
new file mode 100644
--- /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
new file mode 100644
--- /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])
new file mode 100644
--- /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 (); }