From: Stefano Lattarini Date: Tue, 26 Apr 2011 14:52:45 +0000 (+0200) Subject: java coverage: test JAVACFLAGS and AM_JAVACFLAGS X-Git-Tag: ng-0.5a~123^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62cb9a4f4be71d740ff412f0ba7c7ef29feaa8a0;p=thirdparty%2Fautomake.git java coverage: test JAVACFLAGS and AM_JAVACFLAGS * tests/javaflags.test: New test. * tests/Makefile.am (TESTS): Update. --- diff --git a/ChangeLog b/ChangeLog index 9c7182899..0031f1e0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-04-26 Stefano Lattarini + + java coverage: test JAVACFLAGS and AM_JAVACFLAGS + * tests/javaflags.test: New test. + * tests/Makefile.am (TESTS): Update. + 2011-04-26 Stefano Lattarini java coverage: test rebuild rules for java diff --git a/tests/Makefile.am b/tests/Makefile.am index 0e55109b2..de1dfdaf3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -436,6 +436,7 @@ java-check.test \ java-clean.test \ javaprim.test \ javasubst.test \ +javaflags.test \ java-extra.test \ java-noinst.test \ java-nobase.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index a0e6c7048..db8a6c021 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -709,6 +709,7 @@ java-check.test \ java-clean.test \ javaprim.test \ javasubst.test \ +javaflags.test \ java-extra.test \ java-noinst.test \ java-nobase.test \ diff --git a/tests/javaflags.test b/tests/javaflags.test new file mode 100755 index 000000000..75643222f --- /dev/null +++ b/tests/javaflags.test @@ -0,0 +1,62 @@ +#! /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 support for $(JAVACFLAGS) and $(AM_JAVACFLAGS). + +. ./defs || Exit 1 + +set -e + +cat > fake-javac <<'END' +#!/bin/sh +echo "$*" > javaflags.list +END +chmod a+x fake-javac + +# Remove JAVAC from the environment, so that it won't interfere +# with `make -e' below. +unset JAVAC || : + +cat >> configure.in <<'END' +AC_PROG_CC +# Simulate presence of the java compiler using our fake-javac script. +AC_SUBST([JAVAC], ['$(abs_top_srcdir)'/fake-javac]) +AC_OUTPUT +END + +cat > Makefile.am <<'END' +foodir = $(prefix) +foo_JAVA = bar.java +AM_JAVACFLAGS = __am_flags__ +END + +$ACLOCAL +$AUTOMAKE + +grep '\$(JAVACFLAGS).*\$(AM_JAVACFLAGS)' Makefile.in && Exit 1 + +: > bar.java + +$AUTOCONF +./configure +env JAVACFLAGS=__user_flags__ $MAKE -e + +ls -l + +cat javaflags.list +grep '__am_flags__.*__user_flags__' javaflags.list + +: