From: Stefano Lattarini Date: Sun, 10 Apr 2011 07:50:49 +0000 (+0200) Subject: Merge branch 'maint' X-Git-Tag: v1.11b~383 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbb398a168fc2387814c419fc44bd24114f10d7e;p=platform%2Fupstream%2Fautomake.git Merge branch 'maint' test defs: new requirement for the default java compiler * tests/defs (for tool in $required): New requirement 'javac'. * tests/java.test: Use it instead of ad-hoc configure check. * tests/java-check.test: Likewise. * tests/java-extra.test: Likewise. * tests/java-noinst.test: Likewise. * tests/instfail-java.test: Likewise. * tests/instdir-java.test: Likewise. --- fbb398a168fc2387814c419fc44bd24114f10d7e diff --cc ChangeLog index 96969a8,a605aa8..45688e3 --- a/ChangeLog +++ b/ChangeLog @@@ -1,3 -1,12 +1,14 @@@ + 2011-04-10 Stefano Lattarini + + test defs: new requirement for the default java compiler + * tests/defs.in (for tool in $required): New requirement 'javac'. + * tests/java.test: Use it instead of ad-hoc configure check. + * tests/java-check.test: Likewise. ++ * tests/java-extra.test: Likewise. ++ * tests/java-noinst.test: Likewise. + * tests/instfail-java.test: Likewise. + * tests/instdir-java.test: Likewise. + 2011-04-09 Stefano Lattarini java: check_JAVA does not cause compilation by "make all" anymore diff --cc tests/defs index e994a40,cd2284c..77bb534 --- a/tests/defs +++ b/tests/defs @@@ -284,11 -163,15 +284,15 @@@ d # it will try link *nothing* and complain it cannot find # main(); funny). Use -help so it does not try linking anything. echo "$me: running $CC -V -help" - ( $CC -V -help ) || exit 77 + $CC -V -help || exit 77 ;; + javac) + echo "$me: running javac -version" + javac -version || exit 77 + ;; makedepend) echo "$me: running makedepend -f-" - ( makedepend -f- ) || exit 77 + makedepend -f- || exit 77 ;; makeinfo-html) # Make sure makeinfo understands --html. diff --cc tests/instdir-java.test index 5831f27,9d9a03c..8cad153 --- a/tests/instdir-java.test +++ b/tests/instdir-java.test @@@ -16,11 -16,12 +16,10 @@@ # If $(javadir) is the empty string, then nothing should be installed there. + required=javac . ./defs || Exit 1 -set -e - cat >>configure.in <<'END' - AC_CHECK_PROG([HAS_JAVAC], [javac], [:], [exit]) - ($HAS_JAVAC 77); $HAS_JAVAC 77 AC_OUTPUT END diff --cc tests/instfail-java.test index 4ebc2c3,8f527cf..a570297 --- a/tests/instfail-java.test +++ b/tests/instfail-java.test @@@ -19,11 -19,12 +19,10 @@@ # This is the java sister test of instfail.test. + required=javac . ./defs || Exit 1 -set -e - cat >>configure.in <<'END' - AC_CHECK_PROG([HAS_JAVAC], [javac], [:], [exit]) - ($HAS_JAVAC 77); $HAS_JAVAC 77 AC_OUTPUT END diff --cc tests/java-extra.test index 5309964,0000000..9837d75 mode 100755,000000..100755 --- a/tests/java-extra.test +++ b/tests/java-extra.test @@@ -1,76 -1,0 +1,75 @@@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check use of EXTRA with the JAVA primary. Also test interaction +# of JAVA with conditionals (it's natural to test it here, since +# EXTRA_JAVA exists mostly for ensuring interoperation with Automake +# conditionals). + ++required=javac +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' - AC_CHECK_PROG([HAS_JAVAC], [javac], [:], [exit]) - ($HAS_JAVAC 77); $HAS_JAVAC 77 +AM_CONDITIONAL([COND], [test x"$cond" = x"yes"]) +AC_OUTPUT +END + +cat > Makefile.am << 'END' +javadir = $(pkgdatadir)/java + +EXTRA_JAVA = Class1.java Class2.java Class3.java + +java_JAVA = Class1.java + +if COND +java_JAVA += Class2.java +else !COND +java_JAVA += Class3.java +endif !COND + +Class3.java: Makefile + echo 'class Class3 {}' > $@ +CLEANFILES = Class3.java +END + +echo "class Class1 {}" > Class1.java +echo "class Class2 {}" > Class2.java + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +./configure cond=yes +$MAKE +ls -l +test -f Class1.class +test -f Class2.class +test ! -f Class3.class +test ! -f Class3.java + +$MAKE distclean + +./configure cond=no +$MAKE +ls -l +test -f Class1.class +test ! -f Class2.class +test -f Class3.class +test -f Class3.java + +: diff --cc tests/java-noinst.test index 130ea63,0000000..6babc27 mode 100755,000000..100755 --- a/tests/java-noinst.test +++ b/tests/java-noinst.test @@@ -1,53 -1,0 +1,53 @@@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + - # Make sure that noinst_JAVA causes generated *.class files not to be installed. ++# Make sure that noinst_JAVA causes generated *.class files not to be ++# installed. + ++required=javac +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' - AC_CHECK_PROG([HAS_JAVAC], [javac], [:], [exit]) - ($HAS_JAVAC 77); $HAS_JAVAC 77 +AC_OUTPUT +END + +cat > Foo.java <<'END' +class Foo { } +END + +$ACLOCAL +$AUTOCONF + +: > Makefile.in # Will be updated later. + +./configure --prefix="`pwd`/_inst" + +# We need this hacky loop because multiple uses of the JAVA primary +# in the same Makefile.am are not allowed. + +for prefix in '' nodist_ dist_; do + echo "${prefix}noinst_JAVA = Foo.java" > Makefile.am + $AUTOMAKE + ./config.status Makefile + $MAKE + test -f Foo.class + $MAKE install + test ! -d _inst +done + +: diff --cc tests/java.test index f4259d4,cae56dc..671d2fd --- a/tests/java.test +++ b/tests/java.test @@@ -17,11 -16,12 +17,10 @@@ # Minimal test of Java functionality. + required=javac . ./defs || Exit 1 -set -e - cat >>configure.in <<'EOF' - AC_CHECK_PROG([HAS_JAVAC], [javac], [:], [exit]) - ($HAS_JAVAC 77); $HAS_JAVAC 77 AC_OUTPUT EOF