OSDN Git Service

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