From: Bruno Haible Date: Mon, 21 Jan 2002 13:33:42 +0000 (+0000) Subject: New tests for config.rpath and lib-link.m4. X-Git-Tag: v0.11~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b0d4c9156417a9519b895e8fda7935f0d86c2c3;p=thirdparty%2Fgettext.git New tests for config.rpath and lib-link.m4. --- diff --git a/ChangeLog b/ChangeLog index 22599b67e..b73c7663b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-01-20 Bruno Haible + + * Makefile.am (CONFIGURES_RPATH*): New variables. + ($(srcdir)/tests/rpath*/Makefile.in): New rules. + ($(srcdir)/tests/rpath*/aclocal.m4): New rules. + ($(srcdir)/tests/rpath*/configure): New rules. + (SUBCONFIGURES): New variable. + (subconfigures): New target. + (distdir): Depend on subconfigures. + * configure.in: Propagate GCC, LD, with_gnu_ld to Makefiles. + Postprocess Makefile because of distdir dependency. + 2002-01-12 Bruno Haible * INSTALL: Add instructions for using Intel icc. diff --git a/Makefile.am b/Makefile.am index 60695e7d8..f3ce1952c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,3 +50,54 @@ pdf: html: cd doc && $(MAKE) html + + +# Subdirectories with separate autoconfiguration. + +CONFIGURES_RPATHX = $(srcdir)/tests/rpathx/Makefile.in $(srcdir)/tests/rpathx/aclocal.m4 $(srcdir)/tests/rpathx/configure +$(srcdir)/tests/rpathx/Makefile.in: $(srcdir)/tests/rpathx/Makefile.am $(srcdir)/tests/rpathx/configure.in + cd $(srcdir)/tests/rpathx && automake Makefile +$(srcdir)/tests/rpathx/aclocal.m4: $(srcdir)/tests/rpathx/configure.in + cd $(srcdir)/tests/rpathx && aclocal -I ../../m4 +$(srcdir)/tests/rpathx/configure: $(srcdir)/tests/rpathx/configure.in $(srcdir)/tests/rpathx/aclocal.m4 + cd $(srcdir)/tests/rpathx && autoconf + +CONFIGURES_RPATHY = $(srcdir)/tests/rpathy/Makefile.in $(srcdir)/tests/rpathy/aclocal.m4 $(srcdir)/tests/rpathy/configure +$(srcdir)/tests/rpathy/Makefile.in: $(srcdir)/tests/rpathy/Makefile.am $(srcdir)/tests/rpathy/configure.in + cd $(srcdir)/tests/rpathy && automake Makefile +$(srcdir)/tests/rpathy/aclocal.m4: $(srcdir)/tests/rpathy/configure.in + cd $(srcdir)/tests/rpathy && aclocal -I ../../m4 +$(srcdir)/tests/rpathy/configure: $(srcdir)/tests/rpathy/configure.in $(srcdir)/tests/rpathy/aclocal.m4 + cd $(srcdir)/tests/rpathy && autoconf + +CONFIGURES_RPATHLX = $(srcdir)/tests/rpathlx/Makefile.in $(srcdir)/tests/rpathlx/aclocal.m4 $(srcdir)/tests/rpathlx/configure +$(srcdir)/tests/rpathlx/Makefile.in: $(srcdir)/tests/rpathlx/Makefile.am $(srcdir)/tests/rpathlx/configure.in + cd $(srcdir)/tests/rpathlx && automake Makefile +$(srcdir)/tests/rpathlx/aclocal.m4: $(srcdir)/tests/rpathlx/configure.in $(srcdir)/m4/lib-link.m4 $(srcdir)/m4/lib-prefix.m4 $(srcdir)/m4/lib-ld.m4 + cd $(srcdir)/tests/rpathlx && aclocal -I ../../m4 +$(srcdir)/tests/rpathlx/configure: $(srcdir)/tests/rpathlx/configure.in $(srcdir)/tests/rpathlx/aclocal.m4 + cd $(srcdir)/tests/rpathlx && autoconf + +CONFIGURES_RPATHLY = $(srcdir)/tests/rpathly/Makefile.in $(srcdir)/tests/rpathly/aclocal.m4 $(srcdir)/tests/rpathly/configure +$(srcdir)/tests/rpathly/Makefile.in: $(srcdir)/tests/rpathly/Makefile.am $(srcdir)/tests/rpathly/configure.in + cd $(srcdir)/tests/rpathly && automake Makefile +$(srcdir)/tests/rpathly/aclocal.m4: $(srcdir)/tests/rpathly/configure.in $(srcdir)/m4/lib-link.m4 $(srcdir)/m4/lib-prefix.m4 $(srcdir)/m4/lib-ld.m4 + cd $(srcdir)/tests/rpathly && aclocal -I ../../m4 +$(srcdir)/tests/rpathly/configure: $(srcdir)/tests/rpathly/configure.in $(srcdir)/tests/rpathly/aclocal.m4 + cd $(srcdir)/tests/rpathly && autoconf + +CONFIGURES_RPATHLYX = $(srcdir)/tests/rpathlyx/Makefile.in $(srcdir)/tests/rpathlyx/aclocal.m4 $(srcdir)/tests/rpathlyx/configure +$(srcdir)/tests/rpathlyx/Makefile.in: $(srcdir)/tests/rpathlyx/Makefile.am $(srcdir)/tests/rpathlyx/configure.in + cd $(srcdir)/tests/rpathlyx && automake Makefile +$(srcdir)/tests/rpathlyx/aclocal.m4: $(srcdir)/tests/rpathlyx/configure.in $(srcdir)/m4/lib-link.m4 $(srcdir)/m4/lib-prefix.m4 $(srcdir)/m4/lib-ld.m4 + cd $(srcdir)/tests/rpathlyx && aclocal -I ../../m4 +$(srcdir)/tests/rpathlyx/configure: $(srcdir)/tests/rpathlyx/configure.in $(srcdir)/tests/rpathlyx/aclocal.m4 + cd $(srcdir)/tests/rpathlyx && autoconf + +SUBCONFIGURES = $(CONFIGURES_RPATHX) $(CONFIGURES_RPATHY) $(CONFIGURES_RPATHLX) $(CONFIGURES_RPATHLY) $(CONFIGURES_RPATHLYX) + +subconfigures: $(SUBCONFIGURES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: subconfigures + diff --git a/configure.in b/configure.in index 1ae4dd0b8..dd533dd90 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13) AC_INIT(src/msgfmt.c) -AM_INIT_AUTOMAKE(gettext, 0.11-pre5) +AM_INIT_AUTOMAKE(gettext, 0.11-pre5+) RELEASE_DATE=2001-05-23 dnl in "date +%Y-%m-%d" format AM_CONFIG_HEADER(config.h) @@ -127,6 +127,11 @@ if test "$CXX" != ":"; then fi fi +dnl Checks for tests/rpathcfg. +AC_SUBST(GCC) +AC_SUBST(LD) +AC_SUBST(with_gnu_ld) + dnl Generate the version information file in the intl/ directory. test -d intl || mkdir intl echo "GNU gettext library from $PACKAGE-$VERSION" > intl/VERSION @@ -164,7 +169,7 @@ AC_OUTPUT([Makefile \ mv $m.tmp $m done dnl Fix an automake-1.5 bug. - for m in doc/Makefile; do + for m in Makefile doc/Makefile; do sed -e 's,^#distdir:,distdir:,' < $m > $m.tmp mv $m.tmp $m done diff --git a/tests/ChangeLog b/tests/ChangeLog index 1f6ec64fd..3e4bff3c4 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,20 @@ +2002-01-20 Bruno Haible + + * rpathx: New subdirectory. + * rpathy: New subdirectory. + * rpathlx: New subdirectory. + * rpathly: New subdirectory. + * rpathlyx: New subdirectory. + * rpath-1[ab], rpath-1: New files. + * rpath-2[ab][ab][abcd], rpath-2_[ab], rpath-2.README: New files. + * rpathcfg.sh: New file. + * Makefile.am (TESTS): Add rpath-1[ab], rpath-2[ab][ab][abcd]. + (EXTRA_DIST): Add rpathx/*, rpathy/*, rpathlx/*, rpathly/*, rpathlyx/*, + rpath-2.README, rpathcfg.sh. + (TESTS_ENVIRONMENT): Also set CONFIG_SHELL. + (rpathcfg): New target. + (MOSTLYCLEANFILES): New variable. + 2002-01-12 Bruno Haible * lang-c: Include config.h, needed by xsetenv.h. diff --git a/tests/Makefile.am b/tests/Makefile.am index 3f9457f44..6a13fe18f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -54,9 +54,26 @@ TESTS = gettext-1 gettext-2 \ format-pascal-1 format-pascal-2 \ format-ycp-1 format-ycp-2 \ plural-1 plural-2 \ - lang-c lang-c++ lang-objc lang-clisp lang-elisp lang-librep lang-java lang-pascal lang-ycp lang-po lang-rst + lang-c lang-c++ lang-objc lang-clisp lang-elisp lang-librep lang-java lang-pascal lang-ycp lang-po lang-rst \ + rpath-1a rpath-1b \ + rpath-2aaa rpath-2aab rpath-2aac rpath-2aad \ + rpath-2aba rpath-2abb rpath-2abc rpath-2abd \ + rpath-2baa rpath-2bab rpath-2bac rpath-2bad \ + rpath-2bba rpath-2bbb rpath-2bbc rpath-2bbd -EXTRA_DIST = $(TESTS) test.mo xg-test1.ok.po mex-test2.ok msguniq-a.in msguniq-a.out +EXTRA_DIST = $(TESTS) \ + test.mo xg-test1.ok.po mex-test2.ok msguniq-a.in msguniq-a.out \ + rpathx/configure.in rpathx/aclocal.m4 rpathx/configure \ + rpathx/Makefile.am rpathx/Makefile.in rpathx/rpathx.c \ + rpathy/configure.in rpathy/aclocal.m4 rpathy/configure \ + rpathy/Makefile.am rpathy/Makefile.in rpathy/rpathy.c \ + rpathlx/configure.in rpathlx/aclocal.m4 rpathlx/configure \ + rpathlx/Makefile.am rpathlx/Makefile.in rpathlx/usex.c \ + rpathly/configure.in rpathly/aclocal.m4 rpathly/configure \ + rpathly/Makefile.am rpathly/Makefile.in rpathly/usey.c \ + rpathlyx/configure.in rpathlyx/aclocal.m4 rpathlyx/configure \ + rpathlyx/Makefile.am rpathlyx/Makefile.in rpathlyx/usey.c \ + rpath-1 rpath-2_a rpath-2_b rpath-2.README rpathcfg.sh XGETTEXT = ../src/xgettext @@ -84,6 +101,7 @@ TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) PATH=.:../src:$$PATH \ CPPFLAGS='@CPPFLAGS@' LDFLAGS='@LDFLAGS@' \ INTLLIBS='@INTLLIBS@' \ TESTJAVA='@TESTJAVA@' \ + CONFIG_SHELL='$(SHELL)' \ $(SHELL) xg-test1.ok.po: $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c \ @@ -93,7 +111,7 @@ xg-test1.ok.po: $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c \ $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c \ $(top_srcdir)/src/gettext.c -# Two auxiliary programs used by the tests. +# Three auxiliary programs used by the tests. INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/intl DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@) @@ -106,3 +124,14 @@ tstngettext_SOURCES = tstngettext.c setlocale.c tstngettext_LDADD = ../lib/libgettextlib.la $(LDADD) cake_SOURCES = plural-1-prg.c setlocale.c cake_LDADD = ../lib/libgettextlib.la $(LDADD) + +# Help maintaining config.rpath. +rpathcfg: rpathcfg.sh + top_srcdir=$(top_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 diff --git a/tests/rpath-1 b/tests/rpath-1 new file mode 100644 index 000000000..bf186be7b --- /dev/null +++ b/tests/rpath-1 @@ -0,0 +1,37 @@ +# Common portion of all rpath-1* tests. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +builddir=`pwd` +global_top_srcdir=`cd "$top_srcdir" && pwd` +export global_top_srcdir + +tmpfiles="$tmpfiles $rp-prefix" +rm -rf $rp-prefix +mkdir $rp-prefix + +tmpfiles="$tmpfiles $rp-build1" +rm -rf $rp-build1 +mkdir $rp-build1 +(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd $rp-build1 && tar xf -) +(cd $rp-build1 + ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --prefix=$builddir/$rp-prefix > configure.log 2>&1 + make > make.log 2>&1 + make install > install.log 2>&1 +) + +tmpfiles="$tmpfiles $rp-build2" +rm -rf $rp-build2 +mkdir $rp-build2 +(cd $top_srcdir/tests/rpathlx && tar cf - *) | (cd $rp-build2 && tar xf -) +(cd $rp-build2 + ${CONFIG_SHELL-/bin/sh} ./configure --prefix=$builddir/$rp-prefix > configure.log 2>&1 + make > make.log 2>&1 + make check >> make.log +) +result=$? + +rm -rf $tmpfiles + +exit $result diff --git a/tests/rpath-1a b/tests/rpath-1a new file mode 100755 index 000000000..413a48c68 --- /dev/null +++ b/tests/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/rpath-1b b/tests/rpath-1b new file mode 100755 index 000000000..3170d81a4 --- /dev/null +++ b/tests/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/rpath-2.README b/tests/rpath-2.README new file mode 100644 index 000000000..d8abc054b --- /dev/null +++ b/tests/rpath-2.README @@ -0,0 +1,32 @@ +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. + +The rpath-2* tests are sensitive to + - incomplete shared library in the system, + - bugs in libtool that creates the shared libraries, + - bugs in lib-link.m4. + +Known failures: + +* FreeBSD4: rpath-2bad, rpath-2bbd fail because of a combination of a bug + in libtool (the libtool command line for creating librpathy.la contains + a -rpath command, but the resulting gcc command line doesn't) and a bug + in FreeBSD's runtime loader (it searches for librpathx.so.0 twice, and + in the second search it not only ignores the success in the first search + but also the rpath given in the executable). + diff --git a/tests/rpath-2_a b/tests/rpath-2_a new file mode 100644 index 000000000..cbe0e7eb8 --- /dev/null +++ b/tests/rpath-2_a @@ -0,0 +1,53 @@ +# Common portion of all rpath-2?a? tests. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +builddir=`pwd` +global_top_srcdir=`cd "$top_srcdir" && pwd` +export global_top_srcdir + +tmpfiles="$tmpfiles $rp-prefix" +rm -rf $rp-prefix +mkdir $rp-prefix + +tmpfiles="$tmpfiles $rp-build1" +rm -rf $rp-build1 +mkdir $rp-build1 +(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd $rp-build1 && tar xf -) +(cd $rp-build1 + ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --prefix=$builddir/$rp-prefix > 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 $rp-build2" +rm -rf $rp-build2 +mkdir $rp-build2 +(cd $top_srcdir/tests/rpathy && tar cf - *) | (cd $rp-build2 && tar xf -) +(cd $rp-build2 + ${CONFIG_SHELL-/bin/sh} ./configure $build2_configure_flags --prefix=$builddir/$rp-prefix > 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 $rp-build3" +rm -rf $rp-build3 +mkdir $rp-build3 +(cd $top_srcdir/tests/$build3_package && tar cf - *) | (cd $rp-build3 && tar xf -) +(cd $rp-build3 + ${CONFIG_SHELL-/bin/sh} ./configure --prefix=$builddir/$rp-prefix > configure.log 2>&1 + make > make.log 2>&1 + make check >> make.log +) +result=$? + +rm -rf $tmpfiles + +exit $result diff --git a/tests/rpath-2_b b/tests/rpath-2_b new file mode 100644 index 000000000..da6a3c48c --- /dev/null +++ b/tests/rpath-2_b @@ -0,0 +1,66 @@ +# Common portion of all rpath-2?b? tests. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +builddir=`pwd` +global_top_srcdir=`cd "$top_srcdir" && pwd` +export global_top_srcdir + +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 $rp-build1" +rm -rf $rp-build1 +mkdir $rp-build1 +(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd $rp-build1 && tar xf -) +(cd $rp-build1 + ${CONFIG_SHELL-/bin/sh} ./configure $build1_configure_flags --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-prefix1/lib/librpathx.la +fi + +tmpfiles="$tmpfiles $rp-build2" +rm -rf $rp-build2 +mkdir $rp-build2 +(cd $top_srcdir/tests/rpathy && tar cf - *) | (cd $rp-build2 && tar xf -) +(cd $rp-build2 + ${CONFIG_SHELL-/bin/sh} ./configure $build2_configure_flags --prefix=$builddir/$rp-prefix2 --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 $rp-build3" +rm -rf $rp-build3 +mkdir $rp-build3 +(cd $top_srcdir/tests/$build3_package && tar cf - *) | (cd $rp-build3 && tar xf -) +(cd $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 --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/rpath-2aaa b/tests/rpath-2aaa new file mode 100755 index 000000000..1c69777e1 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_a diff --git a/tests/rpath-2aab b/tests/rpath-2aab new file mode 100755 index 000000000..c06cff144 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_a diff --git a/tests/rpath-2aac b/tests/rpath-2aac new file mode 100755 index 000000000..08779b625 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_a diff --git a/tests/rpath-2aad b/tests/rpath-2aad new file mode 100755 index 000000000..749a24304 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_a diff --git a/tests/rpath-2aba b/tests/rpath-2aba new file mode 100755 index 000000000..dd3986025 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_b diff --git a/tests/rpath-2abb b/tests/rpath-2abb new file mode 100755 index 000000000..86b37b24d --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_b diff --git a/tests/rpath-2abc b/tests/rpath-2abc new file mode 100755 index 000000000..b38d21d6b --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_b diff --git a/tests/rpath-2abd b/tests/rpath-2abd new file mode 100755 index 000000000..3c54053f1 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_b diff --git a/tests/rpath-2baa b/tests/rpath-2baa new file mode 100755 index 000000000..b056e7f87 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_a diff --git a/tests/rpath-2bab b/tests/rpath-2bab new file mode 100755 index 000000000..57bdd2592 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_a diff --git a/tests/rpath-2bac b/tests/rpath-2bac new file mode 100755 index 000000000..a4d9f5c35 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_a diff --git a/tests/rpath-2bad b/tests/rpath-2bad new file mode 100755 index 000000000..8768b9c5b --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_a diff --git a/tests/rpath-2bba b/tests/rpath-2bba new file mode 100755 index 000000000..13069eec9 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_b diff --git a/tests/rpath-2bbb b/tests/rpath-2bbb new file mode 100755 index 000000000..09a54420c --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_b diff --git a/tests/rpath-2bbc b/tests/rpath-2bbc new file mode 100755 index 000000000..e62a9ef46 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_b diff --git a/tests/rpath-2bbd b/tests/rpath-2bbd new file mode 100755 index 000000000..9f97ec1b7 --- /dev/null +++ b/tests/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 + +. $top_srcdir/tests/rpath-2_b diff --git a/tests/rpathcfg.sh b/tests/rpathcfg.sh new file mode 100755 index 000000000..11f241edc --- /dev/null +++ b/tests/rpathcfg.sh @@ -0,0 +1,223 @@ +#!/bin/sh +# Prints information for maintaining config.rpath. + +# The caller should set the environment variables +# top_srcdir, CONFIG_SHELL, CC, GCC, LDFLAGS, LD, with_gnu_ld, host. + +echo "=============== rpathcfg for $host ===============" +echo +echo "--------------- config.rpath output ---------------" +${CONFIG_SHELL-/bin/sh} $top_srcdir/config.rpath "$host" | sed -e 's/^acl_cv_//' +echo "--------------- experimentally determined ---------------" +abs_top_srcdir=`cd $top_srcdir && pwd` +builddir=`pwd` +global_top_srcdir=`cd "$top_srcdir" && pwd` +export global_top_srcdir +rm -rf tstprefix tstbuild tstlib + +eval `${CONFIG_SHELL-/bin/sh} $top_srcdir/config.rpath "$host" | grep '^acl_cv_wl='` +wl="$acl_cv_wl" + +# Static library suffix (normally "a"). +mkdir tstprefix +mkdir tstbuild +(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd tstbuild && tar xf -) +(cd tstbuild + ${CONFIG_SHELL-/bin/sh} ./configure --disable-shared --prefix=$builddir/tstprefix > configure.log 2>&1 + make > make.log 2>&1 + make install > install.log 2>&1 +) +rm -rf tstbuild +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 tstbuild +(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd tstbuild && tar xf -) +(cd tstbuild + ${CONFIG_SHELL-/bin/sh} ./configure --disable-static --prefix=$builddir/tstprefix > configure.log 2>&1 + make > make.log 2>&1 + make install > install.log 2>&1 +) +rm -rf tstbuild +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 tstbuild +(cd $top_srcdir/tests/rpathx && tar cf - *) | (cd tstbuild && tar xf -) +(cd tstbuild + ${CONFIG_SHELL-/bin/sh} ./configure --disable-static --prefix=$builddir/tstprefix > configure.log 2>&1 + make > make.log 2>&1 + make install > install.log 2>&1 +) +rm -rf tstbuild + +# 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 $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2 + $CC $LDFLAGS $top_srcdir/tests/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 $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag1 $flag2 -o a.out" 1>&2 + $CC $LDFLAGS $top_srcdir/tests/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 $top_srcdir/tests/rpathlx/usex.c tstlib/librpathx.$shlibext $flag -o a.out" 1>&2 + $CC $LDFLAGS $top_srcdir/tests/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 $top_srcdir/tests/rpathlx/usex.c tstprefix/lib/librpathx.$shlibext -o a.out" 1>&2 +$CC $LDFLAGS $top_srcdir/tests/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 $top_srcdir/tests/rpathlx/usex.c -Ltstprefix/lib -lrpathx -o a.out" 1>&2 +$CC $LDFLAGS $top_srcdir/tests/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 + +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 <