OSDN Git Service

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