OSDN Git Service

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