From c7de107aaf55b1c30438d5a17fefd296fabc57ef Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Tue, 5 Jun 2012 18:22:33 +0200 Subject: [PATCH] [ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES This improved coverage will come handy to check the correctness of future changes. * t/cond30.sh: Enhance. Signed-off-by: Stefano Lattarini --- t/cond30.sh | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/t/cond30.sh b/t/cond30.sh index 6c2b39626..495842c95 100755 --- a/t/cond30.sh +++ b/t/cond30.sh @@ -14,43 +14,68 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# For PR/352: make sure we support bin_PROGRAMS being defined conditionally. +# For PR/352: make sure we support bin_PROGRAMS, lib_LIBRARIES and +# lib_LTLIBRARIES being defined conditionally. . ./defs || Exit 1 cat >>configure.ac <<'EOF' -AM_CONDITIONAL([C1], [test -z "$two"]) -AM_CONDITIONAL([C2], [test -n "$two"]) +m4_define([AM_PROG_AR], [:]) +AM_PROG_AR +AM_CONDITIONAL([C1], [test x"$two" != x"yes"]) +AM_CONDITIONAL([C2], [test x"$two" = x"yes"]) AC_OUTPUT EOF +# Avoid spurious interferences from the environment. +unset undefined two || : + cat > Makefile.am <<'EOF' AUTOMAKE_OPTIONS = no-dependencies CC = false +AR = false +RANLIB = false +LIBTOOL = false EXEEXT = .foo if C1 bin_PROGRAMS = a +lib_LIBRARIES = liba.a +lib_LTLIBRARIES = libxa.la endif if C2 bin_PROGRAMS = b $(undefined) +lib_LIBRARIES = libb.a $(undefined) +lib_LTLIBRARIES = libxb.la $(undefined) endif .PHONY: test-a test-b test-a: test a.foo = $(bin_PROGRAMS) + test liba.a = $(lib_LIBRARIES) + test libxa.la = $(lib_LTLIBRARIES) test-b: test b.foo = $(bin_PROGRAMS) + test libb.a = $(lib_LIBRARIES) + test libxb.la = $(lib_LTLIBRARIES) EOF +: > ltmain.sh + $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a + +$FGREP SOURCES Makefile.in # For debugging. $FGREP 'a_SOURCES = a.c' Makefile.in $FGREP 'b_SOURCES = b.c' Makefile.in +$FGREP 'liba_a_SOURCES = liba.c' Makefile.in +$FGREP 'libb_a_SOURCES = libb.c' Makefile.in +$FGREP 'libxa_la_SOURCES = libxa.c' Makefile.in +$FGREP 'libxb_la_SOURCES = libxb.c' Makefile.in -./configure +./configure two=no $MAKE test-a ./configure two=yes -- 2.47.2