Hi Bruno.

On 04/22/2012 07:48 PM, Bruno Haible wrote:
> Hi Stefano,
> 
>>> The test looks for a lib/ directory, but "make install" created a lib64/
>>> directory. This is due to the /usr/share/site/x86_64-unknown-linux-gnu
>>> (from $CONFIG_SITE, set by /etc/profile.d/site.sh) which sets a libdir
>>> that ends in /lib64 rather than /lib if it finds that the compiler is
>>> generating 64-bit code.
>>>
>> Could you post the contents of the files '/etc/profile.d/site.sh' and
>> (most importantly) '/usr/share/site/x86_64-unknown-linux-gnu'?
> 
> Sure:
>
> [SNIP]
>
> You can see:
>   1. To avoid the libdir variable to be clobbered by this script, it is
>      sufficient to pass a --libdir option.
>   2. It is not possible to avoid the libexecdir variable modification.
>      You can either live with it, or clobber it afterwards.
> 
After all, I went for a different and more reliable fix, i.e., using $(libdir)
instead of $(prefix)/lib, and similarly for the other $(foodir) variables.

So, does the attached patch fix the problem for you?

Thanks,
  Stefano
>From f357bed82aed91aa3eef5e157df4814c7fc26028 Mon Sep 17 00:00:00 2001
Message-Id: <f357bed82aed91aa3eef5e157df4814c7fc26028.1335189109.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Mon, 23 Apr 2012 15:51:25 +0200
Subject: [PATCH] tests: cater to systems installing libs in /lib64

See automake bug#11302.

On at least OpenSUSE 12.1, "make install" will install libraries in
the '${prefix}/lib64'  directory by default.  This is due to the
$CONFIG_SITE set by /etc/profile.d/site.sh, which sets a libdir
that ends in '/lib64' rather than '/lib' if it finds that the compiler
is generating 64-bit code.  This behaviour was causing some spurious
failures in our testsuite.  Fix them.

* t/posixsubst-libraries.sh: Assume the libraries are installed in
'$(libdir)' rather than in '$(prefix)/lib'.
* t/posixsubst-ltlibraries.sh: Likewise.
* t/posixsubst-scripts.sh: Similarly, don't assume that '$(bindir)',
'$(sbindir)' and '$(libexedir)' always defaults to respectively
'$(prefix)/bin', '$(prefix)/sbin' and '$(prefix)/libexec'.
* t/transform3.test: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com>
---
 t/posixsubst-libraries.sh   |    8 ++++----
 t/posixsubst-ltlibraries.sh |    8 ++++----
 t/posixsubst-scripts.sh     |   22 +++++++++++-----------
 t/transform3.sh             |   41 +++++++++++++++++++++++------------------
 4 files changed, 42 insertions(+), 37 deletions(-)

diff --git a/t/posixsubst-libraries.sh b/t/posixsubst-libraries.sh
index 8e6b265..f437571 100755
--- a/t/posixsubst-libraries.sh
+++ b/t/posixsubst-libraries.sh
@@ -41,10 +41,10 @@ libbar.c:
 CLEANFILES = libbar.c # For FreeBSD make.
 
 installcheck-local:
-	ls -l $(prefix)/lib
-	test -f $(prefix)/lib/libfoo1.a
-	test -f $(prefix)/lib/libfoo2.a
-	test -f $(prefix)/lib/libbar.a
+	ls -l $(libdir)
+	test -f $(libdir)/libfoo1.a
+	test -f $(libdir)/libfoo2.a
+	test -f $(libdir)/libbar.a
 END
 
 echo 'int bar1(void) { return 0; }' > libfoo1.c
diff --git a/t/posixsubst-ltlibraries.sh b/t/posixsubst-ltlibraries.sh
index 6a4cbd5..b4b2a92 100755
--- a/t/posixsubst-ltlibraries.sh
+++ b/t/posixsubst-ltlibraries.sh
@@ -41,10 +41,10 @@ libbar.c:
 CLEANFILES = libbar.c # For FreeBSD make.
 
 installcheck-local:
-	ls -l $(prefix)/lib
-	test -f $(prefix)/lib/libfoo1.la
-	test -f $(prefix)/lib/libfoo2.la
-	test -f $(prefix)/lib/libbar.la
+	ls -l $(libdir)
+	test -f $(libdir)/libfoo1.la
+	test -f $(libdir)/libfoo2.la
+	test -f $(libdir)/libbar.la
 END
 
 echo 'int bar1(void) { return 0; }' > libfoo1.c
diff --git a/t/posixsubst-scripts.sh b/t/posixsubst-scripts.sh
index 934b82e..cda515f 100755
--- a/t/posixsubst-scripts.sh
+++ b/t/posixsubst-scripts.sh
@@ -65,17 +65,17 @@ test2: distdir
 	test ! -r $(distdir)/quux.pl
 
 installcheck-local:
-	ls -l $(prefix)/libexec $(prefix)/bin $(prefix)/sbin
-	test -f $(prefix)/sbin/foo1.sh
-	test -x $(prefix)/sbin/foo1.sh
-	test -f $(prefix)/sbin/foo2.sh
-	test -x $(prefix)/sbin/foo2.sh
-	test -f $(prefix)/libexec/bar1
-	test -x $(prefix)/libexec/bar1
-	test -f $(prefix)/libexec/bar2
-	test -x $(prefix)/libexec/bar2
-	test -f $(prefix)/bin/quux.pl
-	test -x $(prefix)/bin/quux.pl
+	ls -l $(libexecdir) $(bindir) $(sbindir)
+	test -f $(sbindir)/foo1.sh
+	test -x $(sbindir)/foo1.sh
+	test -f $(sbindir)/foo2.sh
+	test -x $(sbindir)/foo2.sh
+	test -f $(libexecdir)/bar1
+	test -x $(libexecdir)/bar1
+	test -f $(libexecdir)/bar2
+	test -x $(libexecdir)/bar2
+	test -f $(bindir)/quux.pl
+	test -x $(bindir)/quux.pl
 END
 
 cat > foo1.sh <<'END'
diff --git a/t/transform3.sh b/t/transform3.sh
index aaa69cb..6f1b811 100755
--- a/t/transform3.sh
+++ b/t/transform3.sh
@@ -35,6 +35,27 @@ bin_SCRIPTS = foo
 pkgdata_DATA = bar.txt
 pkglib_LIBRARIES = libzap.a
 pkglibexec_SCRIPTS = mu
+
+test-install: install
+	find $(prefix) ;: For debugging.
+	test   -f $(bindir)/gnu-foo
+	test   -x $(bindir)/gnu-foo
+	test   -f $(datadir)/foo/bar.txt
+	test ! -d $(datadir)/gnu-foo
+	test   -f $(libdir)/foo/libzap.a
+	test ! -d $(libdir)/gnu-foo
+	test   -f $(libexecdir)/foo/gnu-mu
+	test   -x $(libexecdir)/foo/gnu-mu
+	test ! -d $(libexecdir)/gnu-foo
+
+test-installdirs: installdirs
+	find $(prefix) ;: For debugging.
+	test   -d $(datadir)/foo
+	test ! -d $(datadir)/gnu-foo
+	test   -d $(libdir)/foo
+	test ! -d $(libdir)/gnu-foo
+	test   -d $(libexecdir)/foo
+	test ! -d $(libexecdir)/gnu-foo
 END
 
 cat > libzap.c <<'END'
@@ -59,29 +80,13 @@ $AUTOMAKE -a
 
 ./configure --program-prefix=gnu- --prefix "`pwd`/inst"
 
-$MAKE install
-find inst # For debugging.
-test -f inst/bin/gnu-foo
-test -x inst/bin/gnu-foo
-test -f inst/share/foo/bar.txt
-test ! -d inst/share/gnu-foo
-test -f inst/lib/foo/libzap.a
-test ! -d inst/lib/gnu-foo
-test -f inst/libexec/foo/gnu-mu
-test -x inst/libexec/foo/gnu-mu
-test ! -d inst/libexec/gnu-foo
+$MAKE test-install
 
 $MAKE uninstall
 test `find inst -type f -print | wc -l` = 0
 
 # Opportunistically test for installdirs.
 rm -rf inst
-$MAKE installdirs
-test -d inst/share/foo
-test ! -d inst/share/gnu-foo
-test -d inst/lib/foo
-test ! -d inst/lib/gnu-foo
-test -d inst/libexec/foo
-test ! -d inst/libexec/gnu-foo
+$MAKE test-installdirs
 
 :
-- 
1.7.9.5

Reply via email to