summaryrefslogtreecommitdiff
path: root/libjava/testsuite/Makefile.am
blob: 2aebd7c993846a200d5128e84bb4a45409bb099a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
## Process this file with automake to produce Makefile.in.

AUTOMAKE_OPTIONS = foreign dejagnu

# May be used by various substitution variables.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)

# autoconf2.13's target_alias
target_noncanonical = @target_noncanonical@

# Setup the testing framework, if you have one
EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
            echo $(top_builddir)/../expect/expect ; \
          else echo expect ; fi`

RUNTEST = "`if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
	       echo $(top_srcdir)/../dejagnu/runtest ; \
	    else echo runtest; fi` $(AM_RUNTESTFLAGS)"

## Tell dejagnu whether the interpreter is enabled.
AM_RUNTESTFLAGS = INTERPRETER=$(INTERPRETER)

MYGCJH = gjavah

.PHONY: compile-tests

# We need more things in site.exp, but automake completely controls the
# creation of that file; there's no way to append to it without messing up
# the dependency chains.  So we overrule automake.  This rule is exactly
# what it would have generated, plus our own additions.
site.exp: Makefile
	@echo 'Making a new site.exp file...'
	@echo '## these variables are automatically generated by make ##' >site.tmp
	@echo '# Do not edit here.  If you wish to override these values' >>site.tmp
	@echo '# edit the last section' >>site.tmp
	@echo 'set srcdir $(srcdir)' >>site.tmp
	@echo "set objdir `pwd`" >>site.tmp
	@echo 'set build_alias "$(build_alias)"' >>site.tmp
	@echo 'set build_triplet $(build_triplet)' >>site.tmp
	@echo 'set host_alias "$(host_alias)"' >>site.tmp
	@echo 'set host_triplet $(host_triplet)' >>site.tmp
	@echo 'set target_alias "$(target_alias)"' >>site.tmp
	@echo 'set target_triplet $(target_triplet)' >>site.tmp
	@echo 'set libiconv "$(LIBICONV)"' >>site.tmp
	@echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
	@test ! -f site.exp || \
	  sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
	@-rm -f site.bak
	@test ! -f site.exp || mv site.exp site.bak
	@mv site.tmp site.exp

check-am: compile-tests

compile-tests:
if JAVA_MAINTAINER_MODE
	for test in `cd $(srcdir) > /dev/null; \
		     find libjava.cni libjava.jni libjava.jvmti libjava.lang \
			  libjava.loader libjava.verify -name \*.java`; do \
	  testjar=$(srcdir)/`echo $$test | sed -e 's/\.java$$/\.jar/'`; \
	  testdep=; \
	  genheader=; \
	  case "$$test" in \
	    libjava.loader/dummy.java) \
	      testjar=$(srcdir)/libjava.loader/dummy.class;; \
	    libjava.loader/MyLoader.java) \
	      continue;; \
	    libjava.loader/*.java) \
	      testdep="libjava.loader/MyLoader.java";; \
	    libjava.jni/register2.java) \
	      ;; \
	    libjava.jni/*.java|libjava.jvmti/interp/*.java) \
	      genheader=-jni;; \
	    libjava.jvmti/*.java|libjava.cni/*.java) \
	      genheader=-cni;; \
	  esac; \
	  if test -f $$testjar; then \
	    if ! test $(srcdir)/$$test -nt $$testjar; then \
	      test -z "$$testdep" && continue; \
	      test $(srcdir)/$$testdep -nt $$testjar || continue; \
	    fi; \
	  fi; \
	  echo Compiling $$test; \
	  testtmpdir=`echo $$test | sed -e 's,/,_,g'`T; \
	  rm -rf $$testtmpdir; $(mkdir_p) $$testtmpdir; \
	  if test -n "$$testdep"; then \
	    $(GCJ) -C -g -w --encoding=UTF-8 -bootclasspath \
	      $(top_builddir)/libgcj-$(gcc_version).jar::$$testtmpdir \
	      -d $$testtmpdir $(srcdir)/$$testdep || exit; \
	  fi; \
	  $(GCJ) -C -g -w --encoding=UTF-8 -bootclasspath \
	    $(top_builddir)/libgcj-$(gcc_version).jar:$$testtmpdir \
	    -d $$testtmpdir $(srcdir)/$$test || exit; \
	  case "$$test" in \
	    libjava.loader/dummy.java) \
	      cp $$testtmpdir/dummy.class $$testjar;; \
	    *) \
	      $(JAR) cf $$testjar \
		`ls $$testtmpdir/*.class \
		 | sed -e 's,^,-C ,;s,/\([^/]*\.class\)$$, \1,'` || exit ;; \
	  esac; \
	  if test -n "$$genheader"; then \
	    $(MYGCJH) $$genheader $$testtmpdir/*.class \
	      -bootclasspath $(top_builddir)/libgcj-$(gcc_version).jar \
	      -d $$testtmpdir/ || exit; \
	    mv $$testtmpdir/*.h $(srcdir)/`dirname $$test`/ 2>/dev/null; \
	  fi; \
	  rm -rf $$testtmpdir; \
	done
endif