automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 1/7] [ng] coverage: conditional defn of lib_LIBRARI


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 1/7] [ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES
Date: Wed, 6 Jun 2012 00:21:01 +0200

This improved coverage will come handy to check the correctness of
future changes.

* t/cond30.sh: Enhance.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 t/cond30.sh |   35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/t/cond30.sh b/t/cond30.sh
index 6c2b396..495842c 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 <http://www.gnu.org/licenses/>.
 
-# 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
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]