OSDN Git Service

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