]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 5 Jun 2012 16:22:33 +0000 (18:22 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 5 Jun 2012 19:19:41 +0000 (21:19 +0200)
This improved coverage will come handy to check the correctness of
future changes.

* t/cond30.sh: Enhance.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/cond30.sh

index 6c2b39626a4c2dddec5c77fe42a436504edf3c6f..495842c951f5f71524d562f6047dddd8703bb002 100755 (executable)
 # 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