OSDN Git Service

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