OSDN Git Service

PR libgcj/29205:
[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         @X_CFLAGS@ \
118         $(WARNINGS) \
119         -D_GNU_SOURCE \
120         -DPREFIX="\"$(prefix)\"" \
121         -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\"" \
122         -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
123         -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
124         -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
125         -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
126         -DGCJ_VERSIONED_LIBDIR="\"$(dbexecdir)\"" \
127         -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
128         -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
129         -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\""
130
131 AM_GCJFLAGS = \
132         @LIBGCJ_JAVAFLAGS@ \
133         -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
134         --encoding=UTF-8 \
135         -Wno-deprecated -fbootstrap-classes
136
137 AM_CFLAGS = @LIBGCJ_CFLAGS@
138 if USING_GCC
139 AM_CFLAGS += $(WARNINGS)
140 endif
141
142 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
143 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
144
145 JCFLAGS = -g
146 JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
147
148 LIBFFIINCS = @LIBFFIINCS@
149
150 AM_CPPFLAGS = -I$(top_srcdir) \
151         -Iinclude -I$(top_srcdir)/include \
152         -I$(top_srcdir)/classpath/include \
153         -Iclasspath/include \
154         -I$(top_srcdir)/classpath/native/fdlibm \
155         $(GCINCS) $(THREADINCS) $(INCLTDL) \
156         $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
157
158 BOOTCLASSPATH = $(here)/classpath/lib
159
160 ## ################################################################
161
162 ##
163 ## How to build libgcj.a and libgcj.jar
164 ##
165
166 libgij_la_SOURCES = gij.cc
167 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
168 ## See jv_convert_LDADD.
169 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
170 ## The mysterious backslash in the grep pattern is consumed by make.
171 libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
172         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
173
174 libgcj_la_SOURCES = prims.cc jni.cc jvmti.cc exception.cc stacktrace.cc \
175         link.cc defineclass.cc interpret.cc verify.cc \
176         java/lang/Class.java java/lang/Object.java \
177         $(nat_source_files)
178
179 if USING_BOEHMGC
180 libgcj_la_SOURCES += boehm.cc
181 endif
182
183 if USING_NOGC
184 libgcj_la_SOURCES += nogc.cc
185 endif
186
187 if USING_POSIX_PLATFORM
188 libgcj_la_SOURCES += posix.cc
189 endif
190
191 if USING_WIN32_PLATFORM
192 libgcj_la_SOURCES += win32.cc
193 endif
194
195 if USING_DARWIN_CRT
196 libgcj_la_SOURCES += darwin.cc
197 endif
198
199 if USING_POSIX_THREADS
200 libgcj_la_SOURCES += posix-threads.cc
201 endif
202
203 if USING_WIN32_THREADS
204 libgcj_la_SOURCES += win32-threads.cc
205 endif
206
207 if USING_NO_THREADS
208 libgcj_la_SOURCES += no-threads.cc
209 endif
210
211 ## Objects from C++ sources in subdirs.
212 nat_files = $(nat_source_files:.cc=.lo)
213 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
214
215 # Include THREADLIBS here to ensure that the correct version of
216 # certain linuxthread functions get linked:
217 ## The mysterious backslash in the grep pattern is consumed by make.
218 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
219         $(LIBLTDL) $(SYS_ZLIBS) \
220         -version-info `grep -v '^\#' $(srcdir)/libtool-version`
221 libgcj_la_LIBADD = \
222         classpath/native/fdlibm/libfdlibm.la \
223         $(all_packages_source_files:.list=.lo) \
224         $(bc_objects) \
225         $(propertyo_files) \
226         $(LIBFFI) $(ZLIBS) $(GCLIBS)
227 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
228         $(all_packages_source_files:.list=.lo) \
229         $(LIBLTDL) $(libgcj_la_LIBADD)
230 libgcj_la_LINK = $(LIBLINK)
231
232 libgcj_tools_la_SOURCES = classpath/tools/tools.jar
233 libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes
234 libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
235  -version-info `grep -v '^\#' $(srcdir)/libtool-version`
236 libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
237 libgcj_tools_la_LINK = $(LIBLINK)
238
239 ## libjvm.so
240 libjvm_la_SOURCES = jni-libjvm.cc
241 libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
242 ## See jv_convert_LDADD.
243 libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
244 libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC)
245
246 ## The .db file.  This rule is only used for native builds, so it is
247 ## safe to invoke gcj-dbtool.
248 $(db_name): gcj-dbtool$(EXEEXT)
249 ## In case it exists already.
250         @rm -f $(db_name)
251 ## We don't actually care if it fails -- if it does, just make an
252 ## empty file.  This is simpler than trying to discover when mmap is
253 ## not available.
254         ./gcj-dbtool -n $(db_name) || touch $(db_name)
255
256 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
257 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
258 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
259         libgcj.la libgcj.spec \
260         $(lib_gnu_awt_xlib_la_LIBADD)
261 ## We require libstdc++-v3 to be in the same build tree.
262 lib_gnu_awt_xlib_la_CPPFLAGS = \
263         $(AM_CPPFLAGS) \
264         -I../libstdc++-v3/include \
265         -I../libstdc++-v3/include/$(target_noncanonical) \
266         -I$(srcdir)/../libstdc++-v3/libsupc++
267 ## The mysterious backslash in the grep pattern is consumed by make.
268 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
269         @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
270         -rpath $(toolexeclibdir) \
271         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
272 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
273
274 ## Support for libgcj_bc: dummy shared library.
275 ##
276 ## This lets us have one soname in BC objects and another in C++ ABI objects.
277 libgcj_bc_la_SOURCES = libgcj_bc.c
278 libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0
279 libgcj_bc_la_LIBADD = libgcj.la
280 libgcj_bc_la_DEPENDENCIES = libgcj.la
281 libgcj_bc_la_LINK = $(LIBLINK)
282 ## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
283 ## USE_LIBGCJ_BC shouldn't be set on other targets.
284 libgcj_bc_dummy_LINK = $(CC) -L$(here)/.libs $(CFLAGS) $(LDFLAGS) -shared \
285         -fPIC -nostdlib
286
287 ## This rule creates the libgcj_bc dummy library in the .libs directory, for use
288 ## when testing.
289 libgcj_bc.la: $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_DEPENDENCIES)
290         $(libgcj_bc_la_LINK) $(am_libgcj_bc_la_rpath) $(libgcj_bc_la_LDFLAGS) \
291         $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS) || exit; \
292         rm .libs/libgcj_bc.so; \
293         mv .libs/libgcj_bc.so.1.0.0 .libs/libgcj_bc.so; \
294         $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
295         -o .libs/libgcj_bc.so.1.0.0 -lgcj || exit; \
296         rm .libs/libgcj_bc.so.1; \
297         $(LN_S) libgcj_bc.so.1.0.0 .libs/libgcj_bc.so.1
298
299 ## Note that property_files is defined in sources.am.
300 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
301
302 $(propertyo_files): %.lo: classpath/resource/%
303         $(mkinstalldirs) `dirname $@`; \
304         $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
305
306 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
307         cd classpath/lib; $(JAR) -cfM \
308             ../../libgcj-$(gcc_version).jar gnu java javax org
309
310 libgcj-tools-$(gcc_version).jar: classpath/tools/tools.jar
311         cp $< $@
312
313 CLEANFILES = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
314 DISTCLEANFILES = native.dirs
315
316 mostlyclean-local:
317 ## Use libtool rm to remove each libtool object
318         find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
319
320 distclean-local:
321 ## Remove every .d file that was created.
322         find . -name '*.d' -print | xargs rm -f
323
324 # Just remove the objects from C++ sources, for testing the C++ compiler.
325 clean-nat:
326         rm -f $(nat_files) $(xlib_nat_files)
327
328 SUFFIXES = .class .java .h .properties .list
329
330 ## Pass the list of object files to libtool in a temporary file to
331 ## avoid tripping platform command line length limits.
332 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
333         @echo Creating list of files to link...
334         @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
335         $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
336         -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
337
338 ## ################################################################
339
340 ## Compiling a list of java sources to a single .o.
341
342 %.lo: %.list
343         $(LTGCJCOMPILE) -c -o $@ -MT $@ -MD -MP -MF $(basename $@).deps @$<
344
345 ## ################################################################
346
347 ## This pulls in a number of variable and target definitions.
348 include sources.am
349
350 ## ################################################################
351
352 ##
353 ## How to build header files.
354 ##
355
356 ## We have special rules for certain headers.
357 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
358         java/lang/String.h java/lang/reflect/Constructor.h \
359         java/lang/reflect/Field.h java/lang/reflect/Method.h \
360         java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
361
362 generic_header_files = $(filter-out $(omitted_headers),$(ordinary_header_files) $(xlib_nat_headers)) \
363         gnu/gcj/tools/gcj_dbtool/Main.h
364
365 $(generic_header_files): %.h: classpath/lib/%.class
366         name=`echo $< | sed -e 's/\.class$$//' -e 's,classpath/lib/,,'`; \
367         $(mkinstalldirs) `dirname $$name`; \
368         $(GCJH) -d . -classpath '' -bootclasspath classpath/lib $$name
369
370 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
371         java/io/ObjectInputStream$$GetField.h \
372         java/nio/DirectByteBufferImpl$$ReadWrite.h \
373         java/nio/channels/Pipe$$SinkChannel.h \
374         java/nio/channels/Pipe$$SourceChannel.h \
375         java/lang/reflect/Proxy$$ProxyData.h \
376         java/lang/reflect/Proxy$$ProxyType.h \
377         gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
378         gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
379         gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
380         gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
381         $(PLATFORM_INNER_NAT_HDRS)
382
383 nat_headers = $(ordinary_header_files) $(inner_nat_headers) \
384         gnu/gcj/tools/gcj_dbtool/Main.h
385 nat_headers_install = $(ordinary_header_files)
386
387 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
388
389 java/lang/ClassLoader.h: classpath/lib/java/lang/ClassLoader.class
390         $(GCJH) -classpath '' -bootclasspath classpath/lib \
391                 -prepend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
392                 -prepend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
393                 -friend 'jclass (::_Jv_FindClass) (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
394                 -friend 'void ::_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
395                 java/lang/ClassLoader
396
397 java/lang/Thread.h: classpath/lib/java/lang/Thread.class
398         $(GCJH) -classpath '' -bootclasspath classpath/lib \
399                 -prepend 'class _Jv_JNIEnv;' \
400                 -prepend 'class _Jv_Thread_t;' \
401                 -prepend '#define _JV_NOT_OWNER 1' \
402                 -prepend '#define _JV_INTERRUPTED 2' \
403                 -prepend '_Jv_JNIEnv * _Jv_GetCurrentJNIEnv ();' \
404                 -prepend 'void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
405                 -prepend 'void _Jv_ThreadRun (java::lang::Thread* thread);' \
406                 -prepend 'jint _Jv_AttachCurrentThread(java::lang::Thread* thread);' \
407                 -prepend 'java::lang::Thread* _Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
408                 -prepend 'java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
409                 -prepend 'jint _Jv_DetachCurrentThread ();' \
410                 -prepend '_Jv_Thread_t* _Jv_ThreadGetData (java::lang::Thread* thread);' \
411                 -friend '_Jv_JNIEnv * ::_Jv_GetCurrentJNIEnv ();' \
412                 -friend 'void ::_Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
413                 -friend 'void ::_Jv_ThreadRun (java::lang::Thread* thread);' \
414                 -friend 'jint (::_Jv_AttachCurrentThread) (java::lang::Thread* thread);' \
415                 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
416                 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
417                 -friend 'jint (::_Jv_DetachCurrentThread) ();' \
418                 -friend '_Jv_Thread_t* ::_Jv_ThreadGetData (java::lang::Thread* thread);' \
419                 java/lang/Thread
420
421 java/lang/String.h: classpath/lib/java/lang/String.class
422         $(GCJH) -classpath '' -bootclasspath classpath/lib \
423             -prepend 'jchar* _Jv_GetStringChars (jstring str);' \
424             -prepend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
425             -prepend 'jstring* _Jv_StringGetSlot (jstring);' \
426             -prepend 'jstring _Jv_NewStringUtf8Const (_Jv_Utf8Const* str);' \
427             -prepend 'jstring _Jv_NewStringLatin1 (const char*, jsize);' \
428             -prepend 'jstring _Jv_AllocString (jsize);' \
429             -friend 'jchar* ::_Jv_GetStringChars (jstring str);' \
430             -friend 'jstring* ::_Jv_StringFindSlot (jchar*, jint, jint);' \
431             -friend 'jstring* ::_Jv_StringGetSlot (jstring);' \
432             -friend 'jstring (::_Jv_NewStringUtf8Const) (_Jv_Utf8Const* str);' \
433             -friend 'jstring (::_Jv_NewStringLatin1) (const char*, jsize);' \
434             -friend 'jstring (::_Jv_AllocString) (jsize);' \
435             java/lang/String
436
437 java/lang/reflect/Constructor.h: classpath/lib/java/lang/reflect/Constructor.class
438         $(GCJH) -classpath '' -bootclasspath classpath/lib \
439             -prepend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
440             -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
441             -friend 'jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *);' \
442             -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
443             -friend 'class java::lang::Class;' \
444             java/lang/reflect/Constructor
445
446 java/lang/reflect/Field.h: classpath/lib/java/lang/reflect/Field.class
447         $(GCJH) -classpath '' -bootclasspath classpath/lib \
448             -prepend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
449             -prepend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
450             -friend 'jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *);' \
451             -friend 'jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
452             -friend 'class java::lang::Class;' \
453             java/lang/reflect/Field
454
455 java/lang/reflect/Method.h: classpath/lib/java/lang/reflect/Method.class
456         $(GCJH) -classpath '' -bootclasspath classpath/lib \
457             -prepend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
458             -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
459             -friend 'jmethodID (::_Jv_FromReflectedMethod) (java::lang::reflect::Method *);' \
460             -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
461             -friend 'class java::lang::Class;' \
462             -friend 'class java::io::ObjectInputStream;' \
463             java/lang/reflect/Method
464
465 java/lang/reflect/Proxy.h: classpath/lib/java/lang/reflect/Proxy.class
466         $(GCJH) -classpath '' -bootclasspath classpath/lib \
467             java/lang/reflect/Proxy
468
469 java/lang/reflect/Proxy$$ProxyData.h: classpath/lib/java/lang/reflect/Proxy.class
470         $(GCJH) -classpath '' -bootclasspath classpath/lib \
471         'java/lang/reflect/Proxy$$ProxyData'
472
473 java/lang/reflect/Proxy$$ProxyType.h: classpath/lib/java/lang/reflect/Proxy.class
474         $(GCJH) -classpath '' -bootclasspath classpath/lib \
475         'java/lang/reflect/Proxy$$ProxyType'
476
477 gnu/gcj/runtime/ExtensionClassLoader.h: classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
478         $(GCJH) -classpath '' -bootclasspath classpath/lib \
479             -friend 'class ::java::lang::ClassLoader;' \
480             gnu/gcj/runtime/ExtensionClassLoader
481
482 java/io/ObjectInputStream$$GetField.h: classpath/lib/java/io/ObjectInputStream.class
483         $(GCJH) -classpath '' -bootclasspath classpath/lib \
484         'java/io/ObjectInputStream$$GetField'
485
486 java/io/ObjectOutputStream$$PutField.h: classpath/lib/java/io/ObjectOutputStream.class
487         $(GCJH) -classpath '' -bootclasspath classpath/lib \
488         'java/io/ObjectOutputStream$$PutField'
489
490 java/nio/DirectByteBufferImpl$$ReadWrite.h: classpath/lib/java/nio/DirectByteBufferImpl.class
491         $(GCJH) -classpath '' -bootclasspath classpath/lib \
492         'java/nio/DirectByteBufferImpl$$ReadWrite'
493
494 java/nio/channels/Pipe$$SinkChannel.h: classpath/lib/java/nio/channels/Pipe.class
495         $(GCJH) -classpath '' -bootclasspath classpath/lib \
496         'java/nio/channels/Pipe$$SinkChannel'
497
498 java/nio/channels/Pipe$$SourceChannel.h: classpath/lib/java/nio/channels/Pipe.class
499         $(GCJH) -classpath '' -bootclasspath classpath/lib \
500         'java/nio/channels/Pipe$$SourceChannel'
501
502 gnu/java/net/PlainSocketImpl$$SocketInputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
503         $(GCJH) -classpath '' -bootclasspath classpath/lib \
504         'gnu/java/net/PlainSocketImpl$$SocketInputStream'
505
506 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
507         $(GCJH) -classpath '' -bootclasspath classpath/lib \
508         'gnu/java/net/PlainSocketImpl$$SocketOutputStream'
509
510 gnu/java/nio/PipeImpl$$SinkChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
511         $(GCJH) -classpath '' -bootclasspath classpath/lib \
512         'gnu/java/nio/PipeImpl$$SinkChannelImpl'
513
514 gnu/java/nio/PipeImpl$$SourceChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
515         $(GCJH) -classpath '' -bootclasspath classpath/lib \
516         'gnu/java/nio/PipeImpl$$SourceChannelImpl'
517
518 ## Only used by PosixProcess.java
519 java/lang/ConcreteProcess$$ProcessManager.h: classpath/lib/java/lang/ConcreteProcess.class
520         $(GCJH) -classpath '' -bootclasspath classpath/lib \
521         'java/lang/ConcreteProcess$$ProcessManager'
522
523 ## Headers we maintain by hand and which we want to install.
524 extra_headers = java/lang/Object.h java/lang/Class.h
525
526 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
527         @:
528
529 ## Support for libgcj_bc: dummy shared library used only at link-time.
530 if USE_LIBGCJ_BC
531 ## Install libgcj_bc dummy lib in the target directory. We also need to delete
532 ## libtool's .la file, this prevents libtool resetting the lib again 
533 ## later.
534 install-exec-hook: install-toolexeclibLTLIBRARIES
535         @echo Installing dummy lib libgcj_bc.so.1.0.0; \
536         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
537         mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
538         $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
539         -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \
540         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
541         $(LN_S) libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
542         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.la;
543 endif
544
545 ## Install the headers.  It is fairly ugly that we have to do this by
546 ## hand.
547 install-data-local:
548         $(PRE_INSTALL)
549 ## Install the .pc file.
550         @pc_version=`echo $(GCJVERSION) | sed -e 's/[.][^.]*$$//'`; \
551         file="libgcj-$${pc_version}.pc"; \
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/runtime/natFinalizerThread.cc \
821 gnu/gcj/runtime/natSharedLibLoader.cc \
822 gnu/gcj/runtime/natSystemClassLoader.cc \
823 gnu/gcj/runtime/natStringBuffer.cc \
824 gnu/gcj/util/natDebug.cc \
825 gnu/java/lang/natMainThread.cc \
826 gnu/java/net/natPlainDatagramSocketImpl.cc \
827 gnu/java/net/natPlainSocketImpl.cc \
828 gnu/java/net/protocol/core/natCoreInputStream.cc \
829 gnu/java/nio/natPipeImpl.cc \
830 gnu/java/nio/natSelectorImpl.cc \
831 gnu/java/nio/natNIOServerSocket.cc \
832 gnu/java/nio/channels/natFileChannelImpl.cc \
833 java/io/natFile.cc \
834 java/io/natObjectInputStream.cc \
835 java/io/natVMObjectStreamClass.cc \
836 java/lang/natCharacter.cc \
837 java/lang/natClass.cc \
838 java/lang/natClassLoader.cc \
839 java/lang/natConcreteProcess.cc \
840 java/lang/natDouble.cc \
841 java/lang/natFloat.cc \
842 java/lang/natMath.cc \
843 java/lang/natObject.cc \
844 java/lang/natRuntime.cc \
845 java/lang/natString.cc \
846 java/lang/natStringBuffer.cc \
847 java/lang/natStringBuilder.cc \
848 java/lang/natSystem.cc \
849 java/lang/natThread.cc \
850 java/lang/natVMClassLoader.cc \
851 java/lang/natVMSecurityManager.cc \
852 java/lang/natVMThrowable.cc \
853 java/lang/ref/natReference.cc \
854 java/lang/reflect/natArray.cc \
855 java/lang/reflect/natConstructor.cc \
856 java/lang/reflect/natField.cc \
857 java/lang/reflect/natMethod.cc \
858 java/net/natVMNetworkInterface.cc \
859 java/net/natInetAddress.cc \
860 java/net/natURLClassLoader.cc \
861 java/nio/channels/natVMChannels.cc \
862 java/nio/natDirectByteBufferImpl.cc \
863 java/security/natVMAccessController.cc \
864 java/security/natVMAccessControlState.cc \
865 java/text/natCollator.cc \
866 java/util/natResourceBundle.cc \
867 java/util/natVMTimeZone.cc \
868 java/util/logging/natLogger.cc \
869 java/util/zip/natDeflater.cc \
870 java/util/zip/natInflater.cc
871
872 xlib_nat_source_files = \
873 gnu/gcj/xlib/natClip.cc \
874 gnu/gcj/xlib/natColormap.cc \
875 gnu/gcj/xlib/natDisplay.cc \
876 gnu/gcj/xlib/natDrawable.cc \
877 gnu/gcj/xlib/natFont.cc \
878 gnu/gcj/xlib/natGC.cc \
879 gnu/gcj/xlib/natPixmap.cc \
880 gnu/gcj/xlib/natScreen.cc \
881 gnu/gcj/xlib/natVisual.cc \
882 gnu/gcj/xlib/natWMSizeHints.cc \
883 gnu/gcj/xlib/natWindow.cc \
884 gnu/gcj/xlib/natWindowAttributes.cc \
885 gnu/gcj/xlib/natXAnyEvent.cc \
886 gnu/gcj/xlib/natXButtonEvent.cc \
887 gnu/gcj/xlib/natXColor.cc \
888 gnu/gcj/xlib/natXConfigureEvent.cc \
889 gnu/gcj/xlib/natXException.cc \
890 gnu/gcj/xlib/natXExposeEvent.cc \
891 gnu/gcj/xlib/natXImage.cc \
892 gnu/gcj/xlib/natXUnmapEvent.cc
893
894 ## ################################################################
895
896 ##
897 ## Creating and installing sources.zip
898 ##
899
900 ## Create a zip holding all the sources.  This can be meaningfully
901 ## used in Eclipse.
902 src.zip:
903         -rm -f src.zip
904         here=`pwd`; \
905         ( \
906           ( cd $(srcdir)/classpath; \
907           find java gnu javax org -name '*.java' -print | \
908           while read file; do \
909 ## Ugly code to avoid "echo -C".  Must separate each entry by a newline
910 ## Gross but easy.
911             echo "x-C" | sed -e 's/^.//'; \
912             echo $(srcdir)/classpath; \
913             echo $$file; \
914           done ); \
915 ## Now the build tree.
916           ( cd classpath; \
917             find gnu java -name '*.java' -print | \
918             while read file; do \
919             echo "x-C" | sed -e 's/^.//'; \
920             echo `pwd`; \
921             echo $$file; \
922           done ); \
923         ) | \
924 ## Many of the above circumlocutions were because ZIP used to be a
925 ## relative path to fastjar.  It didn't seem worthwhile to change the
926 ## code when we moved to an external jar.
927         $(JAR) -cfM@ $$here/src.zip
928 ## Override GNU Classpath sources with libgcj replacements.
929         here=`pwd`; \
930         ( \
931           ( cd $(srcdir); \
932           find gnu java -name '*.java' -print | \
933           while read file; do \
934             echo "x-C" | sed -e 's/^.//'; \
935             echo $(srcdir); \
936             echo $$file; \
937           done ); \
938         ) | \
939         $(JAR) -ufM@ $$here/src.zip
940
941 ## We use a variable for this in case the user wants to override it.
942 sourcesdir = $(jardir)
943
944 install-src.zip: src.zip
945         $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
946
947
948 ## ################################################################
949
950 ##
951 ## Dependency tracking madness.
952 ##
953
954 ## This is an evil hack to work around an automake limitation.  We
955 ## need to ensure that all CNI headers are built, not just the ones
956 ## used internally by libgcj. We can't make the .o files depend on
957 ## nat_headers, because in that case we'll force a complete rebuild of
958 ## the C++ code whenever any .java file is touched.  So instead we
959 ## have a dummy rule which is only used once, namely the first time a
960 ## build is done.  On subsequent builds, the dependency tracking for
961 ## the .cc compilations will have picked up the .h files, and these
962 ## will be built directly as needed.
963
964 headers.stamp:
965 ## Note that we don't use a real dependency here, since we don't want
966 ## to rebuild all the headers here when the header list changes.  If
967 ## we did rebuild here, then any addition of a .java file would cause
968 ## a large number of recompilations.
969         $(MAKE) create-headers
970         @echo > headers.stamp
971
972 headers_to_make = $(nat_headers)
973 if XLIB_AWT
974 headers_to_make += $(xlib_nat_headers)
975 endif
976
977 create-headers: $(headers_to_make)
978
979 .PHONY: create-headers
980
981 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
982 $(libgij_la_OBJECTS): headers.stamp
983 $(libjvm_la_OBJECTS): headers.stamp
984
985 ## ################################################################
986
987 ##
988 ## This section is for make and multilib madness.
989 ##
990
991 # Work around what appears to be a GNU make bug handling MAKEFLAGS
992 # values defined in terms of make variables, as is the case for CC and
993 # friends when we are called from the top level Makefile.
994 AM_MAKEFLAGS = \
995         "AR_FLAGS=$(AR_FLAGS)" \
996         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
997         "CFLAGS=$(CFLAGS)" \
998         "CXXFLAGS=$(CXXFLAGS)" \
999         "CPPFLAGS=$(CPPFLAGS)" \
1000         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
1001         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
1002         "INSTALL=$(INSTALL)" \
1003         "INSTALL_DATA=$(INSTALL_DATA)" \
1004         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
1005         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
1006         "GCJFLAGS=$(GCJFLAGS)" \
1007         "LDFLAGS=$(LDFLAGS)" \
1008         "LIBCFLAGS=$(LIBCFLAGS)" \
1009         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
1010         "MAKE=$(MAKE)" \
1011         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
1012         "PICFLAG=$(PICFLAG)" \
1013         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
1014         "SHELL=$(SHELL)" \
1015         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
1016         "exec_prefix=$(exec_prefix)" \
1017         "infodir=$(infodir)" \
1018         "libdir=$(libdir)" \
1019         "prefix=$(prefix)" \
1020         "gxx_include_dir=$(gxx_include_dir)" \
1021         "AR=$(AR)" \
1022         "AS=$(AS)" \
1023         "LD=$(LD)" \
1024         "LIBCFLAGS=$(LIBCFLAGS)" \
1025         "NM=$(NM)" \
1026         "PICFLAG=$(PICFLAG)" \
1027         "RANLIB=$(RANLIB)" \
1028         "DESTDIR=$(DESTDIR)"
1029
1030 # Subdir rules rely on $(FLAGS_TO_PASS)
1031 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
1032
1033 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
1034
1035 MAKEOVERRIDES=
1036
1037 # No install-html support yet.
1038 .PHONY: install-html
1039 install-html:
1040
1041 # Multilib support variables.
1042 MULTISRCTOP =
1043 MULTIBUILDTOP =
1044 MULTIDIRS =
1045 MULTISUBDIR =
1046 MULTIDO = true
1047 MULTICLEAN = true
1048
1049 # Multilib support.
1050 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
1051         maintainer-clean-multi
1052
1053 all-recursive: all-multi
1054 install-recursive: install-multi
1055 mostlyclean-recursive: mostlyclean-multi
1056 clean-recursive: clean-multi
1057 distclean-recursive: distclean-multi
1058 maintainer-clean-recursive: maintainer-clean-multi
1059
1060 all-multi:
1061         : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
1062 install-multi:
1063         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
1064 mostlyclean-multi:
1065         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
1066 clean-multi:
1067         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
1068 distclean-multi:
1069         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
1070 maintainer-clean-multi:
1071         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean