2006-07-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
[official-gcc.git] / libjava / Makefile.am
blobc0ba596effa5bb43ba4b20751f8ecfa4bea1a44a
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
11 if TESTSUBDIR
12 SUBDIRS += testsuite
13 endif
15 # write_entries_to_file - writes each entry in a list
16 # to the specified file. Each entry is written individually
17 # to accomodate systems with severe command-line-length
18 # limitations.
19 # Parameters:
20 # $(1): variable containing entries to iterate over
21 # $(2): output file
22 write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
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
39 if XLIB_AWT
40 toolexeclib_LTLIBRARIES += lib-gnu-awt-xlib.la
41 endif
43 if QT_AWT
44 toolexeclib_LTLIBRARIES += lib-gnu-java-awt-peer-qt.la
45 endif
47 pkgconfigdir = $(libdir)/pkgconfig
48 pkgconfig_DATA = libgcj.pc
50 jardir = $(datadir)/java
51 jar_DATA = libgcj-$(gcc_version).jar
53 if JAVA_HOME_SET
54 JAVA_HOME_DIR = $(JAVA_HOME)
55 BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
56 else
57 JAVA_HOME_DIR = $(prefix)
58 BOOT_CLASS_PATH_DIR = $(jardir)/$(jar_DATA)
59 endif
61 ## FIXME: Using libdir violates GNU coding standards.
62 secdir = $(libdir)/security
63 ## Where to install default logging property file.
64 propdir = $(libdir)
66 ## Name of the default .db.
67 db_name = classmap.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.
72 if NATIVE
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)
78 endif
80 bin_SCRIPTS = addr2name.awk
82 ## ################################################################
85 ## Compilers and compilation flags.
88 if BASH_JAR
89 bin_SCRIPTS += scripts/jar
90 endif
92 ## The compiler with whatever flags we want for both -c and -C
93 ## compiles.
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) \
99           $(LDFLAGS) -o $@
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.
112 AM_CXXFLAGS = \
113         -fno-rtti \
114         -fnon-call-exceptions \
115         $(THREADCXXFLAGS) \
116         -fdollars-in-identifiers \
117         -Wswitch-enum \
118         -D_FILE_OFFSET_BITS=64 \
119         @LIBGCJ_CXXFLAGS@ \
120         @X_CFLAGS@ \
121         $(WARNINGS) \
122         -D_GNU_SOURCE \
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)\""
135 AM_GCJFLAGS = \
136         @LIBGCJ_JAVAFLAGS@ \
137         -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
138         --encoding=UTF-8 \
139         -Wno-deprecated -fbootstrap-classes
141 AM_CFLAGS = @LIBGCJ_CFLAGS@
142 if USING_GCC
143 AM_CFLAGS += $(WARNINGS)
144 endif
146 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
147 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
149 JCFLAGS = -g
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         $(nat_source_files)
185 if USING_BOEHMGC
186 libgcj_la_SOURCES += boehm.cc
187 endif
189 if USING_NOGC
190 libgcj_la_SOURCES += nogc.cc
191 endif
193 if USING_POSIX_PLATFORM
194 libgcj_la_SOURCES += posix.cc
195 endif
197 if USING_WIN32_PLATFORM
198 libgcj_la_SOURCES += win32.cc
199 endif
201 if USING_DARWIN_CRT
202 libgcj_la_SOURCES += darwin.cc
203 endif
205 if USING_POSIX_THREADS
206 libgcj_la_SOURCES += posix-threads.cc
207 endif
209 if USING_WIN32_THREADS
210 libgcj_la_SOURCES += win32-threads.cc
211 endif
213 if USING_NO_THREADS
214 libgcj_la_SOURCES += no-threads.cc
215 endif
217 ## Objects from C++ sources in subdirs.
218 nat_files = $(nat_source_files:.cc=.lo)
219 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
221 # Include THREADLIBS here to ensure that the correct version of
222 # certain linuxthread functions get linked:
223 ## The mysterious backslash in the grep pattern is consumed by make.
224 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
225         $(LIBLTDL) $(SYS_ZLIBS) \
226         -version-info `grep -v '^\#' $(srcdir)/libtool-version`
227 libgcj_la_LIBADD = \
228         classpath/native/fdlibm/libfdlibm.la \
229         java/lang/Object.lo \
230         java/lang/Class.lo \
231         $(all_packages_source_files:.list=.lo) \
232         $(bc_objects) \
233         $(propertyo_files) \
234         $(LIBFFI) $(ZLIBS) $(GCLIBS)
235 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
236         $(all_packages_source_files:.list=.lo) \
237         $(LIBLTDL) $(libgcj_la_LIBADD)
238 libgcj_la_LINK = $(LIBLINK)
240 ## A hack to make sure the various gcj-related macros, like
241 ## LTGCJCOMPILE, are defined by automake.  This is never actually
242 ## compiled.
243 EXTRA_libgcj_la_SOURCES = java/lang/Object.java
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.
250         @rm -f $(db_name)
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
253 ## not available.
254         ./gcj-dbtool -n $(db_name) || touch $(db_name)
256 lib_gnu_java_awt_peer_qt_la_SOURCES =
257 lib_gnu_java_awt_peer_qt_la_LIBADD = \
258         gnu-java-awt-peer-qt.lo \
259         classpath/native/jni/qt-peer/libqtpeer.la
260 lib_gnu_java_awt_peer_qt_la_DEPENDENCIES = gnu-java-awt-peer-qt.lo \
261         classpath/native/jni/qt-peer/libqtpeer.la \
262         libgcj-$(gcc_version).jar libgcj.la libgcj.spec
263 ## The mysterious backslash in the grep pattern is consumed by make.
264 lib_gnu_java_awt_peer_qt_la_LDFLAGS = \
265         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
266 lib_gnu_java_awt_peer_qt_la_LINK = $(LIBLINK)
268 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
269 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
270 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
271         libgcj.la libgcj.spec \
272         $(lib_gnu_awt_xlib_la_LIBADD)
273 ## We require libstdc++-v3 to be in the same build tree.
274 lib_gnu_awt_xlib_la_CPPFLAGS = \
275         $(AM_CPPFLAGS) \
276         -I../libstdc++-v3/include \
277         -I../libstdc++-v3/include/$(target_noncanonical) \
278         -I$(srcdir)/../libstdc++-v3/libsupc++
279 ## The mysterious backslash in the grep pattern is consumed by make.
280 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
281         @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
282         -rpath $(toolexeclibdir) \
283         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
284 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
286 ## Note that property_files is defined in sources.am.
287 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
289 $(propertyo_files): %.lo: classpath/resource/%
290         $(mkinstalldirs) `dirname $@`; \
291         $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
293 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
294         cd classpath/lib; $(JAR) -cfM \
295             ../../libgcj-$(gcc_version).jar gnu java javax org
297 CLEANFILES = libgcj-$(gcc_version).jar
298 DISTCLEANFILES = native.dirs
300 mostlyclean-local:
301 ## Use libtool rm to remove each libtool object
302         find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
304 distclean-local:
305 ## Remove every .d file that was created.
306         find . -name '*.d' -print | xargs rm -f
308 # Just remove the objects from C++ sources, for testing the C++ compiler.
309 clean-nat:
310         rm -f $(nat_files) $(xlib_nat_files)
312 SUFFIXES = .class .java .h .properties .list
314 ## Pass the list of object files to libtool in a temporary file to
315 ## avoid tripping platform command line length limits.
316 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
317         @echo Creating list of files to link...
318         @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
319         $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
320         -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
322 ## ################################################################
324 ## Compiling a list of java sources to a single .o.
326 %.lo: %.list
327         $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(here)/classpath/lib/classes -MT $@ -MD -MP -MF $(basename $@).deps @$<
329 java/lang/Object.lo: classpath/lib/java/lang/Object.class
330         $(LTGCJCOMPILE) -c -o $@ $<
332 java/lang/Class.lo: classpath/lib/java/lang/Class.class
333         $(LTGCJCOMPILE) -c -o $@ $<
335 ## ################################################################
337 ## This pulls in a number of variable and target definitions.
338 include sources.am
340 ## ################################################################
343 ## How to build header files.
346 ## We have special rules for certain headers.
347 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
348         java/lang/String.h java/lang/reflect/Constructor.h \
349         java/lang/reflect/Field.h java/lang/reflect/Method.h \
350         java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
352 generic_header_files = $(ordinary_header_files) $(xlib_nat_headers)
354 MYGCJH = gcjh1
356 $(generic_header_files):
357         $(MYGCJH) --cni --all classpath/lib --cmdfile=$(srcdir)/headers.txt
359 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
360         java/io/ObjectInputStream$$GetField.h \
361         java/nio/DirectByteBufferImpl$$ReadWrite.h \
362         java/nio/channels/Pipe$$SinkChannel.h \
363         java/nio/channels/Pipe$$SourceChannel.h \
364         java/lang/reflect/Proxy$$ProxyData.h \
365         java/lang/reflect/Proxy$$ProxyType.h \
366         gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
367         gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
368         gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
369         gnu/java/nio/PipeImpl$$SourceChannelImpl.h \
370         $(PLATFORM_INNER_NAT_HDRS)
372 nat_headers = $(ordinary_header_files) $(inner_nat_headers)
373 nat_headers_install = $(ordinary_header_files)
375 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
377 ## Headers we maintain by hand and which we want to install.
378 extra_headers = java/lang/Object.h java/lang/Class.h
380 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
381         @:
383 ## Install the headers.  It is fairly ugly that we have to do this by
384 ## hand.
385 install-data-local:
386         $(PRE_INSTALL)
387 ## We use a GNU make trick here so that we don't go over the command
388 ## length limit of some shells.
389         @echo Creating list of headers to install...
390         @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
391         @cat tmp-ilist | while read f; do \
392           d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
393           $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
394           if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
395           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
396           $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
397         done
398         -@rm -f tmp-ilist
399 ## FIXME: the obvious approach using lib_DATA doesn't work with
400 ## automake 1.4.
401         $(mkinstalldirs) $(DESTDIR)$(secdir)
402         @for f in libgcj.security; do \
403           echo " $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f"; \
404           $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f; \
405         done
406         $(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
407 ## Install inner class headers.
408         $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
409         $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
410         $(INSTALL_DATA) 'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
411         $(INSTALL_DATA) 'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
412         $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
413         $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
414         $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
415         $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
416         $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
417         $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
418 ## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
421 ## ################################################################
424 ## Additional `check' targets for maintainer convenience.
427 ## This is used for maintainer-check.  FIXME: should set from
428 ## configure using AC_CHECK_TOOL.
429 NM = nm
431 ## Try to make sure our library doesn't stomp the namespace.
432 maintainer-check: libgcj.la
433         $(NM) .libs/libgcj.a | grep ' T ' \
434 ## Anything with `4java' is assumed to be from .java source.
435           | grep -v '4java' \
436 ## Anything with Jv is ok.
437           | grep -v 'Jv' \
438 ## `terminate' and `unexpected' are part of the runtime.
439           | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
441 ## This rule can be used to see if the headers are more or less
442 ## correct.
443 header-check: libgcj-$(gcc_version).jar $(nat_headers)
444         rm -f htest.cc; \
445         for h in $(nat_headers); do \
446           echo "#include \"$$h\"" >> htest.cc; \
447         done; \
448         $(CXXCOMPILE) -fsyntax-only htest.cc
450 ## This rule can be used to see if all the .class files verify
451 ## correctly.
452 class-check: libgcj-$(gcc_version).jar
453         @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
454         while read f; do \
455           echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
456           if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
457           :; else ok=1; fi; \
458         done; exit $$ok
460 ## This rule checks whether write_entries_to_file works properly.
461 write-entries-to-file-check:
462         @echo Creating list of files to link...
463         @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
465 ## ################################################################
468 ## The `jv-convert' program and code to rebuild the converter header
469 ## files.
472 ## it only makes sense to try to rebuild the JIS .h files on native
473 ## systems.
474 if NATIVE
475 if MAINTAINER_MODE
476 noinst_PROGRAMS = gen-from-JIS
478 gen_from_JIS_SOURCES = \
479         gnu/gcj/convert/gen-from-JIS.c \
480         gnu/gcj/convert/make-trie.c
482 gen_from_JIS_DEPENDENCIES = \
483         gnu/gcj/convert/JIS0201.h \
484         gnu/gcj/convert/JIS0208.h \
485         gnu/gcj/convert/JIS0212.h
487 $(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
488          ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
490 $(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
491          ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
493 $(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
494          ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
496 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
497 # You can get it from
498 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
500 $(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
501         echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
502         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
503         | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2)  /*\3 */|p' \
504         >> tmp-0201; \
505         mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
507 # The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
508 # You can get it from
509 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
511 $(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
512         echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
513         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
514         | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4)  /*\5 */|p' \
515         >> tmp-0208; \
516         mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
518 # The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
519 # You can get it from
520 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
522 $(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
523         echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
524         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
525         | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3)  /*\4 */|p' \
526         >> tmp-0212; \
527         mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
529 endif
530 endif 
533 jv_convert_SOURCES =
534 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
535 ## need this because we are explicitly using libtool to link using the
536 ## `.la' file.
537 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
538         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
539 jv_convert_LINK = $(GCJLINK)
540 ## We don't explicitly link in the libraries we need; libgcj.la brings
541 ## in all dependencies.  We need the -L so that gcj can find libgcj
542 ## with `-lgcj', but it must come first, otherwise the -L flags
543 ## brought in from libgcj.la would cause the install directories to be
544 ## searched before the build-tree ones, and we'd get errors because of
545 ## different libraries with the same SONAME from picky linkers such as
546 ## Solaris'.  FIXME: should be _libs on some systems.
547 jv_convert_LDADD = -L$(here)/.libs libgcj.la
548 ## Depend on the spec file to make sure it is up to date before
549 ## linking this program.
550 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
552 gcj_dbtool_SOURCES = \
553 gnu/gcj/tools/gcj_dbtool/natMain.cc
555 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
556 ## need this because we are explicitly using libtool to link using the
557 ## `.la' file.
558 gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
559         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
560 gcj_dbtool_LINK = $(GCJLINK)
561 ## We don't explicitly link in the libraries we need; libgcj.la brings
562 ## in all dependencies.  We need the -L so that gcj can find libgcj
563 ## with `-lgcj', but it must come first, otherwise the -L flags
564 ## brought in from libgcj.la would cause the install directories to be
565 ## searched before the build-tree ones, and we'd get errors because of
566 ## different libraries with the same SONAME from picky linkers such as
567 ## Solaris'.  FIXME: should be _libs on some systems.
568 gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$(here)/.libs libgcj.la
569 ## Depend on the spec file to make sure it is up to date before
570 ## linking this program.
571 gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la libgcj.spec
573 gij_SOURCES = 
574 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
575 ## need this because we are explicitly using libtool to link using the
576 ## `.la' file.
577 gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
578 gij_LINK = $(GCJLINK)
579 ## See jv_convert_LDADD.
580 gij_LDADD = -L$(here)/.libs libgij.la
581 ## Depend on the spec file to make sure it is up to date before
582 ## linking this program.
583 gij_DEPENDENCIES = libgij.la
585 ## This is a dummy definition.
586 grmic_SOURCES =
587 grmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
588         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
589 grmic_LINK = $(GCJLINK)
590 ## See jv_convert_LDADD.
591 grmic_LDADD = -L$(here)/.libs libgcj.la
592 ## Depend on the spec file to make sure it is up to date before
593 ## linking this program.
594 grmic_DEPENDENCIES = libgcj.la libgcj.spec
596 ## This is a dummy definition.
597 grmiregistry_SOURCES =
598 grmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
599         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
600 grmiregistry_LINK = $(GCJLINK)
601 ## See jv_convert_LDADD.
602 grmiregistry_LDADD = -L$(here)/.libs libgcj.la
603 ## Depend on the spec file to make sure it is up to date before
604 ## linking this program.
605 grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
607 ## ################################################################
609 ## This lists all the C++ source files in subdirectories.
610 nat_source_files = \
611 gnu/classpath/natSystemProperties.cc \
612 gnu/gcj/natCore.cc \
613 gnu/gcj/convert/JIS0208_to_Unicode.cc \
614 gnu/gcj/convert/JIS0212_to_Unicode.cc \
615 gnu/gcj/convert/Unicode_to_JIS.cc \
616 gnu/gcj/convert/natIconv.cc \
617 gnu/gcj/convert/natInput_EUCJIS.cc \
618 gnu/gcj/convert/natInput_SJIS.cc \
619 gnu/gcj/convert/natOutput_EUCJIS.cc \
620 gnu/gcj/convert/natOutput_SJIS.cc \
621 gnu/gcj/io/natSimpleSHSStream.cc \
622 gnu/gcj/io/shs.cc \
623 gnu/gcj/runtime/natFinalizerThread.cc \
624 gnu/gcj/runtime/natSharedLibLoader.cc \
625 gnu/gcj/runtime/natSystemClassLoader.cc \
626 gnu/gcj/runtime/natStringBuffer.cc \
627 gnu/gcj/util/natDebug.cc \
628 gnu/java/lang/natMainThread.cc \
629 gnu/java/net/natPlainDatagramSocketImpl.cc \
630 gnu/java/net/natPlainSocketImpl.cc \
631 gnu/java/net/protocol/core/natCoreInputStream.cc \
632 gnu/java/nio/natPipeImpl.cc \
633 gnu/java/nio/natSelectorImpl.cc \
634 gnu/java/nio/natNIOServerSocket.cc \
635 gnu/java/nio/channels/natFileChannelImpl.cc \
636 java/io/natFile.cc \
637 java/io/natObjectInputStream.cc \
638 java/io/natVMObjectStreamClass.cc \
639 java/lang/natCharacter.cc \
640 java/lang/natClass.cc \
641 java/lang/natClassLoader.cc \
642 java/lang/natConcreteProcess.cc \
643 java/lang/natDouble.cc \
644 java/lang/natFloat.cc \
645 java/lang/natMath.cc \
646 java/lang/natObject.cc \
647 java/lang/natRuntime.cc \
648 java/lang/natString.cc \
649 java/lang/natStringBuffer.cc \
650 java/lang/natStringBuilder.cc \
651 java/lang/natSystem.cc \
652 java/lang/natThread.cc \
653 java/lang/natVMClassLoader.cc \
654 java/lang/natVMSecurityManager.cc \
655 java/lang/natVMThrowable.cc \
656 java/lang/ref/natReference.cc \
657 java/lang/reflect/natArray.cc \
658 java/lang/reflect/natConstructor.cc \
659 java/lang/reflect/natField.cc \
660 java/lang/reflect/natMethod.cc \
661 java/net/natVMNetworkInterface.cc \
662 java/net/natInetAddress.cc \
663 java/nio/channels/natVMChannels.cc \
664 java/nio/natDirectByteBufferImpl.cc \
665 java/text/natCollator.cc \
666 java/util/natResourceBundle.cc \
667 java/util/natVMTimeZone.cc \
668 java/util/logging/natLogger.cc \
669 java/util/zip/natDeflater.cc \
670 java/util/zip/natInflater.cc
672 xlib_nat_source_files = \
673 gnu/gcj/xlib/natClip.cc \
674 gnu/gcj/xlib/natColormap.cc \
675 gnu/gcj/xlib/natDisplay.cc \
676 gnu/gcj/xlib/natDrawable.cc \
677 gnu/gcj/xlib/natFont.cc \
678 gnu/gcj/xlib/natGC.cc \
679 gnu/gcj/xlib/natPixmap.cc \
680 gnu/gcj/xlib/natScreen.cc \
681 gnu/gcj/xlib/natVisual.cc \
682 gnu/gcj/xlib/natWMSizeHints.cc \
683 gnu/gcj/xlib/natWindow.cc \
684 gnu/gcj/xlib/natWindowAttributes.cc \
685 gnu/gcj/xlib/natXAnyEvent.cc \
686 gnu/gcj/xlib/natXButtonEvent.cc \
687 gnu/gcj/xlib/natXColor.cc \
688 gnu/gcj/xlib/natXConfigureEvent.cc \
689 gnu/gcj/xlib/natXException.cc \
690 gnu/gcj/xlib/natXExposeEvent.cc \
691 gnu/gcj/xlib/natXImage.cc \
692 gnu/gcj/xlib/natXUnmapEvent.cc
694 ## ################################################################
697 ## Creating and installing sources.zip
700 ## Create a zip holding all the sources.  This can be meaningfully
701 ## used in Eclipse.
702 src.zip:
703         -rm -f src.zip
704         here=`pwd`; \
705         ( \
706           ( cd $(srcdir)/classpath; \
707           find java gnu javax org -name '*.java' -print | \
708           while read file; do \
709 ## Ugly code to avoid "echo -C".  Must separate each entry by a newline
710 ## Gross but easy.
711             echo "x-C" | sed -e 's/^.//'; \
712             echo $(srcdir)/classpath; \
713             echo $$file; \
714           done ); \
715 ## Now the build tree.
716           ( cd classpath; \
717             find gnu java -name '*.java' -print | \
718             while read file; do \
719             echo "x-C" | sed -e 's/^.//'; \
720             echo `pwd`; \
721             echo $$file; \
722           done ); \
723         ) | \
724 ## Many of the above circumlocutions were because ZIP used to be a
725 ## relative path to fastjar.  It didn't seem worthwhile to change the
726 ## code when we moved to an external jar.
727         $(JAR) -cfM@ $$here/src.zip
728 ## Override GNU Classpath sources with libgcj replacements.
729         here=`pwd`; \
730         ( \
731           ( cd $(srcdir); \
732           find gnu java -name '*.java' -print | \
733           while read file; do \
734             echo "x-C" | sed -e 's/^.//'; \
735             echo $(srcdir); \
736             echo $$file; \
737           done ); \
738         ) | \
739         $(JAR) -ufM@ $$here/src.zip
741 ## We use a variable for this in case the user wants to override it.
742 sourcesdir = $(jardir)
744 install-src.zip: src.zip
745         $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
748 ## ################################################################
751 ## Dependency tracking madness.
754 ## This is an evil hack to work around an automake limitation.  We
755 ## need to ensure that all CNI headers are built, not just the ones
756 ## used internally by libgcj. We can't make the .o files depend on
757 ## nat_headers, because in that case we'll force a complete rebuild of
758 ## the C++ code whenever any .java file is touched.  So instead we
759 ## have a dummy rule which is only used once, namely the first time a
760 ## build is done.  On subsequent builds, the dependency tracking for
761 ## the .cc compilations will have picked up the .h files, and these
762 ## will be built directly as needed.
764 headers.stamp:
765 ## Note that we don't use a real dependency here, since we don't want
766 ## to rebuild all the headers here when the header list changes.  If
767 ## we did rebuild here, then any addition of a .java file would cause
768 ## a large number of recompilations.
769         $(MAKE) create-headers
770         @echo > headers.stamp
772 headers_to_make = $(nat_headers)
773 if XLIB_AWT
774 headers_to_make += $(xlib_nat_headers)
775 endif
777 create-headers: $(headers_to_make)
779 .PHONY: create-headers
781 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
782 $(libgij_la_OBJECTS): headers.stamp
784 ## ################################################################
787 ## This section is for make and multilib madness.
790 # Work around what appears to be a GNU make bug handling MAKEFLAGS
791 # values defined in terms of make variables, as is the case for CC and
792 # friends when we are called from the top level Makefile.
793 AM_MAKEFLAGS = \
794         "AR_FLAGS=$(AR_FLAGS)" \
795         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
796         "CFLAGS=$(CFLAGS)" \
797         "CXXFLAGS=$(CXXFLAGS)" \
798         "CPPFLAGS=$(CPPFLAGS)" \
799         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
800         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
801         "INSTALL=$(INSTALL)" \
802         "INSTALL_DATA=$(INSTALL_DATA)" \
803         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
804         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
805         "GCJFLAGS=$(GCJFLAGS)" \
806         "LDFLAGS=$(LDFLAGS)" \
807         "LIBCFLAGS=$(LIBCFLAGS)" \
808         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
809         "MAKE=$(MAKE)" \
810         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
811         "PICFLAG=$(PICFLAG)" \
812         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
813         "SHELL=$(SHELL)" \
814         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
815         "exec_prefix=$(exec_prefix)" \
816         "infodir=$(infodir)" \
817         "libdir=$(libdir)" \
818         "prefix=$(prefix)" \
819         "gxx_include_dir=$(gxx_include_dir)" \
820         "AR=$(AR)" \
821         "AS=$(AS)" \
822         "LD=$(LD)" \
823         "LIBCFLAGS=$(LIBCFLAGS)" \
824         "NM=$(NM)" \
825         "PICFLAG=$(PICFLAG)" \
826         "RANLIB=$(RANLIB)" \
827         "DESTDIR=$(DESTDIR)"
829 # Subdir rules rely on $(FLAGS_TO_PASS)
830 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
832 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
834 MAKEOVERRIDES=
836 # No install-html support yet.
837 .PHONY: install-html
838 install-html:
840 # Multilib support variables.
841 MULTISRCTOP =
842 MULTIBUILDTOP =
843 MULTIDIRS =
844 MULTISUBDIR =
845 MULTIDO = true
846 MULTICLEAN = true
848 # Multilib support.
849 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
850         maintainer-clean-multi
852 all-recursive: all-multi
853 install-recursive: install-multi
854 mostlyclean-recursive: mostlyclean-multi
855 clean-recursive: clean-multi
856 distclean-recursive: distclean-multi
857 maintainer-clean-recursive: maintainer-clean-multi
859 all-multi:
860         : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
861 install-multi:
862         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
863 mostlyclean-multi:
864         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
865 clean-multi:
866         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
867 distclean-multi:
868         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
869 maintainer-clean-multi:
870         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean