1 ## Process this file with automake to produce Makefile.in.
3 AUTOMAKE_OPTIONS = foreign subdir-objects
5 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
7 # May be used by various substitution variables.
8 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
10 SUBDIRS = $(DIRLTDL) gcj include classpath
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
20 # $(1): variable containing entries to iterate over
22 write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
24 ## ################################################################
26 # autoconf2.13's target_alias
27 target_noncanonical = @target_noncanonical@
29 # This is required by TL_AC_GXX_INCLUDE_DIR.
30 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
33 ## What gets installed, and where.
36 toolexeclib_LTLIBRARIES = libgcj.la libgij.la
37 toolexecmainlib_DATA = libgcj.spec
40 toolexeclib_LTLIBRARIES += lib-gnu-awt-xlib.la
44 toolexeclib_LTLIBRARIES += lib-gnu-java-awt-peer-qt.la
47 pkgconfigdir = $(libdir)/pkgconfig
48 pkgconfig_DATA = libgcj.pc
50 jardir = $(datadir)/java
51 jar_DATA = libgcj-$(gcc_version).jar
54 JAVA_HOME_DIR = $(JAVA_HOME)
55 BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
57 JAVA_HOME_DIR = $(prefix)
58 BOOT_CLASS_PATH_DIR = $(jardir)/$(jar_DATA)
61 ## FIXME: Using libdir violates GNU coding standards.
62 secdir = $(libdir)/security
63 ## Where to install default logging property file.
66 ## Name of the default .db.
68 ## Compiler specific component of the .db file
69 db_pathtail = gcj-$(gcc_version)/$(db_name)
71 ## For now, only on native systems. FIXME.
73 bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool
75 ## It is convenient to actually build and install the default database
76 ## when gcj-dbtool is available.
77 dbexec_DATA = $(db_name)
80 bin_SCRIPTS = addr2name.awk
82 ## ################################################################
85 ## Compilers and compilation flags.
89 bin_SCRIPTS += scripts/jar
92 ## The compiler with whatever flags we want for both -c and -C
94 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
96 extra_ldflags_libjava = @extra_ldflags_libjava@
98 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
100 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
101 $(LDFLAGS) $(extra_ldflags_libjava) -o $@
103 GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
105 WARNINGS = -Wextra -Wall
106 ## Some systems don't allow `$' in identifiers by default, so we force
107 ## it with -fdollars-in-identifiers. -Wswitch-enum detects bugs in
108 ## the verifier implementation, and maybe other places. We need
109 ## _GNU_SOURCE defined for some Linux builds. It doesn't hurt to
110 ## always define it. Some systems, including Linux, need
111 ## -D_FILE_OFFSET_BITS=64 to enable > 2GB file support.
114 -fnon-call-exceptions \
116 -fdollars-in-identifiers \
118 -D_FILE_OFFSET_BITS=64 \
123 -DPREFIX="\"$(prefix)\"" \
124 -DLIBDIR="\"$(libdir)\"" \
125 -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
126 -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
127 -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
128 -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
129 -DGCJ_VERSIONED_LIBDIR="\"$(libdir)/gcj-$(gcc_version)\"" \
130 -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
131 -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
132 -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\"" \
133 -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\""
137 -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
139 -Wno-deprecated -fbootstrap-classes
141 AM_CFLAGS = @LIBGCJ_CFLAGS@
143 AM_CFLAGS += $(WARNINGS)
146 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
147 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
150 JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
152 LIBFFIINCS = @LIBFFIINCS@
154 AM_CPPFLAGS = -I$(top_srcdir) \
155 -Iinclude -I$(top_srcdir)/include \
156 -I$(top_srcdir)/classpath/include \
157 -Iclasspath/include \
158 -I$(top_srcdir)/classpath/native/fdlibm \
159 $(GCINCS) $(THREADINCS) $(INCLTDL) \
160 $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
162 BOOTCLASSPATH = $(here)/classpath/lib
164 ## ################################################################
166 all_property_files = $(property_files) \
167 java/util/logging/logging.properties
170 ## How to build libgcj.a and libgcj.jar
173 libgij_la_SOURCES = gij.cc
174 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
175 ## See jv_convert_LDADD.
176 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
177 ## The mysterious backslash in the grep pattern is consumed by make.
178 libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
179 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
181 libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
182 link.cc defineclass.cc interpret.cc verify.cc \
183 java/lang/Class.java java/lang/Object.java \
187 libgcj_la_SOURCES += boehm.cc
191 libgcj_la_SOURCES += nogc.cc
194 if USING_POSIX_PLATFORM
195 libgcj_la_SOURCES += posix.cc
198 if USING_WIN32_PLATFORM
199 libgcj_la_SOURCES += win32.cc
203 libgcj_la_SOURCES += darwin.cc
206 if USING_POSIX_THREADS
207 libgcj_la_SOURCES += posix-threads.cc
210 if USING_WIN32_THREADS
211 libgcj_la_SOURCES += win32-threads.cc
215 libgcj_la_SOURCES += no-threads.cc
218 ## Objects from C++ sources in subdirs.
219 nat_files = $(nat_source_files:.cc=.lo)
220 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
222 # Include THREADLIBS here to ensure that the correct version of
223 # certain linuxthread functions get linked:
224 ## The mysterious backslash in the grep pattern is consumed by make.
225 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
226 $(LIBLTDL) $(SYS_ZLIBS) \
227 -version-info `grep -v '^\#' $(srcdir)/libtool-version`
229 classpath/native/fdlibm/libfdlibm.la \
230 $(all_packages_source_files:.list=.lo) \
233 $(LIBFFI) $(ZLIBS) $(GCLIBS)
234 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
235 $(all_packages_source_files:.list=.lo) \
236 $(LIBLTDL) $(libgcj_la_LIBADD)
237 libgcj_la_LINK = $(LIBLINK)
240 ## The .db file. This rule is only used for native builds, so it is
241 ## safe to invoke gcj-dbtool.
242 $(db_name): gcj-dbtool$(EXEEXT)
243 ## In case it exists already.
245 ## We don't actually care if it fails -- if it does, just make an
246 ## empty file. This is simpler than trying to discover when mmap is
248 ./gcj-dbtool -n $(db_name) || touch $(db_name)
250 lib_gnu_java_awt_peer_qt_la_SOURCES =
251 lib_gnu_java_awt_peer_qt_la_LIBADD = \
252 gnu-java-awt-peer-qt.lo \
253 classpath/native/jni/qt-peer/libqtpeer.la
254 lib_gnu_java_awt_peer_qt_la_DEPENDENCIES = gnu-java-awt-peer-qt.lo \
255 classpath/native/jni/qt-peer/libqtpeer.la \
256 libgcj-$(gcc_version).jar libgcj.la libgcj.spec
257 ## The mysterious backslash in the grep pattern is consumed by make.
258 lib_gnu_java_awt_peer_qt_la_LDFLAGS = \
259 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
260 lib_gnu_java_awt_peer_qt_la_LINK = $(LIBLINK)
262 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
263 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
264 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
265 libgcj.la libgcj.spec \
266 $(lib_gnu_awt_xlib_la_LIBADD)
267 ## We require libstdc++-v3 to be in the same build tree.
268 lib_gnu_awt_xlib_la_CPPFLAGS = \
270 -I../libstdc++-v3/include \
271 -I../libstdc++-v3/include/$(target_noncanonical) \
272 -I$(srcdir)/../libstdc++-v3/libsupc++
273 ## The mysterious backslash in the grep pattern is consumed by make.
274 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
275 @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
276 -rpath $(toolexeclibdir) \
277 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
278 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
280 ## Note that property_files is defined in sources.am.
281 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
283 $(propertyo_files): %.lo: classpath/resource/%
284 $(mkinstalldirs) `dirname $@`; \
285 $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
287 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
288 cd classpath/lib; $(JAR) -cfM \
289 ../../libgcj-$(gcc_version).jar gnu java javax org
291 CLEANFILES = libgcj-$(gcc_version).jar
292 DISTCLEANFILES = native.dirs
295 ## Use libtool rm to remove each libtool object
296 find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
299 ## Remove every .d file that was created.
300 find . -name '*.d' -print | xargs rm -f
302 # Just remove the objects from C++ sources, for testing the C++ compiler.
304 rm -f $(nat_files) $(xlib_nat_files)
306 SUFFIXES = .class .java .h .properties .list
308 ## Pass the list of object files to libtool in a temporary file to
309 ## avoid tripping platform command line length limits.
310 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
311 @echo Creating list of files to link...
312 @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
313 $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
314 -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
316 ## ################################################################
318 ## Compiling a list of java sources to a single .o.
321 $(LTGCJCOMPILE) -c -o $@ -MT $@ -MD -MP -MF $(basename $@).deps @$<
323 ## ################################################################
325 ## This pulls in a number of variable and target definitions.
328 ## ################################################################
331 ## How to build header files.
334 ## We have special rules for certain headers.
335 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
336 java/lang/String.h java/lang/reflect/Constructor.h \
337 java/lang/reflect/Field.h java/lang/reflect/Method.h \
338 java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
340 generic_header_files = $(filter-out $(omitted_headers),$(ordinary_header_files) $(xlib_nat_headers)) \
341 gnu/gcj/tools/gcj_dbtool/Main.h
343 $(generic_header_files): %.h: classpath/lib/%.class
344 name=`echo $< | sed -e 's/\.class$$//' -e 's,classpath/lib/,,'`; \
345 $(mkinstalldirs) `dirname $$name`; \
346 $(GCJH) -d . -classpath '' -bootclasspath classpath/lib $$name
348 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
349 java/io/ObjectInputStream$$GetField.h \
350 java/nio/DirectByteBufferImpl$$ReadWrite.h \
351 java/nio/channels/Pipe$$SinkChannel.h \
352 java/nio/channels/Pipe$$SourceChannel.h \
353 java/lang/reflect/Proxy$$ProxyData.h \
354 java/lang/reflect/Proxy$$ProxyType.h \
355 gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
356 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
357 gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
358 gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
359 $(PLATFORM_INNER_NAT_HDRS)
361 nat_headers = $(ordinary_header_files) $(inner_nat_headers) \
362 gnu/gcj/tools/gcj_dbtool/Main.h
363 nat_headers_install = $(ordinary_header_files)
365 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
367 java/lang/ClassLoader.h: classpath/lib/java/lang/ClassLoader.class
368 $(GCJH) -classpath '' -bootclasspath classpath/lib \
369 -prepend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
370 -prepend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
371 -friend 'jclass (::_Jv_FindClass) (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
372 -friend 'void ::_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
373 java/lang/ClassLoader
375 java/lang/Thread.h: classpath/lib/java/lang/Thread.class
376 $(GCJH) -classpath '' -bootclasspath classpath/lib \
377 -prepend 'class _Jv_JNIEnv;' \
378 -prepend '#define _JV_NOT_OWNER 1' \
379 -prepend '#define _JV_INTERRUPTED 2' \
380 -prepend '_Jv_JNIEnv * _Jv_GetCurrentJNIEnv ();' \
381 -prepend 'void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
382 -prepend 'void _Jv_ThreadRun (java::lang::Thread* thread);' \
383 -prepend 'jint _Jv_AttachCurrentThread(java::lang::Thread* thread);' \
384 -prepend 'java::lang::Thread* _Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
385 -prepend 'java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
386 -prepend 'jint _Jv_DetachCurrentThread ();' \
387 -friend '_Jv_JNIEnv * ::_Jv_GetCurrentJNIEnv ();' \
388 -friend 'void ::_Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
389 -friend 'void ::_Jv_ThreadRun (java::lang::Thread* thread);' \
390 -friend 'jint (::_Jv_AttachCurrentThread) (java::lang::Thread* thread);' \
391 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
392 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
393 -friend 'jint (::_Jv_DetachCurrentThread) ();' \
396 java/lang/String.h: classpath/lib/java/lang/String.class
397 $(GCJH) -classpath '' -bootclasspath classpath/lib \
398 -prepend 'jchar* _Jv_GetStringChars (jstring str);' \
399 -prepend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
400 -prepend 'jstring* _Jv_StringGetSlot (jstring);' \
401 -prepend 'jstring _Jv_NewStringUtf8Const (_Jv_Utf8Const* str);' \
402 -prepend 'jstring _Jv_NewStringLatin1 (const char*, jsize);' \
403 -prepend 'jstring _Jv_AllocString (jsize);' \
404 -friend 'jchar* ::_Jv_GetStringChars (jstring str);' \
405 -friend 'jstring* ::_Jv_StringFindSlot (jchar*, jint, jint);' \
406 -friend 'jstring* ::_Jv_StringGetSlot (jstring);' \
407 -friend 'jstring (::_Jv_NewStringUtf8Const) (_Jv_Utf8Const* str);' \
408 -friend 'jstring (::_Jv_NewStringLatin1) (const char*, jsize);' \
409 -friend 'jstring (::_Jv_AllocString) (jsize);' \
412 java/lang/reflect/Constructor.h: classpath/lib/java/lang/reflect/Constructor.class
413 $(GCJH) -classpath '' -bootclasspath classpath/lib \
414 -prepend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
415 -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
416 -friend 'jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *);' \
417 -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
418 -friend 'class java::lang::Class;' \
419 java/lang/reflect/Constructor
421 java/lang/reflect/Field.h: classpath/lib/java/lang/reflect/Field.class
422 $(GCJH) -classpath '' -bootclasspath classpath/lib \
423 -prepend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
424 -prepend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
425 -friend 'jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *);' \
426 -friend 'jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
427 -friend 'class java::lang::Class;' \
428 java/lang/reflect/Field
430 java/lang/reflect/Method.h: classpath/lib/java/lang/reflect/Method.class
431 $(GCJH) -classpath '' -bootclasspath classpath/lib \
432 -prepend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
433 -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
434 -friend 'jmethodID (::_Jv_FromReflectedMethod) (java::lang::reflect::Method *);' \
435 -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
436 -friend 'class java::lang::Class;' \
437 -friend 'class java::io::ObjectInputStream;' \
438 java/lang/reflect/Method
440 java/lang/reflect/Proxy.h: classpath/lib/java/lang/reflect/Proxy.class
441 $(GCJH) -classpath '' -bootclasspath classpath/lib \
442 java/lang/reflect/Proxy
444 java/lang/reflect/Proxy$$ProxyData.h: classpath/lib/java/lang/reflect/Proxy.class
445 $(GCJH) -classpath '' -bootclasspath classpath/lib \
446 'java/lang/reflect/Proxy$$ProxyData'
448 java/lang/reflect/Proxy$$ProxyType.h: classpath/lib/java/lang/reflect/Proxy.class
449 $(GCJH) -classpath '' -bootclasspath classpath/lib \
450 'java/lang/reflect/Proxy$$ProxyType'
452 gnu/gcj/runtime/ExtensionClassLoader.h: classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
453 $(GCJH) -classpath '' -bootclasspath classpath/lib \
454 -friend 'class ::java::lang::ClassLoader;' \
455 gnu/gcj/runtime/ExtensionClassLoader
457 java/io/ObjectInputStream$$GetField.h: classpath/lib/java/io/ObjectInputStream.class
458 $(GCJH) -classpath '' -bootclasspath classpath/lib \
459 'java/io/ObjectInputStream$$GetField'
461 java/io/ObjectOutputStream$$PutField.h: classpath/lib/java/io/ObjectOutputStream.class
462 $(GCJH) -classpath '' -bootclasspath classpath/lib \
463 'java/io/ObjectOutputStream$$PutField'
465 java/nio/DirectByteBufferImpl$$ReadWrite.h: classpath/lib/java/nio/DirectByteBufferImpl.class
466 $(GCJH) -classpath '' -bootclasspath classpath/lib \
467 'java/nio/DirectByteBufferImpl$$ReadWrite'
469 java/nio/channels/Pipe$$SinkChannel.h: classpath/lib/java/nio/channels/Pipe.class
470 $(GCJH) -classpath '' -bootclasspath classpath/lib \
471 'java/nio/channels/Pipe$$SinkChannel'
473 java/nio/channels/Pipe$$SourceChannel.h: classpath/lib/java/nio/channels/Pipe.class
474 $(GCJH) -classpath '' -bootclasspath classpath/lib \
475 'java/nio/channels/Pipe$$SourceChannel'
477 gnu/java/net/PlainSocketImpl$$SocketInputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
478 $(GCJH) -classpath '' -bootclasspath classpath/lib \
479 'gnu/java/net/PlainSocketImpl$$SocketInputStream'
481 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
482 $(GCJH) -classpath '' -bootclasspath classpath/lib \
483 'gnu/java/net/PlainSocketImpl$$SocketOutputStream'
485 gnu/java/nio/PipeImpl$$SinkChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
486 $(GCJH) -classpath '' -bootclasspath classpath/lib \
487 'gnu/java/nio/PipeImpl$$SinkChannelImpl'
489 gnu/java/nio/PipeImpl$$SourceChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
490 $(GCJH) -classpath '' -bootclasspath classpath/lib \
491 'gnu/java/nio/PipeImpl$$SourceChannelImpl'
493 ## Only used by PosixProcess.java
494 java/lang/ConcreteProcess$$ProcessManager.h: classpath/lib/java/lang/ConcreteProcess.class
495 $(GCJH) -classpath '' -bootclasspath classpath/lib \
496 'java/lang/ConcreteProcess$$ProcessManager'
498 ## Headers we maintain by hand and which we want to install.
499 extra_headers = java/lang/Object.h java/lang/Class.h
501 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
504 ## Install the headers. It is fairly ugly that we have to do this by
508 ## We use a GNU make trick here so that we don't go over the command
509 ## length limit of some shells.
510 @echo Creating list of headers to install...
511 @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
512 @cat tmp-ilist | while read f; do \
513 d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
514 $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
515 if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
516 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
517 $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
520 ## FIXME: the obvious approach using lib_DATA doesn't work with
522 $(mkinstalldirs) $(DESTDIR)$(secdir)
523 @for f in libgcj.security; do \
524 echo " $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f"; \
525 $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f; \
527 $(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
528 ## Install inner class headers.
529 $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
530 $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
531 $(INSTALL_DATA) 'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
532 $(INSTALL_DATA) 'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
533 $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
534 $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
535 $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
536 $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
537 $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
538 $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
539 ## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
542 ## ################################################################
545 ## Additional `check' targets for maintainer convenience.
548 ## This is used for maintainer-check. FIXME: should set from
549 ## configure using AC_CHECK_TOOL.
552 ## Try to make sure our library doesn't stomp the namespace.
553 maintainer-check: libgcj.la
554 $(NM) .libs/libgcj.a | grep ' T ' \
555 ## Anything with `4java' is assumed to be from .java source.
557 ## Anything with Jv is ok.
559 ## `terminate' and `unexpected' are part of the runtime.
560 | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
562 ## This rule can be used to see if the headers are more or less
564 header-check: libgcj-$(gcc_version).jar $(nat_headers)
566 for h in $(nat_headers); do \
567 echo "#include \"$$h\"" >> htest.cc; \
569 $(CXXCOMPILE) -fsyntax-only htest.cc
571 ## This rule can be used to see if all the .class files verify
573 class-check: libgcj-$(gcc_version).jar
574 @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
576 echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
577 if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
581 ## This rule checks whether write_entries_to_file works properly.
582 write-entries-to-file-check:
583 @echo Creating list of files to link...
584 @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
586 ## ################################################################
589 ## The `jv-convert' program and code to rebuild the converter header
593 ## it only makes sense to try to rebuild the JIS .h files on native
597 noinst_PROGRAMS = gen-from-JIS
599 gen_from_JIS_SOURCES = \
600 gnu/gcj/convert/gen-from-JIS.c \
601 gnu/gcj/convert/make-trie.c
603 gen_from_JIS_DEPENDENCIES = \
604 gnu/gcj/convert/JIS0201.h \
605 gnu/gcj/convert/JIS0208.h \
606 gnu/gcj/convert/JIS0212.h
608 $(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
609 ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
611 $(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
612 ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
614 $(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
615 ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
617 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
618 # You can get it from
619 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
621 $(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
622 echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
623 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
624 | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2) /*\3 */|p' \
626 mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
628 # The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
629 # You can get it from
630 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
632 $(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
633 echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
634 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
635 | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4) /*\5 */|p' \
637 mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
639 # The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
640 # You can get it from
641 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
643 $(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
644 echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
645 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
646 | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3) /*\4 */|p' \
648 mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
655 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
656 ## need this because we are explicitly using libtool to link using the
658 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
659 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
660 jv_convert_LINK = $(GCJLINK)
661 ## We don't explicitly link in the libraries we need; libgcj.la brings
662 ## in all dependencies. We need the -L so that gcj can find libgcj
663 ## with `-lgcj', but it must come first, otherwise the -L flags
664 ## brought in from libgcj.la would cause the install directories to be
665 ## searched before the build-tree ones, and we'd get errors because of
666 ## different libraries with the same SONAME from picky linkers such as
667 ## Solaris'. FIXME: should be _libs on some systems.
668 jv_convert_LDADD = -L$(here)/.libs libgcj.la
669 ## Depend on the spec file to make sure it is up to date before
670 ## linking this program.
671 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
673 gcj_dbtool_SOURCES = \
674 gnu/gcj/tools/gcj_dbtool/Main.java \
675 gnu/gcj/tools/gcj_dbtool/natMain.cc
677 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
678 ## need this because we are explicitly using libtool to link using the
680 gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
681 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
682 gcj_dbtool_LINK = $(GCJLINK)
683 ## We don't explicitly link in the libraries we need; libgcj.la brings
684 ## in all dependencies. We need the -L so that gcj can find libgcj
685 ## with `-lgcj', but it must come first, otherwise the -L flags
686 ## brought in from libgcj.la would cause the install directories to be
687 ## searched before the build-tree ones, and we'd get errors because of
688 ## different libraries with the same SONAME from picky linkers such as
689 ## Solaris'. FIXME: should be _libs on some systems.
690 gcj_dbtool_LDADD = -L$(here)/.libs libgcj.la
691 ## Depend on the spec file to make sure it is up to date before
692 ## linking this program.
693 gcj_dbtool_DEPENDENCIES = libgcj.la libgcj.spec
696 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
697 ## need this because we are explicitly using libtool to link using the
699 gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
700 gij_LINK = $(GCJLINK)
701 ## See jv_convert_LDADD.
702 gij_LDADD = -L$(here)/.libs libgij.la
703 ## Depend on the spec file to make sure it is up to date before
704 ## linking this program.
705 gij_DEPENDENCIES = libgij.la
707 ## This is a dummy definition.
709 grmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
710 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
711 grmic_LINK = $(GCJLINK)
712 ## See jv_convert_LDADD.
713 grmic_LDADD = -L$(here)/.libs libgcj.la
714 ## Depend on the spec file to make sure it is up to date before
715 ## linking this program.
716 grmic_DEPENDENCIES = libgcj.la libgcj.spec
718 ## This is a dummy definition.
719 grmiregistry_SOURCES =
720 grmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
721 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
722 grmiregistry_LINK = $(GCJLINK)
723 ## See jv_convert_LDADD.
724 grmiregistry_LDADD = -L$(here)/.libs libgcj.la
725 ## Depend on the spec file to make sure it is up to date before
726 ## linking this program.
727 grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
729 ## ################################################################
731 ## This lists all the C++ source files in subdirectories.
733 gnu/classpath/natSystemProperties.cc \
735 gnu/gcj/convert/JIS0208_to_Unicode.cc \
736 gnu/gcj/convert/JIS0212_to_Unicode.cc \
737 gnu/gcj/convert/Unicode_to_JIS.cc \
738 gnu/gcj/convert/natIconv.cc \
739 gnu/gcj/convert/natInput_EUCJIS.cc \
740 gnu/gcj/convert/natInput_SJIS.cc \
741 gnu/gcj/convert/natOutput_EUCJIS.cc \
742 gnu/gcj/convert/natOutput_SJIS.cc \
743 gnu/gcj/io/natSimpleSHSStream.cc \
745 gnu/gcj/runtime/natFinalizerThread.cc \
746 gnu/gcj/runtime/natSharedLibLoader.cc \
747 gnu/gcj/runtime/natSystemClassLoader.cc \
748 gnu/gcj/runtime/natStringBuffer.cc \
749 gnu/gcj/util/natDebug.cc \
750 gnu/java/lang/natMainThread.cc \
751 gnu/java/net/natPlainDatagramSocketImpl.cc \
752 gnu/java/net/natPlainSocketImpl.cc \
753 gnu/java/net/protocol/core/natCoreInputStream.cc \
754 gnu/java/nio/natPipeImpl.cc \
755 gnu/java/nio/natSelectorImpl.cc \
756 gnu/java/nio/natNIOServerSocket.cc \
757 gnu/java/nio/channels/natFileChannelImpl.cc \
759 java/io/natObjectInputStream.cc \
760 java/io/natVMObjectStreamClass.cc \
761 java/lang/natCharacter.cc \
762 java/lang/natClass.cc \
763 java/lang/natClassLoader.cc \
764 java/lang/natConcreteProcess.cc \
765 java/lang/natDouble.cc \
766 java/lang/natFloat.cc \
767 java/lang/natMath.cc \
768 java/lang/natObject.cc \
769 java/lang/natRuntime.cc \
770 java/lang/natString.cc \
771 java/lang/natStringBuffer.cc \
772 java/lang/natStringBuilder.cc \
773 java/lang/natSystem.cc \
774 java/lang/natThread.cc \
775 java/lang/natVMClassLoader.cc \
776 java/lang/natVMSecurityManager.cc \
777 java/lang/natVMThrowable.cc \
778 java/lang/ref/natReference.cc \
779 java/lang/reflect/natArray.cc \
780 java/lang/reflect/natConstructor.cc \
781 java/lang/reflect/natField.cc \
782 java/lang/reflect/natMethod.cc \
783 java/net/natVMNetworkInterface.cc \
784 java/net/natInetAddress.cc \
785 java/nio/channels/natVMChannels.cc \
786 java/nio/natDirectByteBufferImpl.cc \
787 java/text/natCollator.cc \
788 java/util/natResourceBundle.cc \
789 java/util/natVMTimeZone.cc \
790 java/util/logging/natLogger.cc \
791 java/util/zip/natDeflater.cc \
792 java/util/zip/natInflater.cc
794 xlib_nat_source_files = \
795 gnu/gcj/xlib/natClip.cc \
796 gnu/gcj/xlib/natColormap.cc \
797 gnu/gcj/xlib/natDisplay.cc \
798 gnu/gcj/xlib/natDrawable.cc \
799 gnu/gcj/xlib/natFont.cc \
800 gnu/gcj/xlib/natGC.cc \
801 gnu/gcj/xlib/natPixmap.cc \
802 gnu/gcj/xlib/natScreen.cc \
803 gnu/gcj/xlib/natVisual.cc \
804 gnu/gcj/xlib/natWMSizeHints.cc \
805 gnu/gcj/xlib/natWindow.cc \
806 gnu/gcj/xlib/natWindowAttributes.cc \
807 gnu/gcj/xlib/natXAnyEvent.cc \
808 gnu/gcj/xlib/natXButtonEvent.cc \
809 gnu/gcj/xlib/natXColor.cc \
810 gnu/gcj/xlib/natXConfigureEvent.cc \
811 gnu/gcj/xlib/natXException.cc \
812 gnu/gcj/xlib/natXExposeEvent.cc \
813 gnu/gcj/xlib/natXImage.cc \
814 gnu/gcj/xlib/natXUnmapEvent.cc
816 ## ################################################################
819 ## Creating and installing sources.zip
822 ## Create a zip holding all the sources. This can be meaningfully
828 ( cd $(srcdir)/classpath; \
829 find java gnu javax org -name '*.java' -print | \
830 while read file; do \
831 ## Ugly code to avoid "echo -C". Must separate each entry by a newline
833 echo "x-C" | sed -e 's/^.//'; \
834 echo $(srcdir)/classpath; \
837 ## Now the build tree.
839 find gnu java -name '*.java' -print | \
840 while read file; do \
841 echo "x-C" | sed -e 's/^.//'; \
846 ## Many of the above circumlocutions were because ZIP used to be a
847 ## relative path to fastjar. It didn't seem worthwhile to change the
848 ## code when we moved to an external jar.
849 $(JAR) -cfM@ $$here/src.zip
850 ## Override GNU Classpath sources with libgcj replacements.
854 find gnu java -name '*.java' -print | \
855 while read file; do \
856 echo "x-C" | sed -e 's/^.//'; \
861 $(JAR) -ufM@ $$here/src.zip
863 ## We use a variable for this in case the user wants to override it.
864 sourcesdir = $(jardir)
866 install-src.zip: src.zip
867 $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
870 ## ################################################################
873 ## Dependency tracking madness.
876 ## This is an evil hack to work around an automake limitation. We
877 ## need to ensure that all CNI headers are built, not just the ones
878 ## used internally by libgcj. We can't make the .o files depend on
879 ## nat_headers, because in that case we'll force a complete rebuild of
880 ## the C++ code whenever any .java file is touched. So instead we
881 ## have a dummy rule which is only used once, namely the first time a
882 ## build is done. On subsequent builds, the dependency tracking for
883 ## the .cc compilations will have picked up the .h files, and these
884 ## will be built directly as needed.
887 ## Note that we don't use a real dependency here, since we don't want
888 ## to rebuild all the headers here when the header list changes. If
889 ## we did rebuild here, then any addition of a .java file would cause
890 ## a large number of recompilations.
891 $(MAKE) create-headers
892 @echo > headers.stamp
894 headers_to_make = $(nat_headers)
896 headers_to_make += $(xlib_nat_headers)
899 create-headers: $(headers_to_make)
901 .PHONY: create-headers
903 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
904 $(libgij_la_OBJECTS): headers.stamp
906 ## ################################################################
909 ## This section is for make and multilib madness.
912 # Work around what appears to be a GNU make bug handling MAKEFLAGS
913 # values defined in terms of make variables, as is the case for CC and
914 # friends when we are called from the top level Makefile.
916 "AR_FLAGS=$(AR_FLAGS)" \
917 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
919 "CXXFLAGS=$(CXXFLAGS)" \
920 "CPPFLAGS=$(CPPFLAGS)" \
921 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
922 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
923 "INSTALL=$(INSTALL)" \
924 "INSTALL_DATA=$(INSTALL_DATA)" \
925 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
926 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
927 "GCJFLAGS=$(GCJFLAGS)" \
928 "LDFLAGS=$(LDFLAGS)" \
929 "LIBCFLAGS=$(LIBCFLAGS)" \
930 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
932 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
933 "PICFLAG=$(PICFLAG)" \
934 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
936 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
937 "exec_prefix=$(exec_prefix)" \
938 "infodir=$(infodir)" \
941 "gxx_include_dir=$(gxx_include_dir)" \
945 "LIBCFLAGS=$(LIBCFLAGS)" \
947 "PICFLAG=$(PICFLAG)" \
951 # Subdir rules rely on $(FLAGS_TO_PASS)
952 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
954 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
958 # No install-html support yet.
962 # Multilib support variables.
971 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
972 maintainer-clean-multi
974 all-recursive: all-multi
975 install-recursive: install-multi
976 mostlyclean-recursive: mostlyclean-multi
977 clean-recursive: clean-multi
978 distclean-recursive: distclean-multi
979 maintainer-clean-recursive: maintainer-clean-multi
982 : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
984 $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
986 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
988 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
990 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
991 maintainer-clean-multi:
992 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean