[Top][All Lists]
[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
- [Automake-NG] [PATCH 0/7] Move detection of possible typos in _SOURCES etc. at make runtime, Stefano Lattarini, 2012/06/05
- [Automake-NG] [PATCH 2/7] [ng] automake: new global variable '%known_ltlibraries', Stefano Lattarini, 2012/06/05
- [Automake-NG] [PATCH 1/7] [ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES,
Stefano Lattarini <=
- [Automake-NG] [PATCH 3/7] [ng] refactor: new make variables am__all_libs and am__all_ltlibs, Stefano Lattarini, 2012/06/05
- [Automake-NG] [PATCH 5/7] [ng] warns: typos in '_DEPENDENCIES' variables are now reported, Stefano Lattarini, 2012/06/05
- [Automake-NG] [PATCH 4/7] [ng] warns: typos in _SOURCES etc. reported at make runtime, Stefano Lattarini, 2012/06/05
- [Automake-NG] [PATCH 6/7] [ng] warns: also report typos for 'LOG_DEPENDENCIES' variables, Stefano Lattarini, 2012/06/05
- [Automake-NG] [PATCH 7/7] [ng] cleanup: unused variable in the automake script removed, Stefano Lattarini, 2012/06/05
- Re: [Automake-NG] [PATCH 0/7] Move detection of possible typos in _SOURCES etc. at make runtime, Akim Demaille, 2012/06/06