OSDN Git Service

config/
[pf3gnuchains/gcc-fork.git] / libjava / Makefile.am
1 ## Process this file with automake to produce Makefile.in.
2
3 AUTOMAKE_OPTIONS = foreign subdir-objects
4
5 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
6
7 # May be used by various substitution variables.
8 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
9
10 SUBDIRS = $(DIRLTDL) gcj include classpath
11 if TESTSUBDIR
12 SUBDIRS += testsuite
13 endif
14
15 # write_entries_to_file - writes each entry in a list
16 # to the specified file. Each entry is written individually
17 # to accomodate systems with severe command-line-length
18 # limitations.
19 # Parameters:
20 # $(1): variable containing entries to iterate over
21 # $(2): output file
22 write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
23
24 ## ################################################################
25
26 # autoconf2.13's target_alias
27 target_noncanonical = @target_noncanonical@
28
29 # This is required by TL_AC_GXX_INCLUDE_DIR.
30 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
31
32 libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
33
34 ##
35 ## What gets installed, and where.
36 ##
37
38 toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la
39 toolexecmainlib_DATA = libgcj.spec
40
41 if USE_LIBGCJ_BC
42 toolexeclib_LTLIBRARIES += libgcj_bc.la
43 endif
44
45 if XLIB_AWT
46 toolexeclib_LTLIBRARIES += lib-gnu-awt-xlib.la
47 endif
48
49 dbexec_LTLIBRARIES = libjvm.la
50
51 pkgconfigdir = $(libdir)/pkgconfig
52
53 jardir = $(datadir)/java
54 jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
55 if INSTALL_ECJ_JAR
56 jar_DATA += $(ECJ_BUILD_JAR)
57 endif
58
59 if JAVA_HOME_SET
60 JAVA_HOME_DIR = $(JAVA_HOME)
61 BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
62 else
63 JAVA_HOME_DIR = $(prefix)
64 BOOT_CLASS_PATH_DIR = $(jardir)/libgcj-$(gcc_version).jar
65 endif
66
67 ## Name of the default .db.
68 db_name = classmap.db
69 ## Compiler specific component of the .db file
70 db_pathtail = gcj-$(gcc_version)/$(db_name)
71
72 ## For now, only on native systems.  FIXME.
73 if NATIVE
74 bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool \
75         gappletviewer gjarsigner gkeytool gjar gjavah gnative2ascii \
76         gorbd grmid gserialver gtnameserv
77
78 ## It is convenient to actually build and install the default database
79 ## when gcj-dbtool is available.
80 dbexec_DATA = $(db_name)
81 endif
82
83 bin_SCRIPTS = addr2name.awk
84
85 if BUILD_ECJ1
86 ## We build ecjx and not ecj1 because in one mode, ecjx will not work
87 ## until after 'make install', and we don't want it to be picked up in
88 ## the build tree by gcj via a -B option.
89 libexecsub_PROGRAMS = ecjx
90 endif
91
92 ## ################################################################
93
94 ##
95 ## Compilers and compilation flags.
96 ##
97
98 if BASH_JAR
99 bin_SCRIPTS += scripts/jar
100 endif
101
102 ## The compiler with whatever flags we want for both -c and -C
103 ## compiles.
104 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
105
106 extra_ldflags_libjava = @extra_ldflags_libjava@
107
108 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
109           $(LDFLAGS) -o $@
110 GCJ_FOR_ECJX = @GCJ_FOR_ECJX@
111 GCJ_FOR_ECJX_LINK = $(GCJ_FOR_ECJX) -o $@
112 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
113           $(LDFLAGS) $(extra_ldflags_libjava) -o $@
114
115 GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
116
117 WARNINGS = -Wextra -Wall
118 ## Some systems don't allow `$' in identifiers by default, so we force
119 ## it with -fdollars-in-identifiers.  -Wswitch-enum detects bugs in
120 ## the verifier implementation, and maybe other places.  We need
121 ## _GNU_SOURCE defined for some Linux builds.  It doesn't hurt to
122 ## always define it.  Some systems, including Linux, need
123 ## -D_FILE_OFFSET_BITS=64 to enable > 2GB file support.
124 AM_CXXFLAGS = \
125         -fno-rtti \
126         -fnon-call-exceptions \
127         $(THREADCXXFLAGS) \
128         -fdollars-in-identifiers \
129         -Wswitch-enum \
130         -D_FILE_OFFSET_BITS=64 \
131         @LIBGCJ_CXXFLAGS@ \
132         $(WARNINGS) \
133         -D_GNU_SOURCE \
134         -DPREFIX="\"$(prefix)\"" \
135         -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\"" \
136         -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
137         -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
138         -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
139         -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
140         -DGCJ_VERSIONED_LIBDIR="\"$(dbexecdir)\"" \
141         -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
142         -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
143         -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\""
144
145 AM_GCJFLAGS = \
146         @LIBGCJ_JAVAFLAGS@ \
147         -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
148         --encoding=UTF-8 \
149         -Wno-deprecated -fbootstrap-classes
150
151 AM_CFLAGS = @LIBGCJ_CFLAGS@
152 if USING_GCC
153 AM_CFLAGS += $(WARNINGS)
154 endif
155
156 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
157 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
158
159 JCFLAGS = -g
160 JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
161
162 LIBFFIINCS = @LIBFFIINCS@
163
164 AM_CPPFLAGS = -I$(top_srcdir) \
165         -Iinclude -I$(top_srcdir)/include \
166         -I$(top_srcdir)/classpath/include \
167         -Iclasspath/include \
168         -I$(top_srcdir)/classpath/native/fdlibm \
169         $(GCINCS) $(THREADINCS) $(INCLTDL) \
170         $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
171
172 BOOTCLASSPATH = $(srcdir)/classpath/lib
173
174 ## ################################################################
175
176 ##
177 ## How to build libgcj.a and libgcj.jar
178 ##
179
180 libgij_la_SOURCES = gij.cc
181 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
182 ## See jv_convert_LDADD.
183 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
184 ## The mysterious backslash in the grep pattern is consumed by make.
185 libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
186         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
187
188 libgcj_la_SOURCES = prims.cc jni.cc jvmti.cc exception.cc stacktrace.cc \
189         link.cc defineclass.cc interpret.cc verify.cc \
190         $(nat_source_files)
191
192 if USING_BOEHMGC
193 libgcj_la_SOURCES += boehm.cc
194 endif
195
196 if USING_NOGC
197 libgcj_la_SOURCES += nogc.cc
198 endif
199
200 if USING_POSIX_PLATFORM
201 libgcj_la_SOURCES += posix.cc
202 endif
203
204 if USING_WIN32_PLATFORM
205 libgcj_la_SOURCES += win32.cc
206 endif
207
208 if USING_DARWIN_CRT
209 libgcj_la_SOURCES += darwin.cc
210 endif
211
212 if USING_POSIX_THREADS
213 libgcj_la_SOURCES += posix-threads.cc
214 endif
215
216 if USING_WIN32_THREADS
217 libgcj_la_SOURCES += win32-threads.cc
218 endif
219
220 if USING_NO_THREADS
221 libgcj_la_SOURCES += no-threads.cc
222 endif
223
224 ## Objects from C++ sources in subdirs.
225 nat_files = $(nat_source_files:.cc=.lo)
226 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
227
228 # Include THREADLIBS here to ensure that the correct version of
229 # certain linuxthread functions get linked:
230 ## The mysterious backslash in the grep pattern is consumed by make.
231 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
232         $(LIBLTDL) $(SYS_ZLIBS) \
233         -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
234         $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
235 libgcj_la_LIBADD = \
236         classpath/native/fdlibm/libfdlibm.la \
237         java/lang/Object.lo \
238         java/lang/Class.lo \
239         java/process-$(PLATFORM).lo \
240         $(all_packages_source_files:.list=.lo) \
241         $(bc_objects) \
242         $(propertyo_files) \
243         $(LIBMAGIC) $(LIBFFI) $(ZLIBS) $(GCLIBS)
244 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
245         java/lang/Object.lo \
246         java/lang/Class.lo \
247         java/process-$(PLATFORM).lo \
248         $(all_packages_source_files:.list=.lo) \
249         $(LIBLTDL) $(libgcj_la_LIBADD)
250 libgcj_la_LINK = $(LIBLINK)
251
252 ## A hack to make sure the various gcj-related macros, like
253 ## LTGCJCOMPILE, are defined by automake.  This is never actually
254 ## compiled.
255 EXTRA_libgcj_la_SOURCES = java/lang/Object.java
256
257 libgcj_tools_la_SOURCES = classpath/tools/tools.zip
258 libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes  -fsource-filename=$(here)/classpath/tools/all-classes.lst
259 libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
260  -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
261  $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
262 libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
263 libgcj_tools_la_LINK = $(LIBLINK)
264
265 ## libjvm.so
266 libjvm_la_SOURCES = jni-libjvm.cc
267 libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
268 ## See jv_convert_LDADD.
269 libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
270 libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC)
271
272 ## The .db file.  This rule is only used for native builds, so it is
273 ## safe to invoke gcj-dbtool.
274 $(db_name): gcj-dbtool$(EXEEXT)
275 ## In case it exists already.
276         @rm -f $(db_name)
277 ## We don't actually care if it fails -- if it does, just make an
278 ## empty file.  This is simpler than trying to discover when mmap is
279 ## not available.
280         ./gcj-dbtool -n $(db_name) || touch $(db_name)
281
282 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
283 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
284 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
285         libgcj.la libgcj.spec \
286         $(lib_gnu_awt_xlib_la_LIBADD)
287 ## We require libstdc++-v3 to be in the same build tree.
288 lib_gnu_awt_xlib_la_CPPFLAGS = \
289         $(AM_CPPFLAGS) \
290         -I../libstdc++-v3/include \
291         -I../libstdc++-v3/include/$(target_noncanonical) \
292         -I$(srcdir)/../libstdc++-v3/libsupc++
293 ## The mysterious backslash in the grep pattern is consumed by make.
294 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
295         @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
296         -rpath $(toolexeclibdir) \
297         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
298 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
299
300 ## Support for libgcj_bc: dummy shared library.
301 ##
302 ## This lets us have one soname in BC objects and another in C++ ABI objects.
303 libgcj_bc_la_SOURCES = libgcj_bc.c
304 libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
305         $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
306 libgcj_bc_la_LIBADD = libgcj.la
307 libgcj_bc_la_DEPENDENCIES = libgcj.la
308 libgcj_bc_la_LINK = $(LIBLINK)
309 ## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
310 ## USE_LIBGCJ_BC shouldn't be set on other targets.
311 libgcj_bc_dummy_LINK = $(CC) -L$(here)/.libs $(CFLAGS) $(LDFLAGS) -shared \
312         -fPIC -nostdlib
313
314 ## This rule creates the libgcj_bc dummy library in the .libs directory, for use
315 ## when testing.
316 libgcj_bc.la: $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_DEPENDENCIES)
317         $(libgcj_bc_la_LINK) $(am_libgcj_bc_la_rpath) $(libgcj_bc_la_LDFLAGS) \
318         $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS) || exit; \
319         rm .libs/libgcj_bc.so; \
320         mv .libs/libgcj_bc.so.1.0.0 .libs/libgcj_bc.so; \
321         $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
322         -o .libs/libgcj_bc.so.1.0.0 -lgcj || exit; \
323         rm .libs/libgcj_bc.so.1; \
324         $(LN_S) libgcj_bc.so.1.0.0 .libs/libgcj_bc.so.1
325
326 ## Note that property_files is defined in sources.am.
327 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
328
329 $(propertyo_files): %.lo: classpath/resource/%
330         $(mkinstalldirs) `dirname $@`; \
331         $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
332
333 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
334 ## Note that this now omits the property files.
335 ## It doesn't matter since we don't use the jar at runtime.
336         here=`pwd`; cd $(srcdir)/classpath/lib; $(JAR) -cfM \
337             $$here/libgcj-$(gcc_version).jar gnu java javax org sun
338
339 libgcj-tools-$(gcc_version).jar: classpath/tools/tools.zip
340         cp $< $@
341
342 CLEANFILES = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
343 DISTCLEANFILES = native.dirs
344
345 mostlyclean-local:
346 ## Use libtool rm to remove each libtool object
347         find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
348
349 distclean-local:
350 ## Remove every .d file that was created.
351         find . -name '*.d' -print | xargs rm -f
352
353 # Just remove the objects from C++ sources, for testing the C++ compiler.
354 clean-nat:
355         rm -f $(nat_files) $(xlib_nat_files)
356
357 SUFFIXES = .class .java .h .properties .list
358
359 ## Pass the list of object files to libtool in a temporary file to
360 ## avoid tripping platform command line length limits.
361 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
362         @echo Creating list of files to link...
363         @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
364         $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
365         -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
366
367 ## ################################################################
368
369 ## Compiling a list of java sources to a single .o.
370
371 %.lo: %.list
372         $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(here)/classpath/lib/classes -MT $@ -MD -MP -MF $(basename $@).deps @$<
373
374 java/lang/Object.lo: classpath/lib/java/lang/Object.class
375         $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(srcdir)/$(basename $@).java $<
376
377 java/lang/Class.lo: classpath/lib/java/lang/Class.class
378         $(LTGCJCOMPILE) -c -o $@  -fsource-filename=$(srcdir)/$(basename $@).java $<
379
380 ## ################################################################
381
382 ## This pulls in a number of variable and target definitions.
383 include sources.am
384
385 ## ################################################################
386
387 ##
388 ## How to build header files.
389 ##
390
391 ## We have special rules for certain headers.
392 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
393         java/lang/String.h java/lang/reflect/Constructor.h \
394         java/lang/reflect/Field.h java/lang/reflect/Method.h \
395         java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
396
397 generic_header_files = $(ordinary_header_files) $(xlib_nat_headers)
398
399 MYGCJH = gjavah
400
401 $(generic_header_files): gcjh.stamp
402
403 gcjh.stamp: classpath/lib/compile-classes
404 if JAVA_MAINTAINER_MODE
405         $(MYGCJH) --cni --all $(srcdir)/classpath/lib \
406             --cmdfile=$(srcdir)/headers.txt -d $(srcdir) --force
407 endif
408         echo > gcjh.stamp
409
410 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
411         java/io/ObjectInputStream$$GetField.h \
412         java/nio/DirectByteBufferImpl$$ReadWrite.h \
413         java/nio/channels/Pipe$$SinkChannel.h \
414         java/nio/channels/Pipe$$SourceChannel.h \
415         java/lang/reflect/Proxy$$ProxyData.h \
416         java/lang/reflect/Proxy$$ProxyType.h \
417         gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
418         gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
419         gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
420         gnu/java/nio/PipeImpl$$SourceChannelImpl.h
421
422 nat_headers = $(ordinary_header_files) $(inner_nat_headers)
423 nat_headers_install = $(ordinary_header_files)
424
425 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
426
427 ## Headers we maintain by hand and which we want to install.
428 extra_headers = java/lang/Object.h java/lang/Class.h
429
430 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
431         @:
432
433 install-exec-hook: install-toolexeclibLTLIBRARIES install-libexecsubPROGRAMS
434 ## Support for libgcj_bc: dummy shared library used only at link-time.
435 if USE_LIBGCJ_BC
436 ## Install libgcj_bc dummy lib in the target directory. We also need to delete
437 ## libtool's .la file, this prevents libtool resetting the lib again 
438 ## later.
439         @echo Installing dummy lib libgcj_bc.so.1.0.0; \
440         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
441         mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
442         $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
443         -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \
444         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
445         $(LN_S) libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
446         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.la;
447 endif
448 if BUILD_ECJ1
449 if NATIVE
450         mv $(DESTDIR)$(libexecsubdir)/ecjx$(EXEEXT) $(DESTDIR)$(libexecsubdir)/ecj1$(host_exeext)
451 else !NATIVE
452 ## Undo the prepending of the target prefix
453         mv $(DESTDIR)$(libexecsubdir)/$(target_noncanonical)-ecjx$(EXEEXT) $(DESTDIR)$(libexecsubdir)/ecj1$(host_exeext)
454 endif !NATIVE
455 endif BUILD_ECJ1
456
457 ## Install the headers.  It is fairly ugly that we have to do this by
458 ## hand.
459 install-data-local:
460         $(PRE_INSTALL)
461 ## Install the .pc file.
462         @pc_version=`echo $(GCJVERSION) | sed -e 's/[.][^.]*$$//'`; \
463         file="libgcj-$${pc_version}.pc"; \
464         $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir); \
465         echo "  $(INSTALL_DATA) libgcj.pc $(DESTDIR)$(pkgconfigdir)/$$file"; \
466         $(INSTALL_DATA) libgcj.pc $(DESTDIR)$(pkgconfigdir)/$$file
467 ## We use a GNU make trick here so that we don't go over the command
468 ## length limit of some shells.
469         @echo Creating list of headers to install...
470         @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
471         @cat tmp-ilist | while read f; do \
472           d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
473           $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
474           if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
475           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
476           $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
477         done
478         -@rm -f tmp-ilist
479 ## Install inner class headers.
480         $(INSTALL_DATA) $(srcdir)/'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
481         $(INSTALL_DATA) $(srcdir)/'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
482         $(INSTALL_DATA) $(srcdir)/'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
483         $(INSTALL_DATA) $(srcdir)/'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
484         $(INSTALL_DATA) $(srcdir)/'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
485         $(INSTALL_DATA) $(srcdir)/'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
486         $(INSTALL_DATA) $(srcdir)/'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
487         $(INSTALL_DATA) $(srcdir)/'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
488         $(INSTALL_DATA) $(srcdir)/'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
489         $(INSTALL_DATA) $(srcdir)/'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
490 ## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
491
492
493 ## ################################################################
494
495 ##
496 ## Additional `check' targets for maintainer convenience.
497 ##
498
499 ## This is used for maintainer-check.  FIXME: should set from
500 ## configure using AC_CHECK_TOOL.
501 NM = nm
502
503 ## Try to make sure our library doesn't stomp the namespace.
504 maintainer-check: libgcj.la
505         $(NM) .libs/libgcj.a | grep ' T ' \
506 ## Anything with `4java' is assumed to be from .java source.
507           | grep -v '4java' \
508 ## Anything with Jv is ok.
509           | grep -v 'Jv' \
510 ## `terminate' and `unexpected' are part of the runtime.
511           | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
512
513 ## This rule can be used to see if the headers are more or less
514 ## correct.
515 header-check: libgcj-$(gcc_version).jar $(nat_headers)
516         rm -f htest.cc; \
517         for h in $(nat_headers); do \
518           echo "#include \"$$h\"" >> htest.cc; \
519         done; \
520         $(CXXCOMPILE) -fsyntax-only htest.cc
521
522 ## This rule can be used to see if all the .class files verify
523 ## correctly.
524 class-check: libgcj-$(gcc_version).jar
525         @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
526         while read f; do \
527           echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
528           if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
529           :; else ok=1; fi; \
530         done; exit $$ok
531
532 ## This rule checks whether write_entries_to_file works properly.
533 write-entries-to-file-check:
534         @echo Creating list of files to link...
535         @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
536
537 ## ################################################################
538
539 ##
540 ## The `jv-convert' program and code to rebuild the converter header
541 ## files.
542 ##
543
544 ## it only makes sense to try to rebuild the JIS .h files on native
545 ## systems.
546 if NATIVE
547 if MAINTAINER_MODE
548 noinst_PROGRAMS = gen-from-JIS
549
550 gen_from_JIS_SOURCES = \
551         gnu/gcj/convert/gen-from-JIS.c \
552         gnu/gcj/convert/make-trie.c
553
554 gen_from_JIS_DEPENDENCIES = \
555         gnu/gcj/convert/JIS0201.h \
556         gnu/gcj/convert/JIS0208.h \
557         gnu/gcj/convert/JIS0212.h
558
559 $(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
560          ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
561
562 $(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
563          ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
564
565 $(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
566          ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
567
568 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
569 # You can get it from
570 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
571
572 $(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
573         echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
574         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
575         | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2)  /*\3 */|p' \
576         >> tmp-0201; \
577         mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
578
579 # The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
580 # You can get it from
581 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
582
583 $(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
584         echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
585         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
586         | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4)  /*\5 */|p' \
587         >> tmp-0208; \
588         mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
589
590 # The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
591 # You can get it from
592 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
593
594 $(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
595         echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
596         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
597         | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3)  /*\4 */|p' \
598         >> tmp-0212; \
599         mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
600
601 endif
602 endif 
603
604
605 jv_convert_SOURCES =
606 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
607 ## need this because we are explicitly using libtool to link using the
608 ## `.la' file.
609 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
610         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
611 jv_convert_LINK = $(GCJLINK)
612 ## We don't explicitly link in the libraries we need; libgcj.la brings
613 ## in all dependencies.  We need the -L so that gcj can find libgcj
614 ## with `-lgcj', but it must come first, otherwise the -L flags
615 ## brought in from libgcj.la would cause the install directories to be
616 ## searched before the build-tree ones, and we'd get errors because of
617 ## different libraries with the same SONAME from picky linkers such as
618 ## Solaris'.  FIXME: should be _libs on some systems.
619 jv_convert_LDADD = -L$(here)/.libs libgcj.la
620 ## Depend on the spec file to make sure it is up to date before
621 ## linking this program.
622 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
623
624 gcj_dbtool_SOURCES = \
625 gnu/gcj/tools/gcj_dbtool/natMain.cc
626
627 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
628 ## need this because we are explicitly using libtool to link using the
629 ## `.la' file.
630 gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
631         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
632 gcj_dbtool_LINK = $(GCJLINK)
633 ## We don't explicitly link in the libraries we need; libgcj.la brings
634 ## in all dependencies.  We need the -L so that gcj can find libgcj
635 ## with `-lgcj', but it must come first, otherwise the -L flags
636 ## brought in from libgcj.la would cause the install directories to be
637 ## searched before the build-tree ones, and we'd get errors because of
638 ## different libraries with the same SONAME from picky linkers such as
639 ## Solaris'.  FIXME: should be _libs on some systems.
640 gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$(here)/.libs libgcj.la
641 ## Depend on the spec file to make sure it is up to date before
642 ## linking this program.
643 gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la libgcj.spec
644
645 gij_SOURCES = 
646 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
647 ## need this because we are explicitly using libtool to link using the
648 ## `.la' file.
649 gij_LDFLAGS = -rpath $(libdir)/gcj-$(gcc_version) -rpath $(toolexeclibdir) \
650         -shared-libgcc $(THREADLDFLAGS)
651 gij_LINK = $(GCJLINK)
652 ## See jv_convert_LDADD.
653 gij_LDADD = -L$(here)/.libs libgij.la
654 ## Depend on the spec file to make sure it is up to date before
655 ## linking this program.
656 gij_DEPENDENCIES = libgij.la
657
658 ## Build an ecjx from a .jar.
659 ecjx_SOURCES =
660 ## We use the BC ABI here so that we don't need to compile ecj.jar.
661 ## Hopefully the user has compiled it into his system .db.
662 ## However, even if not it will run reasonably quickly.
663
664 ECJX_BASE_FLAGS = -findirect-dispatch \
665         --main=org.eclipse.jdt.internal.compiler.batch.GCCMain
666
667 if NATIVE
668
669 ecjx_LINK = $(GCJLINK)
670
671 if ENABLE_SHARED
672 ## Use ecj.jar at runtime.
673 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR)
674 else !ENABLE_SHARED
675 ## Use ecj.jar at compile time.
676 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
677 endif !ENABLE_SHARED
678
679 ecjx_LDADD = -L$(here)/.libs libgcj.la
680 ecjx_DEPENDENCIES = libgcj.la libgcj.spec
681
682 else !NATIVE
683
684 ecjx_LINK = $(GCJ_FOR_ECJX_LINK)
685 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
686 ecjx_LDADD = 
687 ecjx_DEPENDENCIES = 
688
689 endif !NATIVE
690
691 ## This is a dummy definition.
692 gappletviewer_SOURCES =
693 gappletviewer_LDFLAGS = --main=gnu.classpath.tools.appletviewer.Main \
694         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
695 gappletviewer_LINK = $(GCJLINK)
696 ## See jv_convert_LDADD.
697 gappletviewer_LDADD = -L$(here)/.libs libgcj-tools.la
698 gappletviewer_DEPENDENCIES = libgcj-tools.la
699
700 ## This is a dummy definition.
701 gjarsigner_SOURCES =
702 gjarsigner_LDFLAGS = --main=gnu.classpath.tools.jarsigner.Main \
703         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
704 gjarsigner_LINK = $(GCJLINK)
705 ## See jv_convert_LDADD.
706 gjarsigner_LDADD = -L$(here)/.libs libgcj-tools.la
707 gjarsigner_DEPENDENCIES = libgcj-tools.la
708
709 ## This is a dummy definition.
710 gkeytool_SOURCES =
711 gkeytool_LDFLAGS = --main=gnu.classpath.tools.keytool.Main \
712         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
713 gkeytool_LINK = $(GCJLINK)
714 ## See jv_convert_LDADD.
715 gkeytool_LDADD = -L$(here)/.libs libgcj-tools.la
716 gkeytool_DEPENDENCIES = libgcj-tools.la
717
718 ## This is a dummy definition.
719 gjar_SOURCES =
720 gjar_LDFLAGS = --main=gnu.classpath.tools.jar.Main \
721         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
722 gjar_LINK = $(GCJLINK)
723 ## See jv_convert_LDADD.
724 gjar_LDADD = -L$(here)/.libs libgcj-tools.la
725 gjar_DEPENDENCIES = libgcj-tools.la
726
727 ## This is a dummy definition.
728 gjavah_SOURCES =
729 gjavah_LDFLAGS = --main=gnu.classpath.tools.javah.Main \
730         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
731 gjavah_LINK = $(GCJLINK)
732 ## See jv_convert_LDADD.
733 gjavah_LDADD = -L$(here)/.libs libgcj-tools.la
734 gjavah_DEPENDENCIES = libgcj-tools.la
735
736 ## This is a dummy definition.
737 gnative2ascii_SOURCES =
738 gnative2ascii_LDFLAGS = --main=gnu.classpath.tools.native2ascii.Native2ASCII \
739         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
740 gnative2ascii_LINK = $(GCJLINK)
741 ## See jv_convert_LDADD.
742 gnative2ascii_LDADD = -L$(here)/.libs libgcj-tools.la
743 gnative2ascii_DEPENDENCIES = libgcj-tools.la
744
745 ## This is a dummy definition.
746 gorbd_SOURCES =
747 gorbd_LDFLAGS = --main=gnu.classpath.tools.orbd.Main \
748         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
749 gorbd_LINK = $(GCJLINK)
750 ## See jv_convert_LDADD.
751 gorbd_LDADD = -L$(here)/.libs libgcj-tools.la
752 gorbd_DEPENDENCIES = libgcj-tools.la
753
754 ## This is a dummy definition.
755 grmid_SOURCES =
756 grmid_LDFLAGS = --main=gnu.classpath.tools.rmid.Main \
757         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
758 grmid_LINK = $(GCJLINK)
759 ## See jv_convert_LDADD.
760 grmid_LDADD = -L$(here)/.libs libgcj-tools.la
761 grmid_DEPENDENCIES = libgcj-tools.la
762
763 ## This is a dummy definition.
764 gserialver_SOURCES =
765 gserialver_LDFLAGS = --main=gnu.classpath.tools.serialver.SerialVer \
766         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
767 gserialver_LINK = $(GCJLINK)
768 ## See jv_convert_LDADD.
769 gserialver_LDADD = -L$(here)/.libs libgcj-tools.la
770 gserialver_DEPENDENCIES = libgcj-tools.la
771
772 ## This is a dummy definition.
773 gtnameserv_SOURCES =
774 gtnameserv_LDFLAGS = --main=gnu.classpath.tools.tnameserv.Main \
775         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
776 gtnameserv_LINK = $(GCJLINK)
777 ## See jv_convert_LDADD.
778 gtnameserv_LDADD = -L$(here)/.libs libgcj-tools.la
779 gtnameserv_DEPENDENCIES = libgcj-tools.la
780
781 ## This is a dummy definition.
782 grmic_SOURCES =
783 grmic_LDFLAGS = --main=gnu.classpath.tools.rmic.Main \
784         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
785 grmic_LINK = $(GCJLINK)
786 ## See jv_convert_LDADD.
787 grmic_LDADD = -L$(here)/.libs libgcj-tools.la
788 grmic_DEPENDENCIES = libgcj-tools.la
789
790 ## This is a dummy definition.
791 grmiregistry_SOURCES =
792 grmiregistry_LDFLAGS = --main=gnu.classpath.tools.rmiregistry.Main \
793         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
794 grmiregistry_LINK = $(GCJLINK)
795 ## See jv_convert_LDADD.
796 grmiregistry_LDADD = -L$(here)/.libs libgcj-tools.la
797 grmiregistry_DEPENDENCIES = libgcj-tools.la
798
799 ## ################################################################
800
801 ## This lists all the C++ source files in subdirectories.
802 nat_source_files = \
803 gnu/classpath/jdwp/natVMFrame.cc \
804 gnu/classpath/jdwp/natVMMethod.cc \
805 gnu/classpath/jdwp/natVMVirtualMachine.cc \
806 gnu/classpath/natConfiguration.cc \
807 gnu/classpath/natSystemProperties.cc \
808 gnu/classpath/natVMStackWalker.cc \
809 gnu/gcj/natCore.cc \
810 gnu/gcj/convert/JIS0208_to_Unicode.cc \
811 gnu/gcj/convert/JIS0212_to_Unicode.cc \
812 gnu/gcj/convert/Unicode_to_JIS.cc \
813 gnu/gcj/convert/natIconv.cc \
814 gnu/gcj/convert/natInput_EUCJIS.cc \
815 gnu/gcj/convert/natInput_SJIS.cc \
816 gnu/gcj/convert/natOutput_EUCJIS.cc \
817 gnu/gcj/convert/natOutput_SJIS.cc \
818 gnu/gcj/io/natSimpleSHSStream.cc \
819 gnu/gcj/io/shs.cc \
820 gnu/gcj/jvmti/natBreakpoint.cc \
821 gnu/gcj/runtime/natFinalizerThread.cc \
822 gnu/gcj/runtime/natSharedLibLoader.cc \
823 gnu/gcj/runtime/natSystemClassLoader.cc \
824 gnu/gcj/runtime/natStringBuffer.cc \
825 gnu/gcj/util/natDebug.cc \
826 gnu/java/lang/natMainThread.cc \
827 gnu/java/lang/management/natVMClassLoadingMXBeanImpl.cc \
828 gnu/java/lang/management/natVMCompilationMXBeanImpl.cc \
829 gnu/java/lang/management/natVMGarbageCollectorMXBeanImpl.cc \
830 gnu/java/lang/management/natVMMemoryMXBeanImpl.cc \
831 gnu/java/lang/management/natVMMemoryManagerMXBeanImpl.cc \
832 gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc \
833 gnu/java/lang/management/natVMRuntimeMXBeanImpl.cc \
834 gnu/java/lang/management/natVMThreadMXBeanImpl.cc \
835 gnu/java/net/natPlainDatagramSocketImpl.cc \
836 gnu/java/net/natPlainSocketImpl.cc \
837 gnu/java/net/protocol/core/natCoreInputStream.cc \
838 gnu/java/nio/natPipeImpl.cc \
839 gnu/java/nio/natSelectorImpl.cc \
840 gnu/java/nio/natNIOServerSocket.cc \
841 gnu/java/nio/natVMChannel.cc \
842 gnu/java/nio/channels/natFileChannelImpl.cc \
843 java/io/natFile.cc \
844 java/io/natObjectInputStream.cc \
845 java/io/natVMObjectStreamClass.cc \
846 java/lang/management/natVMManagementFactory.cc \
847 java/lang/natCharacter.cc \
848 java/lang/natClass.cc \
849 java/lang/natClassLoader.cc \
850 java/lang/natConcreteProcess.cc \
851 java/lang/natDouble.cc \
852 java/lang/natFloat.cc \
853 java/lang/natMath.cc \
854 java/lang/natObject.cc \
855 java/lang/natRuntime.cc \
856 java/lang/natString.cc \
857 java/lang/natStringBuffer.cc \
858 java/lang/natStringBuilder.cc \
859 java/lang/natSystem.cc \
860 java/lang/natThread.cc \
861 java/lang/natThreadLocal.cc \
862 java/lang/natVMClassLoader.cc \
863 java/lang/natVMThrowable.cc \
864 java/lang/ref/natReference.cc \
865 java/lang/reflect/natArray.cc \
866 java/lang/reflect/natConstructor.cc \
867 java/lang/reflect/natField.cc \
868 java/lang/reflect/natMethod.cc \
869 java/lang/reflect/natVMProxy.cc \
870 java/net/natVMInetAddress.cc \
871 java/net/natVMNetworkInterface.cc \
872 java/net/natVMURLConnection.cc \
873 java/nio/channels/natVMChannels.cc \
874 java/nio/natDirectByteBufferImpl.cc \
875 java/security/natVMAccessController.cc \
876 java/security/natVMAccessControlState.cc \
877 java/text/natCollator.cc \
878 java/util/natVMTimeZone.cc \
879 java/util/concurrent/atomic/natAtomicLong.cc \
880 java/util/logging/natLogger.cc \
881 java/util/zip/natDeflater.cc \
882 java/util/zip/natInflater.cc \
883 sun/misc/natUnsafe.cc
884
885 xlib_nat_source_files = \
886 gnu/gcj/xlib/natClip.cc \
887 gnu/gcj/xlib/natColormap.cc \
888 gnu/gcj/xlib/natDisplay.cc \
889 gnu/gcj/xlib/natDrawable.cc \
890 gnu/gcj/xlib/natFont.cc \
891 gnu/gcj/xlib/natGC.cc \
892 gnu/gcj/xlib/natPixmap.cc \
893 gnu/gcj/xlib/natScreen.cc \
894 gnu/gcj/xlib/natVisual.cc \
895 gnu/gcj/xlib/natWMSizeHints.cc \
896 gnu/gcj/xlib/natWindow.cc \
897 gnu/gcj/xlib/natWindowAttributes.cc \
898 gnu/gcj/xlib/natXAnyEvent.cc \
899 gnu/gcj/xlib/natXButtonEvent.cc \
900 gnu/gcj/xlib/natXColor.cc \
901 gnu/gcj/xlib/natXConfigureEvent.cc \
902 gnu/gcj/xlib/natXException.cc \
903 gnu/gcj/xlib/natXExposeEvent.cc \
904 gnu/gcj/xlib/natXImage.cc \
905 gnu/gcj/xlib/natXUnmapEvent.cc
906
907 ## ################################################################
908
909 ##
910 ## Creating and installing sources.zip
911 ##
912
913 ## Create a zip holding all the sources.  This can be meaningfully
914 ## used in Eclipse.
915 src.zip:
916         -rm -f src.zip
917         here=`pwd`; \
918         ( \
919           ( cd $(srcdir)/classpath; \
920           find java gnu javax org sun -name '*.java' -print | \
921           while read file; do \
922 ## Ugly code to avoid "echo -C".  Must separate each entry by a newline
923 ## Gross but easy.
924             echo "x-C" | sed -e 's/^.//'; \
925             echo $(srcdir)/classpath; \
926             echo $$file; \
927           done ); \
928           ( cd $(srcdir)/classpath/external/sax; \
929           find org -name '*.java' -print | \
930           while read file; do \
931             echo "x-C" | sed -e 's/^.//'; \
932             echo $(srcdir)/classpath/external/sax; \
933             echo $$file; \
934           done ); \
935           ( cd $(srcdir)/classpath/external/relaxngDatatype; \
936           find org -name '*.java' -print | \
937           while read file; do \
938             echo "x-C" | sed -e 's/^.//'; \
939             echo $(srcdir)/classpath/external/relaxngDatatype; \
940             echo $$file; \
941           done ); \
942           ( cd $(srcdir)/classpath/external/w3c_dom; \
943           find org -name '*.java' -print | \
944           while read file; do \
945             echo "x-C" | sed -e 's/^.//'; \
946             echo $(srcdir)/classpath/external/w3c_dom; \
947             echo $$file; \
948           done ); \
949 ## Now the build tree.
950           ( cd classpath; \
951             find gnu java -name '*.java' -print | \
952             while read file; do \
953             echo "x-C" | sed -e 's/^.//'; \
954             echo `pwd`; \
955             echo $$file; \
956           done ); \
957         ) | \
958 ## Many of the above circumlocutions were because ZIP used to be a
959 ## relative path to fastjar.  It didn't seem worthwhile to change the
960 ## code when we moved to an external jar.
961         $(JAR) -cfM@ $$here/src.zip
962 ## Override GNU Classpath sources with libgcj replacements.
963         here=`pwd`; \
964         ( \
965           ( cd $(srcdir); \
966           find gnu java -name '*.java' -print | \
967           while read file; do \
968             echo "x-C" | sed -e 's/^.//'; \
969             echo $(srcdir); \
970             echo $$file; \
971           done ); \
972         ) | \
973         $(JAR) -ufM@ $$here/src.zip
974
975 ## We use a variable for this in case the user wants to override it.
976 sourcesdir = $(jardir)
977
978 install-src.zip: src.zip
979         $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
980
981
982 ## ################################################################
983
984 ##
985 ## Dependency tracking madness.
986 ##
987
988 ## This is an evil hack to work around an automake limitation.  We
989 ## need to ensure that all CNI headers are built, not just the ones
990 ## used internally by libgcj. We can't make the .o files depend on
991 ## nat_headers, because in that case we'll force a complete rebuild of
992 ## the C++ code whenever any .java file is touched.  So instead we
993 ## have a dummy rule which is only used once, namely the first time a
994 ## build is done.  On subsequent builds, the dependency tracking for
995 ## the .cc compilations will have picked up the .h files, and these
996 ## will be built directly as needed.
997
998 headers.stamp:
999 ## Note that we don't use a real dependency here, since we don't want
1000 ## to rebuild all the headers here when the header list changes.  If
1001 ## we did rebuild here, then any addition of a .java file would cause
1002 ## a large number of recompilations.
1003         $(MAKE) create-headers
1004         @echo > headers.stamp
1005
1006 headers_to_make = $(nat_headers)
1007 if XLIB_AWT
1008 headers_to_make += $(xlib_nat_headers)
1009 endif
1010
1011 create-headers: $(headers_to_make)
1012
1013 .PHONY: create-headers
1014
1015 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
1016 $(libgij_la_OBJECTS): headers.stamp
1017 $(libjvm_la_OBJECTS): headers.stamp
1018
1019 ## ################################################################
1020
1021 ##
1022 ## This section is for make and multilib madness.
1023 ##
1024
1025 # Work around what appears to be a GNU make bug handling MAKEFLAGS
1026 # values defined in terms of make variables, as is the case for CC and
1027 # friends when we are called from the top level Makefile.
1028 AM_MAKEFLAGS = \
1029         "AR_FLAGS=$(AR_FLAGS)" \
1030         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
1031         "CFLAGS=$(CFLAGS)" \
1032         "CXXFLAGS=$(CXXFLAGS)" \
1033         "CPPFLAGS=$(CPPFLAGS)" \
1034         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
1035         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
1036         "INSTALL=$(INSTALL)" \
1037         "INSTALL_DATA=$(INSTALL_DATA)" \
1038         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
1039         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
1040         "GCJFLAGS=$(GCJFLAGS)" \
1041         "LDFLAGS=$(LDFLAGS)" \
1042         "LIBCFLAGS=$(LIBCFLAGS)" \
1043         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
1044         "MAKE=$(MAKE)" \
1045         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
1046         "PICFLAG=$(PICFLAG)" \
1047         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
1048         "SHELL=$(SHELL)" \
1049         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
1050         "exec_prefix=$(exec_prefix)" \
1051         "infodir=$(infodir)" \
1052         "libdir=$(libdir)" \
1053         "prefix=$(prefix)" \
1054         "gxx_include_dir=$(gxx_include_dir)" \
1055         "AR=$(AR)" \
1056         "AS=$(AS)" \
1057         "LD=$(LD)" \
1058         "LIBCFLAGS=$(LIBCFLAGS)" \
1059         "NM=$(NM)" \
1060         "PICFLAG=$(PICFLAG)" \
1061         "RANLIB=$(RANLIB)" \
1062         "DESTDIR=$(DESTDIR)" \
1063         "JAR=$(JAR)"
1064
1065 # Subdir rules rely on $(FLAGS_TO_PASS)
1066 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
1067
1068 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
1069
1070 MAKEOVERRIDES=
1071
1072 # No install-html support yet.
1073 .PHONY: install-html
1074 install-html:
1075
1076 # Multilib support variables.
1077 MULTISRCTOP =
1078 MULTIBUILDTOP =
1079 MULTIDIRS =
1080 MULTISUBDIR =
1081 MULTIDO = true
1082 MULTICLEAN = true
1083
1084 # Multilib support.
1085 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
1086         maintainer-clean-multi
1087
1088 all-recursive: all-multi
1089 install-recursive: install-multi
1090 mostlyclean-recursive: mostlyclean-multi
1091 clean-recursive: clean-multi
1092 distclean-recursive: distclean-multi
1093 maintainer-clean-recursive: maintainer-clean-multi
1094
1095 all-multi:
1096         : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
1097 install-multi:
1098         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
1099 mostlyclean-multi:
1100         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
1101 clean-multi:
1102         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
1103 distclean-multi:
1104         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
1105 maintainer-clean-multi:
1106         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean