OSDN Git Service

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