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
43 dbexec_LTLIBRARIES = libjvm.la
45 pkgconfigdir = $(libdir)/pkgconfig
46 pkgconfig_DATA = libgcj.pc
48 jardir = $(datadir)/java
49 jar_DATA = libgcj-$(gcc_version).jar
52 JAVA_HOME_DIR = $(JAVA_HOME)
53 BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
55 JAVA_HOME_DIR = $(prefix)
56 BOOT_CLASS_PATH_DIR = $(jardir)/$(jar_DATA)
59 ## FIXME: Using libdir violates GNU coding standards.
60 secdir = $(libdir)/security
61 ## Where to install default logging property file.
64 ## Name of the default .db.
66 ## Compiler specific component of the .db file
67 db_pathtail = gcj-$(gcc_version)/$(db_name)
69 ## For now, only on native systems. FIXME.
71 bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool
73 ## It is convenient to actually build and install the default database
74 ## when gcj-dbtool is available.
75 dbexec_DATA = $(db_name)
78 bin_SCRIPTS = addr2name.awk
80 ## ################################################################
83 ## Compilers and compilation flags.
87 bin_SCRIPTS += scripts/jar
90 ## The compiler with whatever flags we want for both -c and -C
92 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
94 extra_ldflags_libjava = @extra_ldflags_libjava@
96 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
98 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
99 $(LDFLAGS) $(extra_ldflags_libjava) -o $@
101 GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
103 WARNINGS = -Wextra -Wall
104 ## Some systems don't allow `$' in identifiers by default, so we force
105 ## it with -fdollars-in-identifiers. -Wswitch-enum detects bugs in
106 ## the verifier implementation, and maybe other places. We need
107 ## _GNU_SOURCE defined for some Linux builds. It doesn't hurt to
108 ## always define it. Some systems, including Linux, need
109 ## -D_FILE_OFFSET_BITS=64 to enable > 2GB file support.
112 -fnon-call-exceptions \
114 -fdollars-in-identifiers \
116 -D_FILE_OFFSET_BITS=64 \
121 -DPREFIX="\"$(prefix)\"" \
122 -DLIBDIR="\"$(libdir)\"" \
123 -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
124 -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
125 -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
126 -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
127 -DGCJ_VERSIONED_LIBDIR="\"$(dbexecdir)\"" \
128 -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
129 -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
130 -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\"" \
131 -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\""
135 -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
137 -Wno-deprecated -fbootstrap-classes
139 AM_CFLAGS = @LIBGCJ_CFLAGS@
141 AM_CFLAGS += $(WARNINGS)
144 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
145 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
148 JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
150 LIBFFIINCS = @LIBFFIINCS@
152 AM_CPPFLAGS = -I$(top_srcdir) \
153 -Iinclude -I$(top_srcdir)/include \
154 -I$(top_srcdir)/classpath/include \
155 -Iclasspath/include \
156 -I$(top_srcdir)/classpath/native/fdlibm \
157 $(GCINCS) $(THREADINCS) $(INCLTDL) \
158 $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
160 BOOTCLASSPATH = $(here)/classpath/lib
162 ## ################################################################
164 all_property_files = $(property_files) \
165 java/util/logging/logging.properties
168 ## How to build libgcj.a and libgcj.jar
171 libgij_la_SOURCES = gij.cc
172 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
173 ## See jv_convert_LDADD.
174 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
175 ## The mysterious backslash in the grep pattern is consumed by make.
176 libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
177 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
179 libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
180 link.cc defineclass.cc interpret.cc verify.cc \
181 java/lang/Class.java java/lang/Object.java \
185 libgcj_la_SOURCES += boehm.cc
189 libgcj_la_SOURCES += nogc.cc
192 if USING_POSIX_PLATFORM
193 libgcj_la_SOURCES += posix.cc
196 if USING_WIN32_PLATFORM
197 libgcj_la_SOURCES += win32.cc
201 libgcj_la_SOURCES += darwin.cc
204 if USING_POSIX_THREADS
205 libgcj_la_SOURCES += posix-threads.cc
208 if USING_WIN32_THREADS
209 libgcj_la_SOURCES += win32-threads.cc
213 libgcj_la_SOURCES += no-threads.cc
216 ## Objects from C++ sources in subdirs.
217 nat_files = $(nat_source_files:.cc=.lo)
218 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
220 # Include THREADLIBS here to ensure that the correct version of
221 # certain linuxthread functions get linked:
222 ## The mysterious backslash in the grep pattern is consumed by make.
223 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
224 $(LIBLTDL) $(SYS_ZLIBS) \
225 -version-info `grep -v '^\#' $(srcdir)/libtool-version`
227 classpath/native/fdlibm/libfdlibm.la \
228 $(all_packages_source_files:.list=.lo) \
231 $(LIBFFI) $(ZLIBS) $(GCLIBS)
232 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
233 $(all_packages_source_files:.list=.lo) \
234 $(LIBLTDL) $(libgcj_la_LIBADD)
235 libgcj_la_LINK = $(LIBLINK)
238 libjvm_la_SOURCES = jni-libjvm.cc
239 libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
240 ## See jv_convert_LDADD.
241 libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
242 ## The mysterious backslash in the grep pattern is consumed by make.
243 libjvm_la_LDFLAGS = \
244 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
246 ## The .db file. This rule is only used for native builds, so it is
247 ## safe to invoke gcj-dbtool.
248 $(db_name): gcj-dbtool$(EXEEXT)
249 ## In case it exists already.
251 ## We don't actually care if it fails -- if it does, just make an
252 ## empty file. This is simpler than trying to discover when mmap is
254 ./gcj-dbtool -n $(db_name) || touch $(db_name)
256 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
257 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
258 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
259 libgcj.la libgcj.spec \
260 $(lib_gnu_awt_xlib_la_LIBADD)
261 ## We require libstdc++-v3 to be in the same build tree.
262 lib_gnu_awt_xlib_la_CPPFLAGS = \
264 -I../libstdc++-v3/include \
265 -I../libstdc++-v3/include/$(target_noncanonical) \
266 -I$(srcdir)/../libstdc++-v3/libsupc++
267 ## The mysterious backslash in the grep pattern is consumed by make.
268 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
269 @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
270 -rpath $(toolexeclibdir) \
271 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
272 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
274 ## Note that property_files is defined in sources.am.
275 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
277 $(propertyo_files): %.lo: classpath/resource/%
278 $(mkinstalldirs) `dirname $@`; \
279 $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
281 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
282 cd classpath/lib; $(JAR) -cfM \
283 ../../libgcj-$(gcc_version).jar gnu java javax org
285 CLEANFILES = libgcj-$(gcc_version).jar
286 DISTCLEANFILES = native.dirs
289 ## Use libtool rm to remove each libtool object
290 find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
293 ## Remove every .d file that was created.
294 find . -name '*.d' -print | xargs rm -f
296 # Just remove the objects from C++ sources, for testing the C++ compiler.
298 rm -f $(nat_files) $(xlib_nat_files)
300 SUFFIXES = .class .java .h .properties .list
302 ## Pass the list of object files to libtool in a temporary file to
303 ## avoid tripping platform command line length limits.
304 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
305 @echo Creating list of files to link...
306 @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
307 $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
308 -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
310 ## ################################################################
312 ## Compiling a list of java sources to a single .o.
315 $(LTGCJCOMPILE) -c -o $@ -MT $@ -MD -MP -MF $(basename $@).deps @$<
317 ## ################################################################
319 ## This pulls in a number of variable and target definitions.
322 ## ################################################################
325 ## How to build header files.
328 ## We have special rules for certain headers.
329 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
330 java/lang/String.h java/lang/reflect/Constructor.h \
331 java/lang/reflect/Field.h java/lang/reflect/Method.h \
332 java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
334 generic_header_files = $(filter-out $(omitted_headers),$(ordinary_header_files) $(xlib_nat_headers)) \
335 gnu/gcj/tools/gcj_dbtool/Main.h
337 $(generic_header_files): %.h: classpath/lib/%.class
338 name=`echo $< | sed -e 's/\.class$$//' -e 's,classpath/lib/,,'`; \
339 $(mkinstalldirs) `dirname $$name`; \
340 $(GCJH) -d . -classpath '' -bootclasspath classpath/lib $$name
342 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
343 java/io/ObjectInputStream$$GetField.h \
344 java/nio/DirectByteBufferImpl$$ReadWrite.h \
345 java/nio/channels/Pipe$$SinkChannel.h \
346 java/nio/channels/Pipe$$SourceChannel.h \
347 java/lang/reflect/Proxy$$ProxyData.h \
348 java/lang/reflect/Proxy$$ProxyType.h \
349 gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
350 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
351 gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
352 gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
353 $(PLATFORM_INNER_NAT_HDRS)
355 nat_headers = $(ordinary_header_files) $(inner_nat_headers) \
356 gnu/gcj/tools/gcj_dbtool/Main.h
357 nat_headers_install = $(ordinary_header_files)
359 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
361 java/lang/ClassLoader.h: classpath/lib/java/lang/ClassLoader.class
362 $(GCJH) -classpath '' -bootclasspath classpath/lib \
363 -prepend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
364 -prepend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
365 -friend 'jclass (::_Jv_FindClass) (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
366 -friend 'void ::_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
367 java/lang/ClassLoader
369 java/lang/Thread.h: classpath/lib/java/lang/Thread.class
370 $(GCJH) -classpath '' -bootclasspath classpath/lib \
371 -prepend 'class _Jv_JNIEnv;' \
372 -prepend '#define _JV_NOT_OWNER 1' \
373 -prepend '#define _JV_INTERRUPTED 2' \
374 -prepend '_Jv_JNIEnv * _Jv_GetCurrentJNIEnv ();' \
375 -prepend 'void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
376 -prepend 'void _Jv_ThreadRun (java::lang::Thread* thread);' \
377 -prepend 'jint _Jv_AttachCurrentThread(java::lang::Thread* thread);' \
378 -prepend 'java::lang::Thread* _Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
379 -prepend 'java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
380 -prepend 'jint _Jv_DetachCurrentThread ();' \
381 -friend '_Jv_JNIEnv * ::_Jv_GetCurrentJNIEnv ();' \
382 -friend 'void ::_Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
383 -friend 'void ::_Jv_ThreadRun (java::lang::Thread* thread);' \
384 -friend 'jint (::_Jv_AttachCurrentThread) (java::lang::Thread* thread);' \
385 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
386 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
387 -friend 'jint (::_Jv_DetachCurrentThread) ();' \
390 java/lang/String.h: classpath/lib/java/lang/String.class
391 $(GCJH) -classpath '' -bootclasspath classpath/lib \
392 -prepend 'jchar* _Jv_GetStringChars (jstring str);' \
393 -prepend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
394 -prepend 'jstring* _Jv_StringGetSlot (jstring);' \
395 -prepend 'jstring _Jv_NewStringUtf8Const (_Jv_Utf8Const* str);' \
396 -prepend 'jstring _Jv_NewStringLatin1 (const char*, jsize);' \
397 -prepend 'jstring _Jv_AllocString (jsize);' \
398 -friend 'jchar* ::_Jv_GetStringChars (jstring str);' \
399 -friend 'jstring* ::_Jv_StringFindSlot (jchar*, jint, jint);' \
400 -friend 'jstring* ::_Jv_StringGetSlot (jstring);' \
401 -friend 'jstring (::_Jv_NewStringUtf8Const) (_Jv_Utf8Const* str);' \
402 -friend 'jstring (::_Jv_NewStringLatin1) (const char*, jsize);' \
403 -friend 'jstring (::_Jv_AllocString) (jsize);' \
406 java/lang/reflect/Constructor.h: classpath/lib/java/lang/reflect/Constructor.class
407 $(GCJH) -classpath '' -bootclasspath classpath/lib \
408 -prepend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
409 -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
410 -friend 'jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *);' \
411 -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
412 -friend 'class java::lang::Class;' \
413 java/lang/reflect/Constructor
415 java/lang/reflect/Field.h: classpath/lib/java/lang/reflect/Field.class
416 $(GCJH) -classpath '' -bootclasspath classpath/lib \
417 -prepend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
418 -prepend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
419 -friend 'jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *);' \
420 -friend 'jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
421 -friend 'class java::lang::Class;' \
422 java/lang/reflect/Field
424 java/lang/reflect/Method.h: classpath/lib/java/lang/reflect/Method.class
425 $(GCJH) -classpath '' -bootclasspath classpath/lib \
426 -prepend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
427 -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
428 -friend 'jmethodID (::_Jv_FromReflectedMethod) (java::lang::reflect::Method *);' \
429 -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
430 -friend 'class java::lang::Class;' \
431 -friend 'class java::io::ObjectInputStream;' \
432 java/lang/reflect/Method
434 java/lang/reflect/Proxy.h: classpath/lib/java/lang/reflect/Proxy.class
435 $(GCJH) -classpath '' -bootclasspath classpath/lib \
436 java/lang/reflect/Proxy
438 java/lang/reflect/Proxy$$ProxyData.h: classpath/lib/java/lang/reflect/Proxy.class
439 $(GCJH) -classpath '' -bootclasspath classpath/lib \
440 'java/lang/reflect/Proxy$$ProxyData'
442 java/lang/reflect/Proxy$$ProxyType.h: classpath/lib/java/lang/reflect/Proxy.class
443 $(GCJH) -classpath '' -bootclasspath classpath/lib \
444 'java/lang/reflect/Proxy$$ProxyType'
446 gnu/gcj/runtime/ExtensionClassLoader.h: classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
447 $(GCJH) -classpath '' -bootclasspath classpath/lib \
448 -friend 'class ::java::lang::ClassLoader;' \
449 gnu/gcj/runtime/ExtensionClassLoader
451 java/io/ObjectInputStream$$GetField.h: classpath/lib/java/io/ObjectInputStream.class
452 $(GCJH) -classpath '' -bootclasspath classpath/lib \
453 'java/io/ObjectInputStream$$GetField'
455 java/io/ObjectOutputStream$$PutField.h: classpath/lib/java/io/ObjectOutputStream.class
456 $(GCJH) -classpath '' -bootclasspath classpath/lib \
457 'java/io/ObjectOutputStream$$PutField'
459 java/nio/DirectByteBufferImpl$$ReadWrite.h: classpath/lib/java/nio/DirectByteBufferImpl.class
460 $(GCJH) -classpath '' -bootclasspath classpath/lib \
461 'java/nio/DirectByteBufferImpl$$ReadWrite'
463 java/nio/channels/Pipe$$SinkChannel.h: classpath/lib/java/nio/channels/Pipe.class
464 $(GCJH) -classpath '' -bootclasspath classpath/lib \
465 'java/nio/channels/Pipe$$SinkChannel'
467 java/nio/channels/Pipe$$SourceChannel.h: classpath/lib/java/nio/channels/Pipe.class
468 $(GCJH) -classpath '' -bootclasspath classpath/lib \
469 'java/nio/channels/Pipe$$SourceChannel'
471 gnu/java/net/PlainSocketImpl$$SocketInputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
472 $(GCJH) -classpath '' -bootclasspath classpath/lib \
473 'gnu/java/net/PlainSocketImpl$$SocketInputStream'
475 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
476 $(GCJH) -classpath '' -bootclasspath classpath/lib \
477 'gnu/java/net/PlainSocketImpl$$SocketOutputStream'
479 gnu/java/nio/PipeImpl$$SinkChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
480 $(GCJH) -classpath '' -bootclasspath classpath/lib \
481 'gnu/java/nio/PipeImpl$$SinkChannelImpl'
483 gnu/java/nio/PipeImpl$$SourceChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
484 $(GCJH) -classpath '' -bootclasspath classpath/lib \
485 'gnu/java/nio/PipeImpl$$SourceChannelImpl'
487 ## Only used by PosixProcess.java
488 java/lang/ConcreteProcess$$ProcessManager.h: classpath/lib/java/lang/ConcreteProcess.class
489 $(GCJH) -classpath '' -bootclasspath classpath/lib \
490 'java/lang/ConcreteProcess$$ProcessManager'
492 ## Headers we maintain by hand and which we want to install.
493 extra_headers = java/lang/Object.h java/lang/Class.h
495 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
498 ## Install the headers. It is fairly ugly that we have to do this by
502 ## We use a GNU make trick here so that we don't go over the command
503 ## length limit of some shells.
504 @echo Creating list of headers to install...
505 @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
506 @cat tmp-ilist | while read f; do \
507 d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
508 $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
509 if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
510 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
511 $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
514 ## FIXME: the obvious approach using lib_DATA doesn't work with
516 $(mkinstalldirs) $(DESTDIR)$(secdir)
517 @for f in libgcj.security; do \
518 echo " $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f"; \
519 $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f; \
521 $(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
522 ## Install inner class headers.
523 $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
524 $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
525 $(INSTALL_DATA) 'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
526 $(INSTALL_DATA) 'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
527 $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
528 $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
529 $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
530 $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
531 $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
532 $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
533 ## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
536 ## ################################################################
539 ## Additional `check' targets for maintainer convenience.
542 ## This is used for maintainer-check. FIXME: should set from
543 ## configure using AC_CHECK_TOOL.
546 ## Try to make sure our library doesn't stomp the namespace.
547 maintainer-check: libgcj.la
548 $(NM) .libs/libgcj.a | grep ' T ' \
549 ## Anything with `4java' is assumed to be from .java source.
551 ## Anything with Jv is ok.
553 ## `terminate' and `unexpected' are part of the runtime.
554 | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
556 ## This rule can be used to see if the headers are more or less
558 header-check: libgcj-$(gcc_version).jar $(nat_headers)
560 for h in $(nat_headers); do \
561 echo "#include \"$$h\"" >> htest.cc; \
563 $(CXXCOMPILE) -fsyntax-only htest.cc
565 ## This rule can be used to see if all the .class files verify
567 class-check: libgcj-$(gcc_version).jar
568 @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
570 echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
571 if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
575 ## This rule checks whether write_entries_to_file works properly.
576 write-entries-to-file-check:
577 @echo Creating list of files to link...
578 @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
580 ## ################################################################
583 ## The `jv-convert' program and code to rebuild the converter header
587 ## it only makes sense to try to rebuild the JIS .h files on native
591 noinst_PROGRAMS = gen-from-JIS
593 gen_from_JIS_SOURCES = \
594 gnu/gcj/convert/gen-from-JIS.c \
595 gnu/gcj/convert/make-trie.c
597 gen_from_JIS_DEPENDENCIES = \
598 gnu/gcj/convert/JIS0201.h \
599 gnu/gcj/convert/JIS0208.h \
600 gnu/gcj/convert/JIS0212.h
602 $(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
603 ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
605 $(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
606 ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
608 $(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
609 ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
611 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
612 # You can get it from
613 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
615 $(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
616 echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
617 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
618 | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2) /*\3 */|p' \
620 mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
622 # The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
623 # You can get it from
624 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
626 $(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
627 echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
628 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
629 | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4) /*\5 */|p' \
631 mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
633 # The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
634 # You can get it from
635 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
637 $(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
638 echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
639 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
640 | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3) /*\4 */|p' \
642 mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
649 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
650 ## need this because we are explicitly using libtool to link using the
652 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
653 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
654 jv_convert_LINK = $(GCJLINK)
655 ## We don't explicitly link in the libraries we need; libgcj.la brings
656 ## in all dependencies. We need the -L so that gcj can find libgcj
657 ## with `-lgcj', but it must come first, otherwise the -L flags
658 ## brought in from libgcj.la would cause the install directories to be
659 ## searched before the build-tree ones, and we'd get errors because of
660 ## different libraries with the same SONAME from picky linkers such as
661 ## Solaris'. FIXME: should be _libs on some systems.
662 jv_convert_LDADD = -L$(here)/.libs libgcj.la
663 ## Depend on the spec file to make sure it is up to date before
664 ## linking this program.
665 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
667 gcj_dbtool_SOURCES = \
668 gnu/gcj/tools/gcj_dbtool/Main.java \
669 gnu/gcj/tools/gcj_dbtool/natMain.cc
671 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
672 ## need this because we are explicitly using libtool to link using the
674 gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
675 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
676 gcj_dbtool_LINK = $(GCJLINK)
677 ## We don't explicitly link in the libraries we need; libgcj.la brings
678 ## in all dependencies. We need the -L so that gcj can find libgcj
679 ## with `-lgcj', but it must come first, otherwise the -L flags
680 ## brought in from libgcj.la would cause the install directories to be
681 ## searched before the build-tree ones, and we'd get errors because of
682 ## different libraries with the same SONAME from picky linkers such as
683 ## Solaris'. FIXME: should be _libs on some systems.
684 gcj_dbtool_LDADD = -L$(here)/.libs libgcj.la
685 ## Depend on the spec file to make sure it is up to date before
686 ## linking this program.
687 gcj_dbtool_DEPENDENCIES = libgcj.la libgcj.spec
690 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
691 ## need this because we are explicitly using libtool to link using the
693 gij_LDFLAGS = -rpath $(libdir)/gcj-$(gcc_version) -rpath $(toolexeclibdir) \
694 -shared-libgcc $(THREADLDFLAGS)
695 gij_LINK = $(GCJLINK)
696 ## See jv_convert_LDADD.
697 gij_LDADD = -L$(here)/.libs libgij.la
698 ## Depend on the spec file to make sure it is up to date before
699 ## linking this program.
700 gij_DEPENDENCIES = libgij.la
702 ## This is a dummy definition.
704 grmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
705 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
706 grmic_LINK = $(GCJLINK)
707 ## See jv_convert_LDADD.
708 grmic_LDADD = -L$(here)/.libs libgcj.la
709 ## Depend on the spec file to make sure it is up to date before
710 ## linking this program.
711 grmic_DEPENDENCIES = libgcj.la libgcj.spec
713 ## This is a dummy definition.
714 grmiregistry_SOURCES =
715 grmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
716 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
717 grmiregistry_LINK = $(GCJLINK)
718 ## See jv_convert_LDADD.
719 grmiregistry_LDADD = -L$(here)/.libs libgcj.la
720 ## Depend on the spec file to make sure it is up to date before
721 ## linking this program.
722 grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
724 ## ################################################################
726 ## This lists all the C++ source files in subdirectories.
728 gnu/classpath/natSystemProperties.cc \
730 gnu/gcj/convert/JIS0208_to_Unicode.cc \
731 gnu/gcj/convert/JIS0212_to_Unicode.cc \
732 gnu/gcj/convert/Unicode_to_JIS.cc \
733 gnu/gcj/convert/natIconv.cc \
734 gnu/gcj/convert/natInput_EUCJIS.cc \
735 gnu/gcj/convert/natInput_SJIS.cc \
736 gnu/gcj/convert/natOutput_EUCJIS.cc \
737 gnu/gcj/convert/natOutput_SJIS.cc \
738 gnu/gcj/io/natSimpleSHSStream.cc \
740 gnu/gcj/runtime/natFinalizerThread.cc \
741 gnu/gcj/runtime/natSharedLibLoader.cc \
742 gnu/gcj/runtime/natSystemClassLoader.cc \
743 gnu/gcj/runtime/natStringBuffer.cc \
744 gnu/gcj/util/natDebug.cc \
745 gnu/java/lang/natMainThread.cc \
746 gnu/java/net/natPlainDatagramSocketImpl.cc \
747 gnu/java/net/natPlainSocketImpl.cc \
748 gnu/java/net/protocol/core/natCoreInputStream.cc \
749 gnu/java/nio/natPipeImpl.cc \
750 gnu/java/nio/natSelectorImpl.cc \
751 gnu/java/nio/natNIOServerSocket.cc \
752 gnu/java/nio/channels/natFileChannelImpl.cc \
754 java/io/natObjectInputStream.cc \
755 java/io/natVMObjectStreamClass.cc \
756 java/lang/natCharacter.cc \
757 java/lang/natClass.cc \
758 java/lang/natClassLoader.cc \
759 java/lang/natConcreteProcess.cc \
760 java/lang/natDouble.cc \
761 java/lang/natFloat.cc \
762 java/lang/natMath.cc \
763 java/lang/natObject.cc \
764 java/lang/natRuntime.cc \
765 java/lang/natString.cc \
766 java/lang/natStringBuffer.cc \
767 java/lang/natStringBuilder.cc \
768 java/lang/natSystem.cc \
769 java/lang/natThread.cc \
770 java/lang/natVMClassLoader.cc \
771 java/lang/natVMSecurityManager.cc \
772 java/lang/natVMThrowable.cc \
773 java/lang/ref/natReference.cc \
774 java/lang/reflect/natArray.cc \
775 java/lang/reflect/natConstructor.cc \
776 java/lang/reflect/natField.cc \
777 java/lang/reflect/natMethod.cc \
778 java/net/natVMNetworkInterface.cc \
779 java/net/natInetAddress.cc \
780 java/nio/channels/natVMChannels.cc \
781 java/nio/natDirectByteBufferImpl.cc \
782 java/text/natCollator.cc \
783 java/util/natResourceBundle.cc \
784 java/util/natVMTimeZone.cc \
785 java/util/logging/natLogger.cc \
786 java/util/zip/natDeflater.cc \
787 java/util/zip/natInflater.cc
789 xlib_nat_source_files = \
790 gnu/gcj/xlib/natClip.cc \
791 gnu/gcj/xlib/natColormap.cc \
792 gnu/gcj/xlib/natDisplay.cc \
793 gnu/gcj/xlib/natDrawable.cc \
794 gnu/gcj/xlib/natFont.cc \
795 gnu/gcj/xlib/natGC.cc \
796 gnu/gcj/xlib/natPixmap.cc \
797 gnu/gcj/xlib/natScreen.cc \
798 gnu/gcj/xlib/natVisual.cc \
799 gnu/gcj/xlib/natWMSizeHints.cc \
800 gnu/gcj/xlib/natWindow.cc \
801 gnu/gcj/xlib/natWindowAttributes.cc \
802 gnu/gcj/xlib/natXAnyEvent.cc \
803 gnu/gcj/xlib/natXButtonEvent.cc \
804 gnu/gcj/xlib/natXColor.cc \
805 gnu/gcj/xlib/natXConfigureEvent.cc \
806 gnu/gcj/xlib/natXException.cc \
807 gnu/gcj/xlib/natXExposeEvent.cc \
808 gnu/gcj/xlib/natXImage.cc \
809 gnu/gcj/xlib/natXUnmapEvent.cc
811 ## ################################################################
814 ## Creating and installing sources.zip
817 ## Create a zip holding all the sources. This can be meaningfully
823 ( cd $(srcdir)/classpath; \
824 find java gnu javax org -name '*.java' -print | \
825 while read file; do \
826 ## Ugly code to avoid "echo -C". Must separate each entry by a newline
828 echo "x-C" | sed -e 's/^.//'; \
829 echo $(srcdir)/classpath; \
832 ## Now the build tree.
834 find gnu java -name '*.java' -print | \
835 while read file; do \
836 echo "x-C" | sed -e 's/^.//'; \
841 ## Many of the above circumlocutions were because ZIP used to be a
842 ## relative path to fastjar. It didn't seem worthwhile to change the
843 ## code when we moved to an external jar.
844 $(JAR) -cfM@ $$here/src.zip
845 ## Override GNU Classpath sources with libgcj replacements.
849 find gnu java -name '*.java' -print | \
850 while read file; do \
851 echo "x-C" | sed -e 's/^.//'; \
856 $(JAR) -ufM@ $$here/src.zip
858 ## We use a variable for this in case the user wants to override it.
859 sourcesdir = $(jardir)
861 install-src.zip: src.zip
862 $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
865 ## ################################################################
868 ## Dependency tracking madness.
871 ## This is an evil hack to work around an automake limitation. We
872 ## need to ensure that all CNI headers are built, not just the ones
873 ## used internally by libgcj. We can't make the .o files depend on
874 ## nat_headers, because in that case we'll force a complete rebuild of
875 ## the C++ code whenever any .java file is touched. So instead we
876 ## have a dummy rule which is only used once, namely the first time a
877 ## build is done. On subsequent builds, the dependency tracking for
878 ## the .cc compilations will have picked up the .h files, and these
879 ## will be built directly as needed.
882 ## Note that we don't use a real dependency here, since we don't want
883 ## to rebuild all the headers here when the header list changes. If
884 ## we did rebuild here, then any addition of a .java file would cause
885 ## a large number of recompilations.
886 $(MAKE) create-headers
887 @echo > headers.stamp
889 headers_to_make = $(nat_headers)
891 headers_to_make += $(xlib_nat_headers)
894 create-headers: $(headers_to_make)
896 .PHONY: create-headers
898 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
899 $(libgij_la_OBJECTS): headers.stamp
900 $(libjvm_la_OBJECTS): headers.stamp
902 ## ################################################################
905 ## This section is for make and multilib madness.
908 # Work around what appears to be a GNU make bug handling MAKEFLAGS
909 # values defined in terms of make variables, as is the case for CC and
910 # friends when we are called from the top level Makefile.
912 "AR_FLAGS=$(AR_FLAGS)" \
913 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
915 "CXXFLAGS=$(CXXFLAGS)" \
916 "CPPFLAGS=$(CPPFLAGS)" \
917 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
918 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
919 "INSTALL=$(INSTALL)" \
920 "INSTALL_DATA=$(INSTALL_DATA)" \
921 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
922 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
923 "GCJFLAGS=$(GCJFLAGS)" \
924 "LDFLAGS=$(LDFLAGS)" \
925 "LIBCFLAGS=$(LIBCFLAGS)" \
926 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
928 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
929 "PICFLAG=$(PICFLAG)" \
930 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
932 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
933 "exec_prefix=$(exec_prefix)" \
934 "infodir=$(infodir)" \
937 "gxx_include_dir=$(gxx_include_dir)" \
941 "LIBCFLAGS=$(LIBCFLAGS)" \
943 "PICFLAG=$(PICFLAG)" \
947 # Subdir rules rely on $(FLAGS_TO_PASS)
948 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
950 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
954 # No install-html support yet.
958 # Multilib support variables.
967 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
968 maintainer-clean-multi
970 all-recursive: all-multi
971 install-recursive: install-multi
972 mostlyclean-recursive: mostlyclean-multi
973 clean-recursive: clean-multi
974 distclean-recursive: distclean-multi
975 maintainer-clean-recursive: maintainer-clean-multi
978 : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
980 $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
982 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
984 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
986 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
987 maintainer-clean-multi:
988 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean