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 pkgconfigdir = $(libdir)/pkgconfig
44 pkgconfig_DATA = libgcj.pc
46 jardir = $(datadir)/java
47 jar_DATA = libgcj-$(gcc_version).jar
50 JAVA_HOME_DIR = $(JAVA_HOME)
51 BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
53 JAVA_HOME_DIR = $(prefix)
54 BOOT_CLASS_PATH_DIR = $(jardir)/$(jar_DATA)
57 ## FIXME: Using libdir violates GNU coding standards.
58 secdir = $(libdir)/security
59 ## Where to install default logging property file.
62 ## Name of the default .db.
64 ## Compiler specific component of the .db file
65 db_pathtail = gcj-$(gcc_version)/$(db_name)
67 ## For now, only on native systems. FIXME.
69 bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool
71 ## It is convenient to actually build and install the default database
72 ## when gcj-dbtool is available.
73 dbexec_DATA = $(db_name)
76 bin_SCRIPTS = addr2name.awk
78 ## ################################################################
81 ## Compilers and compilation flags.
85 bin_SCRIPTS += scripts/jar
88 ## The compiler with whatever flags we want for both -c and -C
90 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
92 extra_ldflags_libjava = @extra_ldflags_libjava@
94 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
96 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
97 $(LDFLAGS) $(extra_ldflags_libjava) -o $@
99 GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
101 WARNINGS = -Wextra -Wall
102 ## Some systems don't allow `$' in identifiers by default, so we force
103 ## it with -fdollars-in-identifiers. -Wswitch-enum detects bugs in
104 ## the verifier implementation, and maybe other places. We need
105 ## _GNU_SOURCE defined for some Linux builds. It doesn't hurt to
106 ## always define it. Some systems, including Linux, need
107 ## -D_FILE_OFFSET_BITS=64 to enable > 2GB file support.
110 -fnon-call-exceptions \
112 -fdollars-in-identifiers \
114 -D_FILE_OFFSET_BITS=64 \
119 -DPREFIX="\"$(prefix)\"" \
120 -DLIBDIR="\"$(libdir)\"" \
121 -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
122 -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
123 -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
124 -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
125 -DGCJ_VERSIONED_LIBDIR="\"$(libdir)/gcj-$(gcc_version)\"" \
126 -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
127 -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
128 -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\"" \
129 -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\""
133 -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
135 -Wno-deprecated -fbootstrap-classes
137 AM_CFLAGS = @LIBGCJ_CFLAGS@
139 AM_CFLAGS += $(WARNINGS)
142 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
143 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
146 JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
148 LIBFFIINCS = @LIBFFIINCS@
150 AM_CPPFLAGS = -I$(top_srcdir) \
151 -Iinclude -I$(top_srcdir)/include \
152 -I$(top_srcdir)/classpath/include \
153 -Iclasspath/include \
154 -I$(top_srcdir)/classpath/native/fdlibm \
155 $(GCINCS) $(THREADINCS) $(INCLTDL) \
156 $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
158 BOOTCLASSPATH = $(here)/classpath/lib
160 ## ################################################################
162 all_property_files = $(property_files) \
163 java/util/logging/logging.properties
166 ## How to build libgcj.a and libgcj.jar
169 libgij_la_SOURCES = gij.cc
170 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
171 ## See jv_convert_LDADD.
172 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
173 ## The mysterious backslash in the grep pattern is consumed by make.
174 libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
175 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
177 libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
178 link.cc defineclass.cc interpret.cc verify.cc \
179 java/lang/Class.java java/lang/Object.java \
183 libgcj_la_SOURCES += boehm.cc
187 libgcj_la_SOURCES += nogc.cc
190 if USING_POSIX_PLATFORM
191 libgcj_la_SOURCES += posix.cc
194 if USING_WIN32_PLATFORM
195 libgcj_la_SOURCES += win32.cc
199 libgcj_la_SOURCES += darwin.cc
202 if USING_POSIX_THREADS
203 libgcj_la_SOURCES += posix-threads.cc
206 if USING_WIN32_THREADS
207 libgcj_la_SOURCES += win32-threads.cc
211 libgcj_la_SOURCES += no-threads.cc
214 ## Objects from C++ sources in subdirs.
215 nat_files = $(nat_source_files:.cc=.lo)
216 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
218 # Include THREADLIBS here to ensure that the correct version of
219 # certain linuxthread functions get linked:
220 ## The mysterious backslash in the grep pattern is consumed by make.
221 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
222 $(LIBLTDL) $(SYS_ZLIBS) \
223 -version-info `grep -v '^\#' $(srcdir)/libtool-version`
225 classpath/native/fdlibm/libfdlibm.la \
226 $(all_packages_source_files:.list=.lo) \
229 $(LIBFFI) $(ZLIBS) $(GCLIBS)
230 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
231 $(all_packages_source_files:.list=.lo) \
232 $(LIBLTDL) $(libgcj_la_LIBADD)
233 libgcj_la_LINK = $(LIBLINK)
236 ## The .db file. This rule is only used for native builds, so it is
237 ## safe to invoke gcj-dbtool.
238 $(db_name): gcj-dbtool$(EXEEXT)
239 ## In case it exists already.
241 ## We don't actually care if it fails -- if it does, just make an
242 ## empty file. This is simpler than trying to discover when mmap is
244 ./gcj-dbtool -n $(db_name) || touch $(db_name)
246 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
247 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
248 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
249 libgcj.la libgcj.spec \
250 $(lib_gnu_awt_xlib_la_LIBADD)
251 ## We require libstdc++-v3 to be in the same build tree.
252 lib_gnu_awt_xlib_la_CPPFLAGS = \
254 -I../libstdc++-v3/include \
255 -I../libstdc++-v3/include/$(target_noncanonical) \
256 -I$(srcdir)/../libstdc++-v3/libsupc++
257 ## The mysterious backslash in the grep pattern is consumed by make.
258 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
259 @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
260 -rpath $(toolexeclibdir) \
261 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
262 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
264 ## Note that property_files is defined in sources.am.
265 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
267 $(propertyo_files): %.lo: classpath/resource/%
268 $(mkinstalldirs) `dirname $@`; \
269 $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
271 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
272 cd classpath/lib; $(JAR) -cfM \
273 ../../libgcj-$(gcc_version).jar gnu java javax org
275 CLEANFILES = libgcj-$(gcc_version).jar
276 DISTCLEANFILES = native.dirs
279 ## Use libtool rm to remove each libtool object
280 find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
283 ## Remove every .d file that was created.
284 find . -name '*.d' -print | xargs rm -f
286 # Just remove the objects from C++ sources, for testing the C++ compiler.
288 rm -f $(nat_files) $(xlib_nat_files)
290 SUFFIXES = .class .java .h .properties .list
292 ## Pass the list of object files to libtool in a temporary file to
293 ## avoid tripping platform command line length limits.
294 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
295 @echo Creating list of files to link...
296 @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
297 $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
298 -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
300 ## ################################################################
302 ## Compiling a list of java sources to a single .o.
305 $(LTGCJCOMPILE) -c -o $@ -MT $@ -MD -MP -MF $(basename $@).deps @$<
307 ## ################################################################
309 ## This pulls in a number of variable and target definitions.
312 ## ################################################################
315 ## How to build header files.
318 ## We have special rules for certain headers.
319 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
320 java/lang/String.h java/lang/reflect/Constructor.h \
321 java/lang/reflect/Field.h java/lang/reflect/Method.h \
322 java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
324 generic_header_files = $(filter-out $(omitted_headers),$(ordinary_header_files) $(xlib_nat_headers)) \
325 gnu/gcj/tools/gcj_dbtool/Main.h
327 $(generic_header_files): %.h: classpath/lib/%.class
328 name=`echo $< | sed -e 's/\.class$$//' -e 's,classpath/lib/,,'`; \
329 $(mkinstalldirs) `dirname $$name`; \
330 $(GCJH) -d . -classpath '' -bootclasspath classpath/lib $$name
332 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
333 java/io/ObjectInputStream$$GetField.h \
334 java/nio/DirectByteBufferImpl$$ReadWrite.h \
335 java/nio/channels/Pipe$$SinkChannel.h \
336 java/nio/channels/Pipe$$SourceChannel.h \
337 java/lang/reflect/Proxy$$ProxyData.h \
338 java/lang/reflect/Proxy$$ProxyType.h \
339 gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
340 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
341 gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
342 gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
343 $(PLATFORM_INNER_NAT_HDRS)
345 nat_headers = $(ordinary_header_files) $(inner_nat_headers) \
346 gnu/gcj/tools/gcj_dbtool/Main.h
347 nat_headers_install = $(ordinary_header_files)
349 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
351 java/lang/ClassLoader.h: classpath/lib/java/lang/ClassLoader.class
352 $(GCJH) -classpath '' -bootclasspath classpath/lib \
353 -prepend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
354 -prepend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
355 -friend 'jclass (::_Jv_FindClass) (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
356 -friend 'void ::_Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
357 java/lang/ClassLoader
359 java/lang/Thread.h: classpath/lib/java/lang/Thread.class
360 $(GCJH) -classpath '' -bootclasspath classpath/lib \
361 -prepend 'class _Jv_JNIEnv;' \
362 -prepend '#define _JV_NOT_OWNER 1' \
363 -prepend '#define _JV_INTERRUPTED 2' \
364 -prepend '_Jv_JNIEnv * _Jv_GetCurrentJNIEnv ();' \
365 -prepend 'void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
366 -prepend 'void _Jv_ThreadRun (java::lang::Thread* thread);' \
367 -prepend 'jint _Jv_AttachCurrentThread(java::lang::Thread* thread);' \
368 -prepend 'java::lang::Thread* _Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
369 -prepend 'java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
370 -prepend 'jint _Jv_DetachCurrentThread ();' \
371 -friend '_Jv_JNIEnv * ::_Jv_GetCurrentJNIEnv ();' \
372 -friend 'void ::_Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);' \
373 -friend 'void ::_Jv_ThreadRun (java::lang::Thread* thread);' \
374 -friend 'jint (::_Jv_AttachCurrentThread) (java::lang::Thread* thread);' \
375 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);' \
376 -friend 'java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);' \
377 -friend 'jint (::_Jv_DetachCurrentThread) ();' \
380 java/lang/String.h: classpath/lib/java/lang/String.class
381 $(GCJH) -classpath '' -bootclasspath classpath/lib \
382 -prepend 'jchar* _Jv_GetStringChars (jstring str);' \
383 -prepend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
384 -prepend 'jstring* _Jv_StringGetSlot (jstring);' \
385 -prepend 'jstring _Jv_NewStringUtf8Const (_Jv_Utf8Const* str);' \
386 -prepend 'jstring _Jv_NewStringLatin1 (const char*, jsize);' \
387 -prepend 'jstring _Jv_AllocString (jsize);' \
388 -friend 'jchar* ::_Jv_GetStringChars (jstring str);' \
389 -friend 'jstring* ::_Jv_StringFindSlot (jchar*, jint, jint);' \
390 -friend 'jstring* ::_Jv_StringGetSlot (jstring);' \
391 -friend 'jstring (::_Jv_NewStringUtf8Const) (_Jv_Utf8Const* str);' \
392 -friend 'jstring (::_Jv_NewStringLatin1) (const char*, jsize);' \
393 -friend 'jstring (::_Jv_AllocString) (jsize);' \
396 java/lang/reflect/Constructor.h: classpath/lib/java/lang/reflect/Constructor.class
397 $(GCJH) -classpath '' -bootclasspath classpath/lib \
398 -prepend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
399 -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
400 -friend 'jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *);' \
401 -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
402 -friend 'class java::lang::Class;' \
403 java/lang/reflect/Constructor
405 java/lang/reflect/Field.h: classpath/lib/java/lang/reflect/Field.class
406 $(GCJH) -classpath '' -bootclasspath classpath/lib \
407 -prepend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
408 -prepend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
409 -friend 'jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *);' \
410 -friend 'jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
411 -friend 'class java::lang::Class;' \
412 java/lang/reflect/Field
414 java/lang/reflect/Method.h: classpath/lib/java/lang/reflect/Method.class
415 $(GCJH) -classpath '' -bootclasspath classpath/lib \
416 -prepend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
417 -prepend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
418 -friend 'jmethodID (::_Jv_FromReflectedMethod) (java::lang::reflect::Method *);' \
419 -friend 'jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
420 -friend 'class java::lang::Class;' \
421 -friend 'class java::io::ObjectInputStream;' \
422 java/lang/reflect/Method
424 java/lang/reflect/Proxy.h: classpath/lib/java/lang/reflect/Proxy.class
425 $(GCJH) -classpath '' -bootclasspath classpath/lib \
426 java/lang/reflect/Proxy
428 java/lang/reflect/Proxy$$ProxyData.h: classpath/lib/java/lang/reflect/Proxy.class
429 $(GCJH) -classpath '' -bootclasspath classpath/lib \
430 'java/lang/reflect/Proxy$$ProxyData'
432 java/lang/reflect/Proxy$$ProxyType.h: classpath/lib/java/lang/reflect/Proxy.class
433 $(GCJH) -classpath '' -bootclasspath classpath/lib \
434 'java/lang/reflect/Proxy$$ProxyType'
436 gnu/gcj/runtime/ExtensionClassLoader.h: classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
437 $(GCJH) -classpath '' -bootclasspath classpath/lib \
438 -friend 'class ::java::lang::ClassLoader;' \
439 gnu/gcj/runtime/ExtensionClassLoader
441 java/io/ObjectInputStream$$GetField.h: classpath/lib/java/io/ObjectInputStream.class
442 $(GCJH) -classpath '' -bootclasspath classpath/lib \
443 'java/io/ObjectInputStream$$GetField'
445 java/io/ObjectOutputStream$$PutField.h: classpath/lib/java/io/ObjectOutputStream.class
446 $(GCJH) -classpath '' -bootclasspath classpath/lib \
447 'java/io/ObjectOutputStream$$PutField'
449 java/nio/DirectByteBufferImpl$$ReadWrite.h: classpath/lib/java/nio/DirectByteBufferImpl.class
450 $(GCJH) -classpath '' -bootclasspath classpath/lib \
451 'java/nio/DirectByteBufferImpl$$ReadWrite'
453 java/nio/channels/Pipe$$SinkChannel.h: classpath/lib/java/nio/channels/Pipe.class
454 $(GCJH) -classpath '' -bootclasspath classpath/lib \
455 'java/nio/channels/Pipe$$SinkChannel'
457 java/nio/channels/Pipe$$SourceChannel.h: classpath/lib/java/nio/channels/Pipe.class
458 $(GCJH) -classpath '' -bootclasspath classpath/lib \
459 'java/nio/channels/Pipe$$SourceChannel'
461 gnu/java/net/PlainSocketImpl$$SocketInputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
462 $(GCJH) -classpath '' -bootclasspath classpath/lib \
463 'gnu/java/net/PlainSocketImpl$$SocketInputStream'
465 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h: classpath/lib/gnu/java/net/PlainSocketImpl.class
466 $(GCJH) -classpath '' -bootclasspath classpath/lib \
467 'gnu/java/net/PlainSocketImpl$$SocketOutputStream'
469 gnu/java/nio/PipeImpl$$SinkChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
470 $(GCJH) -classpath '' -bootclasspath classpath/lib \
471 'gnu/java/nio/PipeImpl$$SinkChannelImpl'
473 gnu/java/nio/PipeImpl$$SourceChannelImpl.h: classpath/lib/gnu/java/nio/PipeImpl.class
474 $(GCJH) -classpath '' -bootclasspath classpath/lib \
475 'gnu/java/nio/PipeImpl$$SourceChannelImpl'
477 ## Only used by PosixProcess.java
478 java/lang/ConcreteProcess$$ProcessManager.h: classpath/lib/java/lang/ConcreteProcess.class
479 $(GCJH) -classpath '' -bootclasspath classpath/lib \
480 'java/lang/ConcreteProcess$$ProcessManager'
482 ## Headers we maintain by hand and which we want to install.
483 extra_headers = java/lang/Object.h java/lang/Class.h
485 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
488 ## Install the headers. It is fairly ugly that we have to do this by
492 ## We use a GNU make trick here so that we don't go over the command
493 ## length limit of some shells.
494 @echo Creating list of headers to install...
495 @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
496 @cat tmp-ilist | while read f; do \
497 d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
498 $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
499 if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
500 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
501 $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
504 ## FIXME: the obvious approach using lib_DATA doesn't work with
506 $(mkinstalldirs) $(DESTDIR)$(secdir)
507 @for f in libgcj.security; do \
508 echo " $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f"; \
509 $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f; \
511 $(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
512 ## Install inner class headers.
513 $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
514 $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
515 $(INSTALL_DATA) 'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
516 $(INSTALL_DATA) 'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
517 $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
518 $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
519 $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
520 $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
521 $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
522 $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
523 ## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
526 ## ################################################################
529 ## Additional `check' targets for maintainer convenience.
532 ## This is used for maintainer-check. FIXME: should set from
533 ## configure using AC_CHECK_TOOL.
536 ## Try to make sure our library doesn't stomp the namespace.
537 maintainer-check: libgcj.la
538 $(NM) .libs/libgcj.a | grep ' T ' \
539 ## Anything with `4java' is assumed to be from .java source.
541 ## Anything with Jv is ok.
543 ## `terminate' and `unexpected' are part of the runtime.
544 | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
546 ## This rule can be used to see if the headers are more or less
548 header-check: libgcj-$(gcc_version).jar $(nat_headers)
550 for h in $(nat_headers); do \
551 echo "#include \"$$h\"" >> htest.cc; \
553 $(CXXCOMPILE) -fsyntax-only htest.cc
555 ## This rule can be used to see if all the .class files verify
557 class-check: libgcj-$(gcc_version).jar
558 @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
560 echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
561 if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
565 ## This rule checks whether write_entries_to_file works properly.
566 write-entries-to-file-check:
567 @echo Creating list of files to link...
568 @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
570 ## ################################################################
573 ## The `jv-convert' program and code to rebuild the converter header
577 ## it only makes sense to try to rebuild the JIS .h files on native
581 noinst_PROGRAMS = gen-from-JIS
583 gen_from_JIS_SOURCES = \
584 gnu/gcj/convert/gen-from-JIS.c \
585 gnu/gcj/convert/make-trie.c
587 gen_from_JIS_DEPENDENCIES = \
588 gnu/gcj/convert/JIS0201.h \
589 gnu/gcj/convert/JIS0208.h \
590 gnu/gcj/convert/JIS0212.h
592 $(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
593 ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
595 $(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
596 ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
598 $(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
599 ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
601 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
602 # You can get it from
603 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
605 $(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
606 echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
607 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
608 | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2) /*\3 */|p' \
610 mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
612 # The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
613 # You can get it from
614 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
616 $(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
617 echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
618 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
619 | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4) /*\5 */|p' \
621 mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
623 # The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
624 # You can get it from
625 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
627 $(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
628 echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
629 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
630 | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3) /*\4 */|p' \
632 mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
639 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
640 ## need this because we are explicitly using libtool to link using the
642 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
643 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
644 jv_convert_LINK = $(GCJLINK)
645 ## We don't explicitly link in the libraries we need; libgcj.la brings
646 ## in all dependencies. We need the -L so that gcj can find libgcj
647 ## with `-lgcj', but it must come first, otherwise the -L flags
648 ## brought in from libgcj.la would cause the install directories to be
649 ## searched before the build-tree ones, and we'd get errors because of
650 ## different libraries with the same SONAME from picky linkers such as
651 ## Solaris'. FIXME: should be _libs on some systems.
652 jv_convert_LDADD = -L$(here)/.libs libgcj.la
653 ## Depend on the spec file to make sure it is up to date before
654 ## linking this program.
655 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
657 gcj_dbtool_SOURCES = \
658 gnu/gcj/tools/gcj_dbtool/Main.java \
659 gnu/gcj/tools/gcj_dbtool/natMain.cc
661 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
662 ## need this because we are explicitly using libtool to link using the
664 gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
665 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
666 gcj_dbtool_LINK = $(GCJLINK)
667 ## We don't explicitly link in the libraries we need; libgcj.la brings
668 ## in all dependencies. We need the -L so that gcj can find libgcj
669 ## with `-lgcj', but it must come first, otherwise the -L flags
670 ## brought in from libgcj.la would cause the install directories to be
671 ## searched before the build-tree ones, and we'd get errors because of
672 ## different libraries with the same SONAME from picky linkers such as
673 ## Solaris'. FIXME: should be _libs on some systems.
674 gcj_dbtool_LDADD = -L$(here)/.libs libgcj.la
675 ## Depend on the spec file to make sure it is up to date before
676 ## linking this program.
677 gcj_dbtool_DEPENDENCIES = libgcj.la libgcj.spec
680 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
681 ## need this because we are explicitly using libtool to link using the
683 gij_LDFLAGS = -rpath $(libdir)/gcj-$(gcc_version) -rpath $(toolexeclibdir) \
684 -shared-libgcc $(THREADLDFLAGS)
685 gij_LINK = $(GCJLINK)
686 ## See jv_convert_LDADD.
687 gij_LDADD = -L$(here)/.libs libgij.la
688 ## Depend on the spec file to make sure it is up to date before
689 ## linking this program.
690 gij_DEPENDENCIES = libgij.la
692 ## This is a dummy definition.
694 grmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
695 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
696 grmic_LINK = $(GCJLINK)
697 ## See jv_convert_LDADD.
698 grmic_LDADD = -L$(here)/.libs libgcj.la
699 ## Depend on the spec file to make sure it is up to date before
700 ## linking this program.
701 grmic_DEPENDENCIES = libgcj.la libgcj.spec
703 ## This is a dummy definition.
704 grmiregistry_SOURCES =
705 grmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
706 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
707 grmiregistry_LINK = $(GCJLINK)
708 ## See jv_convert_LDADD.
709 grmiregistry_LDADD = -L$(here)/.libs libgcj.la
710 ## Depend on the spec file to make sure it is up to date before
711 ## linking this program.
712 grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
714 ## ################################################################
716 ## This lists all the C++ source files in subdirectories.
718 gnu/classpath/natSystemProperties.cc \
720 gnu/gcj/convert/JIS0208_to_Unicode.cc \
721 gnu/gcj/convert/JIS0212_to_Unicode.cc \
722 gnu/gcj/convert/Unicode_to_JIS.cc \
723 gnu/gcj/convert/natIconv.cc \
724 gnu/gcj/convert/natInput_EUCJIS.cc \
725 gnu/gcj/convert/natInput_SJIS.cc \
726 gnu/gcj/convert/natOutput_EUCJIS.cc \
727 gnu/gcj/convert/natOutput_SJIS.cc \
728 gnu/gcj/io/natSimpleSHSStream.cc \
730 gnu/gcj/runtime/natFinalizerThread.cc \
731 gnu/gcj/runtime/natSharedLibLoader.cc \
732 gnu/gcj/runtime/natSystemClassLoader.cc \
733 gnu/gcj/runtime/natStringBuffer.cc \
734 gnu/gcj/util/natDebug.cc \
735 gnu/java/lang/natMainThread.cc \
736 gnu/java/net/natPlainDatagramSocketImpl.cc \
737 gnu/java/net/natPlainSocketImpl.cc \
738 gnu/java/net/protocol/core/natCoreInputStream.cc \
739 gnu/java/nio/natPipeImpl.cc \
740 gnu/java/nio/natSelectorImpl.cc \
741 gnu/java/nio/natNIOServerSocket.cc \
742 gnu/java/nio/channels/natFileChannelImpl.cc \
744 java/io/natObjectInputStream.cc \
745 java/io/natVMObjectStreamClass.cc \
746 java/lang/natCharacter.cc \
747 java/lang/natClass.cc \
748 java/lang/natClassLoader.cc \
749 java/lang/natConcreteProcess.cc \
750 java/lang/natDouble.cc \
751 java/lang/natFloat.cc \
752 java/lang/natMath.cc \
753 java/lang/natObject.cc \
754 java/lang/natRuntime.cc \
755 java/lang/natString.cc \
756 java/lang/natStringBuffer.cc \
757 java/lang/natStringBuilder.cc \
758 java/lang/natSystem.cc \
759 java/lang/natThread.cc \
760 java/lang/natVMClassLoader.cc \
761 java/lang/natVMSecurityManager.cc \
762 java/lang/natVMThrowable.cc \
763 java/lang/ref/natReference.cc \
764 java/lang/reflect/natArray.cc \
765 java/lang/reflect/natConstructor.cc \
766 java/lang/reflect/natField.cc \
767 java/lang/reflect/natMethod.cc \
768 java/net/natVMNetworkInterface.cc \
769 java/net/natInetAddress.cc \
770 java/nio/channels/natVMChannels.cc \
771 java/nio/natDirectByteBufferImpl.cc \
772 java/text/natCollator.cc \
773 java/util/natResourceBundle.cc \
774 java/util/natVMTimeZone.cc \
775 java/util/logging/natLogger.cc \
776 java/util/zip/natDeflater.cc \
777 java/util/zip/natInflater.cc
779 xlib_nat_source_files = \
780 gnu/gcj/xlib/natClip.cc \
781 gnu/gcj/xlib/natColormap.cc \
782 gnu/gcj/xlib/natDisplay.cc \
783 gnu/gcj/xlib/natDrawable.cc \
784 gnu/gcj/xlib/natFont.cc \
785 gnu/gcj/xlib/natGC.cc \
786 gnu/gcj/xlib/natPixmap.cc \
787 gnu/gcj/xlib/natScreen.cc \
788 gnu/gcj/xlib/natVisual.cc \
789 gnu/gcj/xlib/natWMSizeHints.cc \
790 gnu/gcj/xlib/natWindow.cc \
791 gnu/gcj/xlib/natWindowAttributes.cc \
792 gnu/gcj/xlib/natXAnyEvent.cc \
793 gnu/gcj/xlib/natXButtonEvent.cc \
794 gnu/gcj/xlib/natXColor.cc \
795 gnu/gcj/xlib/natXConfigureEvent.cc \
796 gnu/gcj/xlib/natXException.cc \
797 gnu/gcj/xlib/natXExposeEvent.cc \
798 gnu/gcj/xlib/natXImage.cc \
799 gnu/gcj/xlib/natXUnmapEvent.cc
801 ## ################################################################
804 ## Creating and installing sources.zip
807 ## Create a zip holding all the sources. This can be meaningfully
813 ( cd $(srcdir)/classpath; \
814 find java gnu javax org -name '*.java' -print | \
815 while read file; do \
816 ## Ugly code to avoid "echo -C". Must separate each entry by a newline
818 echo "x-C" | sed -e 's/^.//'; \
819 echo $(srcdir)/classpath; \
822 ## Now the build tree.
824 find gnu java -name '*.java' -print | \
825 while read file; do \
826 echo "x-C" | sed -e 's/^.//'; \
831 ## Many of the above circumlocutions were because ZIP used to be a
832 ## relative path to fastjar. It didn't seem worthwhile to change the
833 ## code when we moved to an external jar.
834 $(JAR) -cfM@ $$here/src.zip
835 ## Override GNU Classpath sources with libgcj replacements.
839 find gnu java -name '*.java' -print | \
840 while read file; do \
841 echo "x-C" | sed -e 's/^.//'; \
846 $(JAR) -ufM@ $$here/src.zip
848 ## We use a variable for this in case the user wants to override it.
849 sourcesdir = $(jardir)
851 install-src.zip: src.zip
852 $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
855 ## ################################################################
858 ## Dependency tracking madness.
861 ## This is an evil hack to work around an automake limitation. We
862 ## need to ensure that all CNI headers are built, not just the ones
863 ## used internally by libgcj. We can't make the .o files depend on
864 ## nat_headers, because in that case we'll force a complete rebuild of
865 ## the C++ code whenever any .java file is touched. So instead we
866 ## have a dummy rule which is only used once, namely the first time a
867 ## build is done. On subsequent builds, the dependency tracking for
868 ## the .cc compilations will have picked up the .h files, and these
869 ## will be built directly as needed.
872 ## Note that we don't use a real dependency here, since we don't want
873 ## to rebuild all the headers here when the header list changes. If
874 ## we did rebuild here, then any addition of a .java file would cause
875 ## a large number of recompilations.
876 $(MAKE) create-headers
877 @echo > headers.stamp
879 headers_to_make = $(nat_headers)
881 headers_to_make += $(xlib_nat_headers)
884 create-headers: $(headers_to_make)
886 .PHONY: create-headers
888 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
889 $(libgij_la_OBJECTS): headers.stamp
891 ## ################################################################
894 ## This section is for make and multilib madness.
897 # Work around what appears to be a GNU make bug handling MAKEFLAGS
898 # values defined in terms of make variables, as is the case for CC and
899 # friends when we are called from the top level Makefile.
901 "AR_FLAGS=$(AR_FLAGS)" \
902 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
904 "CXXFLAGS=$(CXXFLAGS)" \
905 "CPPFLAGS=$(CPPFLAGS)" \
906 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
907 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
908 "INSTALL=$(INSTALL)" \
909 "INSTALL_DATA=$(INSTALL_DATA)" \
910 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
911 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
912 "GCJFLAGS=$(GCJFLAGS)" \
913 "LDFLAGS=$(LDFLAGS)" \
914 "LIBCFLAGS=$(LIBCFLAGS)" \
915 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
917 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
918 "PICFLAG=$(PICFLAG)" \
919 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
921 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
922 "exec_prefix=$(exec_prefix)" \
923 "infodir=$(infodir)" \
926 "gxx_include_dir=$(gxx_include_dir)" \
930 "LIBCFLAGS=$(LIBCFLAGS)" \
932 "PICFLAG=$(PICFLAG)" \
936 # Subdir rules rely on $(FLAGS_TO_PASS)
937 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
939 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
943 # No install-html support yet.
947 # Multilib support variables.
956 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
957 maintainer-clean-multi
959 all-recursive: all-multi
960 install-recursive: install-multi
961 mostlyclean-recursive: mostlyclean-multi
962 clean-recursive: clean-multi
963 distclean-recursive: distclean-multi
964 maintainer-clean-recursive: maintainer-clean-multi
967 : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
969 $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
971 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
973 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
975 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
976 maintainer-clean-multi:
977 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean