Merge from trunk @ 138209
[official-gcc.git] / libjava / Makefile.am
blobce6dbd201f7600c6eaa220c891d5e62a107e07c9
1 ## Process this file with automake to produce Makefile.in.
3 AUTOMAKE_OPTIONS = foreign subdir-objects
5 ACLOCAL_AMFLAGS = -I . -I .. -I ../config -I libltdl
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.  Entries are written in chunks of
17 # $(write_entries_to_file_split) to accomodate systems with
18 # severe command-line-length limitations.
19 # Parameters:
20 # $(1): variable containing entries to iterate over
21 # $(2): output file
22 write_entries_to_file_split = 50
23 write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
24         $(foreach range, \
25           $(shell i=1; while test $$i -le $(words $(1)); do \
26              echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
27           $(shell echo $(wordlist $(range), \
28                           $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1)) \
29              | tr ' ' '\n' >> $(2)))
31 ## ################################################################
33 # autoconf2.13's target_alias
34 target_noncanonical = @target_noncanonical@
36 # This is required by TL_AC_GXX_INCLUDE_DIR.
37 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
39 libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
42 ## What gets installed, and where.
45 toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la
46 toolexecmainlib_DATA = libgcj.spec
48 if USE_LIBGCJ_BC
49 toolexeclib_LTLIBRARIES += libgcj_bc.la
50 endif
52 if XLIB_AWT
53 toolexeclib_LTLIBRARIES += lib-gnu-awt-xlib.la
54 endif
56 dbexec_LTLIBRARIES = libjvm.la
58 pkgconfigdir = $(libdir)/pkgconfig
60 jardir = $(datadir)/java
61 jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
62 if INSTALL_ECJ_JAR
63 jar_DATA += $(ECJ_BUILD_JAR)
64 endif
66 if JAVA_HOME_SET
67 JAVA_HOME_DIR = $(JAVA_HOME)
68 BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
69 else
70 JAVA_HOME_DIR = $(prefix)
71 BOOT_CLASS_PATH_DIR = $(jardir)/libgcj-$(gcc_version).jar
72 endif
74 ## Name of the default .db.
75 db_name = classmap.db
76 ## Compiler specific component of the .db file
77 gcjsubdir = @gcjsubdir@
78 db_pathtail = $(gcjsubdir)/$(db_name)
80 ## For now, only on native systems.  FIXME.
81 if NATIVE
82 bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool \
83         gappletviewer gjarsigner gkeytool gjar gcjh gjavah gnative2ascii \
84         gorbd grmid gserialver gtnameserv gc-analyze
86 ## It is convenient to actually build and install the default database
87 ## when gcj-dbtool is available.
88 dbexec_DATA = $(db_name)
89 endif 
91 bin_SCRIPTS = addr2name.awk contrib/rebuild-gcj-db contrib/aot-compile
93 if INSTALL_AOT_RPM
94 bin_SCRIPTS += contrib/aot-compile-rpm
95 endif
97 if BUILD_ECJ1
98 ## We build ecjx and not ecj1 because in one mode, ecjx will not work
99 ## until after 'make install', and we don't want it to be picked up in
100 ## the build tree by gcj via a -B option.
101 libexecsub_PROGRAMS = ecjx
102 endif
104 ## ################################################################
107 ## Compilers and compilation flags.
110 ## The compiler with whatever flags we want for both -c and -C
111 ## compiles.
112 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
114 extra_ldflags_libjava = @extra_ldflags_libjava@
115 extra_ldflags = @extra_ldflags@
117 if ANONVERSCRIPT
118 extra_ldflags_libjava += -Wl,--version-script=$(srcdir)/libgcj.ver
119 endif
121 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
122           $(LDFLAGS) -o $@
123 GCJ_FOR_ECJX = @GCJ_FOR_ECJX@
124 GCJ_FOR_ECJX_LINK = $(GCJ_FOR_ECJX) -o $@
125 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
126           $(LDFLAGS) $(extra_ldflags_libjava) $(extra_ldflags) -o $@
128 GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
130 WARNINGS = -Wextra -Wall
131 ## Some systems don't allow `$' in identifiers by default, so we force
132 ## it with -fdollars-in-identifiers.  -Wswitch-enum detects bugs in
133 ## the verifier implementation, and maybe other places.  We need
134 ## _GNU_SOURCE defined for some Linux builds.  It doesn't hurt to
135 ## always define it.  Some systems, including Linux, need
136 ## -D_FILE_OFFSET_BITS=64 to enable > 2GB file support.
137 AM_CXXFLAGS = \
138         -fno-rtti \
139         -fnon-call-exceptions \
140         $(THREADCXXFLAGS) \
141         -fdollars-in-identifiers \
142         -Wswitch-enum \
143         -D_FILE_OFFSET_BITS=64 \
144         @LIBGCJ_CXXFLAGS@ \
145         $(WARNINGS) \
146         -D_GNU_SOURCE \
147         -DPREFIX="\"$(prefix)\"" \
148         -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\"" \
149         -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
150         -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
151         -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
152         -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
153         -DGCJ_VERSIONED_LIBDIR="\"$(dbexecdir)\"" \
154         -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
155         -DECJ_JAR_FILE="\"$(ECJ_JAR)\"" \
156         -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
157         -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\""
159 AM_GCJFLAGS = \
160         @LIBGCJ_JAVAFLAGS@ \
161         -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
162         --encoding=UTF-8 \
163         -Wno-deprecated -fbootstrap-classes
165 AM_CFLAGS = @LIBGCJ_CFLAGS@
166 if USING_GCC
167 AM_CFLAGS += $(WARNINGS)
168 endif
170 if SUPPRESS_LIBGCJ_BC
171 LIBGCJ_BC_FLAGS =
172 else
173 LIBGCJ_BC_FLAGS = -findirect-dispatch -fno-indirect-classes
174 endif
176 ## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
177 PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
179 JCFLAGS = -g
180 JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
182 LIBFFIINCS = @LIBFFIINCS@
184 AM_CPPFLAGS = -I$(top_srcdir) \
185         -Iinclude -I$(top_srcdir)/include \
186         -I$(top_srcdir)/classpath/include \
187         -Iclasspath/include \
188         -I$(top_srcdir)/classpath/native/fdlibm \
189         $(GCINCS) $(THREADINCS) $(INCLTDL) \
190         $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
192 BOOTCLASSPATH = $(srcdir)/classpath/lib
194 ## ################################################################
197 ## How to build libgcj.a and libgcj.jar
200 libgij_la_SOURCES = gij.cc
201 libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
202 ## See jv_convert_LDADD.
203 libgij_la_LIBADD = -L$(here)/.libs libgcj.la
204 ## The mysterious backslash in the grep pattern is consumed by make.
205 libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
206         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
208 if INTERPRETER
209 libgcj_interpret_source_files = jvmti.cc interpret.cc
210 else
211 libgcj_interpret_source_files = 
212 endif
214 libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
215         link.cc defineclass.cc verify.cc $(libgcj_interpret_source_files) \
216         $(nat_source_files)
218 ## We need to compile at least the interpreter this way.
219 interpret.lo:  AM_CXXFLAGS += -fwrapv
221 if USING_BOEHMGC
222 libgcj_la_SOURCES += boehm.cc
223 endif
225 if USING_NOGC
226 libgcj_la_SOURCES += nogc.cc
227 endif
229 if USING_POSIX_PLATFORM
230 libgcj_la_SOURCES += posix.cc
231 endif
233 if USING_WIN32_PLATFORM
234 libgcj_la_SOURCES += win32.cc
235 endif
237 if USING_DARWIN_CRT
238 libgcj_la_SOURCES += darwin.cc
239 endif
241 if USING_POSIX_THREADS
242 libgcj_la_SOURCES += posix-threads.cc
243 endif
245 if USING_WIN32_THREADS
246 libgcj_la_SOURCES += win32-threads.cc
247 endif
249 if USING_NO_THREADS
250 libgcj_la_SOURCES += no-threads.cc
251 endif
253 ## Objects from C++ sources in subdirs.
254 nat_files = $(nat_source_files:.cc=.lo)
255 xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
257 # Include THREADLIBS here to ensure that the correct version of
258 # certain linuxthread functions get linked:
259 ## The mysterious backslash in the grep pattern is consumed by make.
260 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
261         $(LIBLTDL) $(SYS_ZLIBS) \
262         -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
263         $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
264 libgcj_la_LIBADD = \
265         classpath/native/fdlibm/libfdlibm.la \
266         java/lang/Object.lo \
267         java/lang/Class.lo \
268         java/process-$(PLATFORM).lo \
269         $(all_packages_source_files:.list=.lo) \
270         $(bc_objects) \
271         $(propertyo_files) \
272         $(LIBFFI) $(ZLIBS) $(GCLIBS)
273 libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
274         java/lang/Object.lo \
275         java/lang/Class.lo \
276         java/process-$(PLATFORM).lo \
277         $(all_packages_source_files:.list=.lo) \
278         $(LIBLTDL) $(libgcj_la_LIBADD)
279 if ANONVERSCRIPT
280 libgcj_la_DEPENDENCIES += $(srcdir)/libgcj.ver
281 endif
282 libgcj_la_LINK = $(LIBLINK)
284 ## A hack to make sure the various gcj-related macros, like
285 ## LTGCJCOMPILE, are defined by automake.  This is never actually
286 ## compiled.
287 EXTRA_libgcj_la_SOURCES = java/lang/Object.java
289 libgcj_tools_la_SOURCES = classpath/tools/tools.zip
290 libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes  -fsource-filename=$(here)/classpath/tools/all-classes.lst
291 libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
292  -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
293  $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
294 libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
295 libgcj_tools_la_LINK = $(LIBLINK)
297 ## libjvm.so
298 libjvm_la_SOURCES = jni-libjvm.cc
299 libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
300 ## See jv_convert_LDADD.
301 libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
302 libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC)
304 ## The .db file.  This rule is only used for native builds, so it is
305 ## safe to invoke gcj-dbtool.
306 $(db_name): gcj-dbtool$(EXEEXT)
307 ## In case it exists already.
308         @rm -f $(db_name)
309 ## We don't actually care if it fails -- if it does, just make an
310 ## empty file.  This is simpler than trying to discover when mmap is
311 ## not available.
312         ./gcj-dbtool -n $(db_name) || touch $(db_name)
314 lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
315 lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
316 lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
317         libgcj.la libgcj.spec \
318         $(lib_gnu_awt_xlib_la_LIBADD)
319 ## We require libstdc++-v3 to be in the same build tree.
320 lib_gnu_awt_xlib_la_CPPFLAGS = \
321         $(AM_CPPFLAGS) \
322         -I../libstdc++-v3/include \
323         -I../libstdc++-v3/include/$(target_noncanonical) \
324         -I$(srcdir)/../libstdc++-v3/libsupc++
325 ## The mysterious backslash in the grep pattern is consumed by make.
326 lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
327         @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
328         -rpath $(toolexeclibdir) \
329         -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
330 lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
332 ## Support for libgcj_bc: dummy shared library.
334 ## This lets us have one soname in BC objects and another in C++ ABI objects.
335 libgcj_bc_la_SOURCES = libgcj_bc.c
336 libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
337         $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
338 libgcj_bc_la_LIBADD = libgcj.la
339 libgcj_bc_la_DEPENDENCIES = libgcj.la
340 libgcj_bc_la_LINK = $(LIBLINK)
341 ## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
342 ## USE_LIBGCJ_BC shouldn't be set on other targets.
343 libgcj_bc_dummy_LINK = $(CC) -L$(here)/.libs $(CFLAGS) $(LDFLAGS) -shared \
344         -fPIC -nostdlib
346 ## This rule creates the libgcj_bc dummy library in the .libs directory, for use
347 ## when testing.
348 libgcj_bc.la: $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_DEPENDENCIES)
349         $(libgcj_bc_la_LINK) $(am_libgcj_bc_la_rpath) $(libgcj_bc_la_LDFLAGS) \
350         $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS) || exit; \
351         rm .libs/libgcj_bc.so; \
352         mv .libs/libgcj_bc.so.1.0.0 .libs/libgcj_bc.so; \
353         $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
354         -o .libs/libgcj_bc.so.1.0.0 -lgcj || exit; \
355         rm .libs/libgcj_bc.so.1; \
356         $(LN_S) libgcj_bc.so.1.0.0 .libs/libgcj_bc.so.1
358 ## Note that property_files is defined in sources.am.
359 propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
361 $(propertyo_files): %.lo: classpath/resource/%
362         $(mkinstalldirs) `dirname $@`; \
363         $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
365 libgcj-$(gcc_version).jar: classpath/lib/compile-classes
366 ## Note that this now omits the property files.
367 ## It doesn't matter since we don't use the jar at runtime.
368         here=`pwd`; cd $(srcdir)/classpath/lib; \
369         find gnu java javax org sun -name .svn -prune -o -name '*.class' -print | \
370         $(JAR) -cfM@ $$here/libgcj-$(gcc_version).jar
372 libgcj-tools-$(gcc_version).jar: classpath/tools/tools.zip
373         cp $< $@
375 CLEANFILES = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
376 DISTCLEANFILES = native.dirs
378 mostlyclean-local:
379 ## Use libtool rm to remove each libtool object
380         find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f
382 distclean-local:
383 ## Remove every .d file that was created.
384         find . -name '*.d' -print | xargs rm -f
386 # Just remove the objects from C++ sources, for testing the C++ compiler.
387 clean-nat:
388         rm -f $(nat_files) $(xlib_nat_files)
390 SUFFIXES = .class .java .h .properties .list
392 ## Pass the list of object files to libtool in a temporary file to
393 ## avoid tripping platform command line length limits.
394 lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
395         @echo Creating list of files to link...
396         @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
397         $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
398         -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
400 ## ################################################################
402 ## Compiling a list of java sources to a single .o.
404 %.lo: %.list
405         $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(here)/classpath/lib/classes -MT $@ -MD -MP -MF $(basename $@).deps @$<
407 java/lang/Object.lo: classpath/lib/java/lang/Object.class
408         $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(srcdir)/$(basename $@).java $<
410 java/lang/Class.lo: classpath/lib/java/lang/Class.class
411         $(LTGCJCOMPILE) -c -o $@  -fsource-filename=$(srcdir)/$(basename $@).java $<
413 ## ################################################################
415 ## This pulls in a number of variable and target definitions.
416 include sources.am
418 ## ################################################################
421 ## How to build header files.
424 ## We have special rules for certain headers.
425 omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
426         java/lang/String.h java/lang/reflect/Constructor.h \
427         java/lang/reflect/Field.h java/lang/reflect/Method.h \
428         java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
430 inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
431         java/io/ObjectInputStream$$GetField.h \
432         java/nio/DirectByteBufferImpl$$ReadWrite.h \
433         java/nio/channels/Pipe$$SinkChannel.h \
434         java/nio/channels/Pipe$$SourceChannel.h \
435         java/lang/VMProcess$ImmediateEOFInputStream.h \
436         java/lang/reflect/Proxy$$ProxyData.h \
437         java/lang/reflect/Proxy$$ProxyType.h \
438         gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
439         gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
440         gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
441         gnu/java/nio/PipeImpl$$SourceChannelImpl.h
443 generic_header_files = $(ordinary_header_files) $(inner_nat_headers) \
444         $(xlib_nat_headers)
446 MYGCJH = gjavah
448 $(generic_header_files): gcjh.stamp
450 gcjh.stamp: classpath/lib/compile-classes
451 if JAVA_MAINTAINER_MODE
452         $(MYGCJH) --cni --all $(srcdir)/classpath/lib \
453             --cmdfile=$(srcdir)/headers.txt -d $(srcdir) --force
454 endif
455         echo > gcjh.stamp
457 nat_headers = $(ordinary_header_files) $(inner_nat_headers)
458 nat_headers_install = $(ordinary_header_files)
460 xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
462 ## Headers we maintain by hand and which we want to install.
463 extra_headers = java/lang/Object.h java/lang/Class.h
465 $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
466         @:
468 install-exec-hook: install-binPROGRAMS install-toolexeclibLTLIBRARIES \
469         install-libexecsubPROGRAMS
470 ## Support for libgcj_bc: dummy shared library used only at link-time.
471 if USE_LIBGCJ_BC
472 ## Install libgcj_bc dummy lib in the target directory. We also need to delete
473 ## libtool's .la file, this prevents libtool resetting the lib again 
474 ## later.
475         @echo Installing dummy lib libgcj_bc.so.1.0.0; \
476         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
477         mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
478         $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
479         -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \
480         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
481         $(LN_S) libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
482         rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.la;
483 endif
484 if BUILD_ECJ1
485 ## Undo any prepending of the target prefix and transform
486 ## to the actual host's executable suffix.
487         mv $(DESTDIR)$(libexecsubdir)/`echo ecjx | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(libexecsubdir)/ecj1$(host_exeext)
488 endif BUILD_ECJ1
490 ## Install the headers.  It is fairly ugly that we have to do this by
491 ## hand.
492 install_data_local_split = 50
493 install-data-local:
494         $(PRE_INSTALL)
495 ## Install the .pc file.
496         @pc_version=`echo $(GCJVERSION) | sed -e 's/[.][^.]*$$//'`; \
497         file="libgcj-$${pc_version}.pc"; \
498         $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir); \
499         echo "  $(INSTALL_DATA) libgcj.pc $(DESTDIR)$(pkgconfigdir)/$$file"; \
500         $(INSTALL_DATA) libgcj.pc $(DESTDIR)$(pkgconfigdir)/$$file
501 ## We use a GNU make trick here so that we don't go over the command
502 ## length limit of some shells.
503         @echo Creating list of headers to install...
504         @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
505         @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
506         while read file; do echo "$$file $$file"; done < tmp-ilist | \
507         sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
508         $(AWK) 'BEGIN { files["."] = "" } \
509           { files[$$2] = files[$$2] " " $$1; \
510             if (++n[$$2] == $(install_data_local_split)) { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
511              END { for (dir in files) print dir, files[dir] }' | \
512         while read dir files; do \
513           xfiles=; for file in $$files; do \
514             if test -f "$$file"; then xfiles="$$xfiles $$file"; \
515             else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
516           test -z "$$xfiles" || { \
517             test "x$$dir" = x. || { \
518               echo "$(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$dir"; \
519               $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$dir; }; \
520             echo " $(INSTALL_DATA) $$xfiles $(DESTDIR)$(gxx_include_dir)/$$dir"; \
521             $(INSTALL_DATA) $$xfiles $(DESTDIR)$(gxx_include_dir)/$$dir; }; \
522         done
523         -@rm -f tmp-ilist
524 ## Install inner class headers.
525         $(INSTALL_DATA) $(srcdir)/'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
526         $(INSTALL_DATA) $(srcdir)/'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
527         $(INSTALL_DATA) $(srcdir)/'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
528         $(INSTALL_DATA) $(srcdir)/'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
529         $(INSTALL_DATA) $(srcdir)/'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
530         $(INSTALL_DATA) $(srcdir)/'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
531         $(INSTALL_DATA) $(srcdir)/'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
532         $(INSTALL_DATA) $(srcdir)/'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
533         $(INSTALL_DATA) $(srcdir)/'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
534         $(INSTALL_DATA) $(srcdir)/'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
535 ## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
536 ## Install Python modules for aot-compile.
537         $(mkinstalldirs) $(DESTDIR)$(python_mod_dir); \
538         $(INSTALL_DATA) $(srcdir)/contrib/classfile.py \
539           $(DESTDIR)$(python_mod_dir)/classfile.py; \
540         $(INSTALL_DATA) contrib/aotcompile.py \
541           $(DESTDIR)$(python_mod_dir)/aotcompile.py;
542 if CREATE_JAVA_HOME
543 ## Create sdk style directories
544         $(mkinstalldirs) $(DESTDIR)$(JRE_BIN_DIR)
545         $(mkinstalldirs) $(DESTDIR)$(SDK_BIN_DIR)
546         $(mkinstalldirs) $(DESTDIR)$(JRE_LIB_DIR)
547         $(mkinstalldirs) $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)
548         $(mkinstalldirs) $(DESTDIR)$(SDK_INCLUDE_DIR)
549         $(mkinstalldirs) $(DESTDIR)$(SDK_INCLUDE_DIR)/$(OS)
550         relative() { \
551           $(PERL) -e 'use File::Spec; \
552             print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2; \
553         }; \
554         RELATIVE=$$(relative $(DESTDIR)$(bindir) $(DESTDIR)$(SDK_BIN_DIR)); \
555         ln -sf $$RELATIVE/`echo gij | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
556           $(DESTDIR)$(SDK_BIN_DIR)/java; \
557         ln -sf $$RELATIVE/`echo gjar | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
558           $(DESTDIR)$(SDK_BIN_DIR)/jar; \
559         ln -sf $$RELATIVE/`echo gjdoc | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
560           $(DESTDIR)$(SDK_BIN_DIR)/javadoc; \
561         ln -sf $$RELATIVE/`echo grmic | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
562           $(DESTDIR)$(SDK_BIN_DIR)/rmic; \
563         ln -sf $$RELATIVE/`echo gjavah | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
564           $(DESTDIR)$(SDK_BIN_DIR)/javah; \
565         ln -sf $$RELATIVE/ecj $(DESTDIR)$(SDK_BIN_DIR)/javac; \
566         ln -sf $$RELATIVE/`echo gappletviewer | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
567           $(DESTDIR)$(SDK_BIN_DIR)/appletviewer; \
568         ln -sf $$RELATIVE/`echo gjarsigner | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
569           $(DESTDIR)$(SDK_BIN_DIR)/jarsigner; \
570         ln -sf $$RELATIVE/`echo grmiregistry | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
571           $(DESTDIR)$(SDK_BIN_DIR)/rmiregistry; \
572         ln -sf $$RELATIVE/`echo gkeytool | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
573           $(DESTDIR)$(SDK_BIN_DIR)/keytool; \
574         ln -sf $$RELATIVE/`echo gorbd | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
575           $(DESTDIR)$(SDK_BIN_DIR)/orbd; \
576         ln -sf $$RELATIVE/`echo gnative2ascii | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
577           $(DESTDIR)$(SDK_BIN_DIR)/native2ascii; \
578         ln -sf $$RELATIVE/`echo grmid | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
579           $(DESTDIR)$(SDK_BIN_DIR)/rmid; \
580         ln -sf $$RELATIVE/`echo gtnameserv | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
581           $(DESTDIR)$(SDK_BIN_DIR)/tnameserv; \
582         ln -sf $$RELATIVE/`echo gserialver | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
583           $(DESTDIR)$(SDK_BIN_DIR)/serialver; \
584         RELATIVE=$$(relative $(DESTDIR)$(bindir) $(DESTDIR)$(JRE_BIN_DIR)); \
585         ln -sf $$RELATIVE/`echo grmiregistry | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
586           $(DESTDIR)$(JRE_BIN_DIR)/rmiregistry; \
587         ln -sf $$RELATIVE/`echo gkeytool | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
588           $(DESTDIR)$(JRE_BIN_DIR)/keytool; \
589         ln -sf $$RELATIVE/`echo gij | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
590           $(DESTDIR)$(JRE_BIN_DIR)/java; \
591         ln -sf $$RELATIVE/`echo gorbd | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
592           $(DESTDIR)$(JRE_BIN_DIR)/orbd; \
593         ln -sf $$RELATIVE/`echo grmid | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
594           $(DESTDIR)$(JRE_BIN_DIR)/rmid; \
595         ln -sf $$RELATIVE/`echo gtnameserv | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
596           $(DESTDIR)$(JRE_BIN_DIR)/tnameserv; \
597         $(mkinstalldirs) $(DESTDIR)$(JVM_JAR_DIR); \
598         version=$(JAVA_VERSION).$(BUILD_VERSION); \
599         working_dir=`pwd`; \
600         cd $(DESTDIR)$(JVM_JAR_DIR); \
601           for jarname in jaas jce jdbc-stdext jndi jndi-cos jndi-dns \
602             jndi-ldap jndi-rmi jsse sasl; \
603           do \
604             ln -s $$RELATIVE/$$jarname.jar $$jarname-$$version.jar; \
605           done; \
606           for jar in *-$$version.jar; \
607           do \
608             ln -sf $$jar $$(echo $$jar | sed "s|-$$version.jar|-$(JAVA_VERSION).jar|g"); \
609             ln -sf $$jar $$(echo $$jar | sed "s|-$$version.jar|.jar|g"); \
610           done; \
611         cd $$working_dir; \
612         $(mkinstalldirs) $(DESTDIR)$(JRE_LIB_DIR)/security; \
613         RELATIVE=$$(relative $(DESTDIR)$(libdir)/security \
614           $(DESTDIR)$(JRE_LIB_DIR)/security); \
615         cd $(DESTDIR)$(JRE_LIB_DIR)/security; \
616           ln -sf $$RELATIVE/classpath.security java.security; \
617         cd $$working_dir; \
618         $(mkinstalldirs) $(DESTDIR)$(SDK_INCLUDE_DIR)/linux; \
619         $(mkinstalldirs) $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)/client; \
620         $(mkinstalldirs) $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)/server; \
621         $(mkinstalldirs) $(DESTDIR)$(SDK_LIB_DIR); \
622         cd $(DESTDIR)$(JRE_LIB_DIR); \
623           for jarname in jaas jce jdbc-stdext jndi jndi-cos jndi-dns \
624             jndi-ldap jndi-rmi jsse sasl; \
625           do \
626             ln -s rt.jar $$jarname.jar; \
627           done; \
628         cd $$working_dir; \
629         RELATIVE=$$(relative $(DESTDIR)$(datarootdir)/java \
630           $(DESTDIR)$(JRE_LIB_DIR)); \
631         ln -sf $$RELATIVE/libgcj-$(gcc_version).jar \
632           $(DESTDIR)$(JRE_LIB_DIR)/rt.jar; \
633         RELATIVE=$$(relative $(DESTDIR)$(dbexecdir) \
634           $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)); \
635         ln -sf $$RELATIVE/libjawt.so \
636           $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)/libjawt.so; \
637         RELATIVE=$$(relative $(DESTDIR)$(dbexecdir) \
638           $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)/client); \
639         ln -sf $$RELATIVE/libjvm.so \
640           $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)/client/libjvm.so; \
641         RELATIVE=$$(relative $(DESTDIR)$(dbexecdir) \
642           $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)/server); \
643         ln -sf $$RELATIVE/libjvm.so \
644           $(DESTDIR)$(JRE_LIB_DIR)/$(CPU)/server/libjvm.so;     \
645         RELATIVE=$$(relative $(DESTDIR)$(datarootdir)/java \
646           $(DESTDIR)$(SDK_LIB_DIR)); \
647         ln -sf $$RELATIVE/libgcj-tools-$(gcc_version).jar \
648           $(DESTDIR)$(SDK_LIB_DIR)/tools.jar; \
649         for headername in jawt jni; do \
650           DIRECTORY=$$(dirname $$($(DESTDIR)$(bindir)/gcj \
651             -print-file-name=include/$$headername.h)); \
652           RELATIVE=$$(relative $(DESTDIR)$$DIRECTORY \
653             $(DESTDIR)$(SDK_INCLUDE_DIR)); \
654           ln -sf $$RELATIVE/$$headername.h \
655             $(DESTDIR)$(SDK_INCLUDE_DIR)/$$headername.h; \
656         done; \
657         for headername in jawt_md jni_md; do \
658           DIRECTORY=$$(dirname $$($(DESTDIR)$(bindir)/gcj \
659             -print-file-name=include/$$headername.h)); \
660           RELATIVE=$$(relative $(DESTDIR)$$DIRECTORY \
661             $(DESTDIR)$(SDK_INCLUDE_DIR)/linux); \
662           ln -sf $$RELATIVE/$$headername.h \
663             $(DESTDIR)$(SDK_INCLUDE_DIR)/linux/$$headername.h; \
664         done; \
665         RELATIVE=$$(relative $(DESTDIR)$(datarootdir)/java \
666           $(DESTDIR)$(JVM_ROOT_DIR)/$(SDK_DIR)); \
667         ln -sf $$RELATIVE/src-$(gcc_version).zip \
668           $(DESTDIR)$(JVM_ROOT_DIR)/$(SDK_DIR)/src.zip;
669 endif
671 ## ################################################################
674 ## Additional `check' targets for maintainer convenience.
677 ## This is used for maintainer-check.  FIXME: should set from
678 ## configure using AC_CHECK_TOOL.
679 NM = nm
681 ## Try to make sure our library doesn't stomp the namespace.
682 maintainer-check: libgcj.la
683         $(NM) .libs/libgcj.a | grep ' T ' \
684 ## Anything with `4java' is assumed to be from .java source.
685           | grep -v '4java' \
686 ## Anything with Jv is ok.
687           | grep -v 'Jv' \
688 ## `terminate' and `unexpected' are part of the runtime.
689           | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
691 ## This rule can be used to see if the headers are more or less
692 ## correct.
693 header-check: libgcj-$(gcc_version).jar $(nat_headers)
694         rm -f htest.cc; \
695         for h in $(nat_headers); do \
696           echo "#include \"$$h\"" >> htest.cc; \
697         done; \
698         $(CXXCOMPILE) -fsyntax-only htest.cc
700 ## This rule can be used to see if all the .class files verify
701 ## correctly.
702 class-check: libgcj-$(gcc_version).jar
703         @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
704         while read f; do \
705           echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
706           if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
707           :; else ok=1; fi; \
708         done; exit $$ok
710 ## This rule checks whether write_entries_to_file works properly.
711 write-entries-to-file-check:
712         @echo Creating list of files to link...
713         @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
715 ## ################################################################
718 ## The `jv-convert' program and code to rebuild the converter header
719 ## files.
722 ## it only makes sense to try to rebuild the JIS .h files on native
723 ## systems.
724 if NATIVE
725 if MAINTAINER_MODE
726 noinst_PROGRAMS = gen-from-JIS
728 gen_from_JIS_SOURCES = \
729         gnu/gcj/convert/gen-from-JIS.c \
730         gnu/gcj/convert/make-trie.c \
731         gnu/gcj/convert/make-trie.h
733 gen_from_JIS_DEPENDENCIES = \
734         gnu/gcj/convert/JIS0201.h \
735         gnu/gcj/convert/JIS0208.h \
736         gnu/gcj/convert/JIS0212.h
738 $(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
739          ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
741 $(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
742          ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
744 $(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
745          ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
747 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
748 # You can get it from
749 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
751 $(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
752         echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
753         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
754         | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2)  /*\3 */|p' \
755         >> tmp-0201; \
756         mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
758 # The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
759 # You can get it from
760 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
762 $(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
763         echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
764         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
765         | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4)  /*\5 */|p' \
766         >> tmp-0208; \
767         mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
769 # The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
770 # You can get it from
771 # ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
773 $(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
774         echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
775         tr  -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
776         | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3)  /*\4 */|p' \
777         >> tmp-0212; \
778         mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
780 endif
781 endif 
784 jv_convert_SOURCES =
785 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
786 ## need this because we are explicitly using libtool to link using the
787 ## `.la' file.
788 jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
789         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
790 jv_convert_LINK = $(GCJLINK)
791 ## We don't explicitly link in the libraries we need; libgcj.la brings
792 ## in all dependencies.  We need the -L so that gcj can find libgcj
793 ## with `-lgcj', but it must come first, otherwise the -L flags
794 ## brought in from libgcj.la would cause the install directories to be
795 ## searched before the build-tree ones, and we'd get errors because of
796 ## different libraries with the same SONAME from picky linkers such as
797 ## Solaris'.  FIXME: should be _libs on some systems.
798 jv_convert_LDADD = -L$(here)/.libs libgcj.la
799 ## Depend on the spec file to make sure it is up to date before
800 ## linking this program.
801 jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
803 gcj_dbtool_SOURCES = \
804 gnu/gcj/tools/gcj_dbtool/natMain.cc
806 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
807 ## need this because we are explicitly using libtool to link using the
808 ## `.la' file.
809 gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
810         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
811 gcj_dbtool_LINK = $(GCJLINK)
812 ## We don't explicitly link in the libraries we need; libgcj.la brings
813 ## in all dependencies.  We need the -L so that gcj can find libgcj
814 ## with `-lgcj', but it must come first, otherwise the -L flags
815 ## brought in from libgcj.la would cause the install directories to be
816 ## searched before the build-tree ones, and we'd get errors because of
817 ## different libraries with the same SONAME from picky linkers such as
818 ## Solaris'.  FIXME: should be _libs on some systems.
819 gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$(here)/.libs libgcj.la
820 ## Depend on the spec file to make sure it is up to date before
821 ## linking this program.
822 gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la libgcj.spec
824 gc_analyze_SOURCES =
826 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
827 ## need this because we are explicitly using libtool to link using the
828 ## `.la' file.
829 gc_analyze_LDFLAGS = --main=gnu.gcj.tools.gc_analyze.MemoryAnalyze \
830         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
831 gc_analyze_LINK = $(GCJLINK)
832 ## See jv_convert_LDADD.
833 gc_analyze_LDADD = -L$(here)/.libs libgcj-tools.la libgcj.la
834 ## Depend on the spec file to make sure it is up to date before
835 ## linking this program.
836 gc_analyze_DEPENDENCIES = libgcj-tools.la libgcj.la libgcj.spec
838 gij_SOURCES = 
839 ## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
840 ## need this because we are explicitly using libtool to link using the
841 ## `.la' file.
842 gij_LDFLAGS = -rpath $(dbexecdir) -rpath $(toolexeclibdir) \
843         -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags) \
844         $(extra_gij_ldflags) 
845 gij_LINK = $(GCJLINK)
846 ## See jv_convert_LDADD.
847 gij_LDADD = -L$(here)/.libs libgij.la
848 ## Depend on the spec file to make sure it is up to date before
849 ## linking this program.
850 gij_DEPENDENCIES = libgij.la
852 ## Build an ecjx from a .jar.
853 ecjx_SOURCES =
854 ## We use the BC ABI here so that we don't need to compile ecj.jar.
855 ## Hopefully the user has compiled it into his system .db.
856 ## However, even if not it will run reasonably quickly.
858 ECJX_BASE_FLAGS = -findirect-dispatch \
859         --main=org.eclipse.jdt.internal.compiler.batch.GCCMain
861 if NATIVE
863 ecjx_LINK = $(GCJLINK)
865 if ENABLE_SHARED
866 ## Use ecj.jar at runtime.
867 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR)
868 else !ENABLE_SHARED
869 ## Use ecj.jar at compile time.
870 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) -fbootclasspath=$(BOOTCLASSPATH)
871 endif !ENABLE_SHARED
873 ecjx_LDADD = -L$(here)/.libs libgcj.la
874 ecjx_DEPENDENCIES = libgcj.la libgcj.spec
875 if USE_LIBGCJ_BC
876 ecjx_DEPENDENCIES += libgcj_bc.la
877 endif
879 else !NATIVE
881 ecjx_LINK = $(GCJ_FOR_ECJX_LINK)
882 ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
883 ecjx_LDADD = 
884 ecjx_DEPENDENCIES = 
886 endif !NATIVE
888 ## This is a dummy definition.
889 gappletviewer_SOURCES =
890 gappletviewer_LDFLAGS = --main=gnu.classpath.tools.appletviewer.Main \
891         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
892 gappletviewer_LINK = $(GCJLINK)
893 ## See jv_convert_LDADD.
894 gappletviewer_LDADD = -L$(here)/.libs libgcj-tools.la
895 gappletviewer_DEPENDENCIES = libgcj-tools.la
897 ## This is a dummy definition.
898 gjarsigner_SOURCES =
899 gjarsigner_LDFLAGS = --main=gnu.classpath.tools.jarsigner.Main \
900         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
901 gjarsigner_LINK = $(GCJLINK)
902 ## See jv_convert_LDADD.
903 gjarsigner_LDADD = -L$(here)/.libs libgcj-tools.la
904 gjarsigner_DEPENDENCIES = libgcj-tools.la
906 ## This is a dummy definition.
907 gkeytool_SOURCES =
908 gkeytool_LDFLAGS = --main=gnu.classpath.tools.keytool.Main \
909         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
910 gkeytool_LINK = $(GCJLINK)
911 ## See jv_convert_LDADD.
912 gkeytool_LDADD = -L$(here)/.libs libgcj-tools.la
913 gkeytool_DEPENDENCIES = libgcj-tools.la
915 ## This is a dummy definition.
916 gjar_SOURCES =
917 gjar_LDFLAGS = --main=gnu.classpath.tools.jar.Main \
918         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
919 gjar_LINK = $(GCJLINK)
920 ## See jv_convert_LDADD.
921 gjar_LDADD = -L$(here)/.libs libgcj-tools.la
922 gjar_DEPENDENCIES = libgcj-tools.la
924 ## This is a dummy definition.
925 gjavah_SOURCES =
926 gjavah_LDFLAGS = --main=gnu.classpath.tools.javah.Main \
927         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
928 gjavah_LINK = $(GCJLINK)
929 ## See jv_convert_LDADD.
930 gjavah_LDADD = -L$(here)/.libs libgcj-tools.la
931 gjavah_DEPENDENCIES = libgcj-tools.la
933 ## This is a dummy definition.
934 gcjh_SOURCES =
935 gcjh_LDFLAGS = --main=gnu.classpath.tools.javah.GcjhMain \
936         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
937 gcjh_LINK = $(GCJLINK)
938 ## See jv_convert_LDADD.
939 gcjh_LDADD = -L$(here)/.libs libgcj-tools.la
940 gcjh_DEPENDENCIES = libgcj-tools.la
942 ## This is a dummy definition.
943 gnative2ascii_SOURCES =
944 gnative2ascii_LDFLAGS = --main=gnu.classpath.tools.native2ascii.Native2ASCII \
945         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
946 gnative2ascii_LINK = $(GCJLINK)
947 ## See jv_convert_LDADD.
948 gnative2ascii_LDADD = -L$(here)/.libs libgcj-tools.la
949 gnative2ascii_DEPENDENCIES = libgcj-tools.la
951 ## This is a dummy definition.
952 gorbd_SOURCES =
953 gorbd_LDFLAGS = --main=gnu.classpath.tools.orbd.Main \
954         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
955 gorbd_LINK = $(GCJLINK)
956 ## See jv_convert_LDADD.
957 gorbd_LDADD = -L$(here)/.libs libgcj-tools.la
958 gorbd_DEPENDENCIES = libgcj-tools.la
960 ## This is a dummy definition.
961 grmid_SOURCES =
962 grmid_LDFLAGS = --main=gnu.classpath.tools.rmid.Main \
963         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
964 grmid_LINK = $(GCJLINK)
965 ## See jv_convert_LDADD.
966 grmid_LDADD = -L$(here)/.libs libgcj-tools.la
967 grmid_DEPENDENCIES = libgcj-tools.la
969 ## This is a dummy definition.
970 gserialver_SOURCES =
971 gserialver_LDFLAGS = --main=gnu.classpath.tools.serialver.SerialVer \
972         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
973 gserialver_LINK = $(GCJLINK)
974 ## See jv_convert_LDADD.
975 gserialver_LDADD = -L$(here)/.libs libgcj-tools.la
976 gserialver_DEPENDENCIES = libgcj-tools.la
978 ## This is a dummy definition.
979 gtnameserv_SOURCES =
980 gtnameserv_LDFLAGS = --main=gnu.classpath.tools.tnameserv.Main \
981         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
982 gtnameserv_LINK = $(GCJLINK)
983 ## See jv_convert_LDADD.
984 gtnameserv_LDADD = -L$(here)/.libs libgcj-tools.la
985 gtnameserv_DEPENDENCIES = libgcj-tools.la
987 ## This is a dummy definition.
988 grmic_SOURCES =
989 grmic_LDFLAGS = --main=gnu.classpath.tools.rmic.Main \
990         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
991 grmic_LINK = $(GCJLINK)
992 ## See jv_convert_LDADD.
993 grmic_LDADD = -L$(here)/.libs libgcj-tools.la
994 grmic_DEPENDENCIES = libgcj-tools.la
996 ## This is a dummy definition.
997 grmiregistry_SOURCES =
998 grmiregistry_LDFLAGS = --main=gnu.classpath.tools.rmiregistry.Main \
999         -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS) $(extra_ldflags)
1000 grmiregistry_LINK = $(GCJLINK)
1001 ## See jv_convert_LDADD.
1002 grmiregistry_LDADD = -L$(here)/.libs libgcj-tools.la
1003 grmiregistry_DEPENDENCIES = libgcj-tools.la
1005 ## ################################################################
1006 if INTERPRETER
1007 nat_jdwp_source_files = \
1008 gnu/classpath/jdwp/natVMFrame.cc \
1009 gnu/classpath/jdwp/natVMMethod.cc \
1010 gnu/classpath/jdwp/natVMVirtualMachine.cc
1012 nat_jvmti_source_files = \
1013 gnu/gcj/jvmti/natBreakpoint.cc \
1014 gnu/gcj/jvmti/natNormalBreakpoint.cc
1015 else
1016 nat_jdwp_source_files = 
1017 nat_jvmti_source_files =
1018 endif
1019 ## This lists all the C++ source files in subdirectories.
1020 nat_source_files = \
1021 $(nat_jdwp_source_files) \
1022 gnu/classpath/natConfiguration.cc \
1023 gnu/classpath/natSystemProperties.cc \
1024 gnu/classpath/natVMStackWalker.cc \
1025 gnu/gcj/natCore.cc \
1026 gnu/gcj/convert/JIS0208_to_Unicode.cc \
1027 gnu/gcj/convert/JIS0212_to_Unicode.cc \
1028 gnu/gcj/convert/Unicode_to_JIS.cc \
1029 gnu/gcj/convert/natIconv.cc \
1030 gnu/gcj/convert/natInput_EUCJIS.cc \
1031 gnu/gcj/convert/natInput_SJIS.cc \
1032 gnu/gcj/convert/natOutput_EUCJIS.cc \
1033 gnu/gcj/convert/natOutput_SJIS.cc \
1034 gnu/gcj/io/natSimpleSHSStream.cc \
1035 gnu/gcj/io/shs.cc \
1036 $(nat_jvmti_source_files) \
1037 gnu/gcj/runtime/natFinalizerThread.cc \
1038 gnu/gcj/runtime/natSharedLibLoader.cc \
1039 gnu/gcj/runtime/natSystemClassLoader.cc \
1040 gnu/gcj/runtime/natStringBuffer.cc \
1041 gnu/gcj/util/natDebug.cc \
1042 gnu/gcj/util/natGCInfo.cc \
1043 gnu/java/lang/natMainThread.cc \
1044 gnu/java/lang/management/natVMClassLoadingMXBeanImpl.cc \
1045 gnu/java/lang/management/natVMCompilationMXBeanImpl.cc \
1046 gnu/java/lang/management/natVMGarbageCollectorMXBeanImpl.cc \
1047 gnu/java/lang/management/natVMMemoryMXBeanImpl.cc \
1048 gnu/java/lang/management/natVMMemoryManagerMXBeanImpl.cc \
1049 gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc \
1050 gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.cc \
1051 gnu/java/lang/management/natVMRuntimeMXBeanImpl.cc \
1052 gnu/java/lang/management/natVMThreadMXBeanImpl.cc \
1053 gnu/java/net/natPlainDatagramSocketImpl.cc \
1054 gnu/java/net/natPlainSocketImpl.cc \
1055 gnu/java/net/protocol/core/natCoreInputStream.cc \
1056 gnu/java/nio/natVMPipe.cc \
1057 gnu/java/nio/natVMSelector.cc \
1058 gnu/java/nio/natNIOServerSocket.cc \
1059 gnu/java/nio/natVMChannel.cc \
1060 gnu/java/nio/channels/natFileChannelImpl.cc \
1061 java/io/natFile.cc \
1062 java/io/natVMObjectInputStream.cc \
1063 java/io/natVMObjectStreamClass.cc \
1064 java/lang/natCharacter.cc \
1065 java/lang/natClass.cc \
1066 java/lang/natClassLoader.cc \
1067 java/lang/natConcreteProcess.cc \
1068 java/lang/natVMDouble.cc \
1069 java/lang/natVMFloat.cc \
1070 java/lang/natMath.cc \
1071 java/lang/natObject.cc \
1072 java/lang/natRuntime.cc \
1073 java/lang/natString.cc \
1074 java/lang/natStringBuffer.cc \
1075 java/lang/natStringBuilder.cc \
1076 java/lang/natSystem.cc \
1077 java/lang/natThread.cc \
1078 java/lang/natThreadLocal.cc \
1079 java/lang/natVMClassLoader.cc \
1080 java/lang/natVMProcess.cc \
1081 java/lang/natVMThrowable.cc \
1082 java/lang/ref/natReference.cc \
1083 java/lang/reflect/natArray.cc \
1084 java/lang/reflect/natConstructor.cc \
1085 java/lang/reflect/natField.cc \
1086 java/lang/reflect/natMethod.cc \
1087 java/lang/reflect/natVMProxy.cc \
1088 java/net/natVMInetAddress.cc \
1089 java/net/natVMNetworkInterface.cc \
1090 java/net/natVMURLConnection.cc \
1091 java/nio/channels/natVMChannels.cc \
1092 java/nio/natVMDirectByteBufferImpl.cc \
1093 java/security/natVMAccessController.cc \
1094 java/security/natVMAccessControlState.cc \
1095 java/text/natCollator.cc \
1096 java/util/natVMTimeZone.cc \
1097 java/util/concurrent/atomic/natAtomicLong.cc \
1098 java/util/logging/natLogger.cc \
1099 java/util/zip/natDeflater.cc \
1100 java/util/zip/natInflater.cc \
1101 sun/misc/natUnsafe.cc
1103 xlib_nat_source_files = \
1104 gnu/gcj/xlib/natClip.cc \
1105 gnu/gcj/xlib/natColormap.cc \
1106 gnu/gcj/xlib/natDisplay.cc \
1107 gnu/gcj/xlib/natDrawable.cc \
1108 gnu/gcj/xlib/natFont.cc \
1109 gnu/gcj/xlib/natGC.cc \
1110 gnu/gcj/xlib/natPixmap.cc \
1111 gnu/gcj/xlib/natScreen.cc \
1112 gnu/gcj/xlib/natVisual.cc \
1113 gnu/gcj/xlib/natWMSizeHints.cc \
1114 gnu/gcj/xlib/natWindow.cc \
1115 gnu/gcj/xlib/natWindowAttributes.cc \
1116 gnu/gcj/xlib/natXAnyEvent.cc \
1117 gnu/gcj/xlib/natXButtonEvent.cc \
1118 gnu/gcj/xlib/natXColor.cc \
1119 gnu/gcj/xlib/natXConfigureEvent.cc \
1120 gnu/gcj/xlib/natXException.cc \
1121 gnu/gcj/xlib/natXExposeEvent.cc \
1122 gnu/gcj/xlib/natXImage.cc \
1123 gnu/gcj/xlib/natXUnmapEvent.cc
1125 ## ################################################################
1128 ## Creating and installing sources.zip
1131 ## Create a zip holding all the sources.  This can be meaningfully
1132 ## used in Eclipse.
1133 src.zip:
1134         -rm -f src.zip
1135         here=`pwd`; \
1136         ( \
1137           ( cd $(srcdir)/classpath; \
1138           find java gnu javax org sun -name '*.java' -print | \
1139           while read file; do \
1140 ## Ugly code to avoid "echo -C".  Must separate each entry by a newline
1141 ## Gross but easy.
1142             echo "x-C" | sed -e 's/^.//'; \
1143             echo $(srcdir)/classpath; \
1144             echo $$file; \
1145           done ); \
1146           ( cd $(srcdir)/classpath/external/sax; \
1147           find org -name '*.java' -print | \
1148           while read file; do \
1149             echo "x-C" | sed -e 's/^.//'; \
1150             echo $(srcdir)/classpath/external/sax; \
1151             echo $$file; \
1152           done ); \
1153           ( cd $(srcdir)/classpath/external/relaxngDatatype; \
1154           find org -name '*.java' -print | \
1155           while read file; do \
1156             echo "x-C" | sed -e 's/^.//'; \
1157             echo $(srcdir)/classpath/external/relaxngDatatype; \
1158             echo $$file; \
1159           done ); \
1160           ( cd $(srcdir)/classpath/external/w3c_dom; \
1161           find org -name '*.java' -print | \
1162           while read file; do \
1163             echo "x-C" | sed -e 's/^.//'; \
1164             echo $(srcdir)/classpath/external/w3c_dom; \
1165             echo $$file; \
1166           done ); \
1167 ## Now the build tree.
1168           ( cd classpath; \
1169             find gnu java -name '*.java' -print | \
1170             while read file; do \
1171             echo "x-C" | sed -e 's/^.//'; \
1172             echo `pwd`; \
1173             echo $$file; \
1174           done ); \
1175         ) | \
1176 ## Many of the above circumlocutions were because ZIP used to be a
1177 ## relative path to fastjar.  It didn't seem worthwhile to change the
1178 ## code when we moved to an external jar.
1179         $(JAR) -cfM@ $$here/src.zip
1180 ## Override GNU Classpath sources with libgcj replacements.
1181         here=`pwd`; \
1182         ( \
1183           ( cd $(srcdir); \
1184           find gnu java -name '*.java' -print | \
1185           while read file; do \
1186             echo "x-C" | sed -e 's/^.//'; \
1187             echo $(srcdir); \
1188             echo $$file; \
1189           done ); \
1190         ) | \
1191         $(JAR) -ufM@ $$here/src.zip
1193 ## We use a variable for this in case the user wants to override it.
1194 sourcesdir = $(jardir)
1196 install-src.zip: src.zip
1197         $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
1200 ## ################################################################
1203 ## Dependency tracking madness.
1206 ## This is an evil hack to work around an automake limitation.  We
1207 ## need to ensure that all CNI headers are built, not just the ones
1208 ## used internally by libgcj. We can't make the .o files depend on
1209 ## nat_headers, because in that case we'll force a complete rebuild of
1210 ## the C++ code whenever any .java file is touched.  So instead we
1211 ## have a dummy rule which is only used once, namely the first time a
1212 ## build is done.  On subsequent builds, the dependency tracking for
1213 ## the .cc compilations will have picked up the .h files, and these
1214 ## will be built directly as needed.
1216 headers.stamp:
1217 ## Note that we don't use a real dependency here, since we don't want
1218 ## to rebuild all the headers here when the header list changes.  If
1219 ## we did rebuild here, then any addition of a .java file would cause
1220 ## a large number of recompilations.
1221         $(MAKE) create-headers
1222         @echo > headers.stamp
1224 headers_to_make = $(nat_headers)
1225 if XLIB_AWT
1226 headers_to_make += $(xlib_nat_headers)
1227 endif
1229 create-headers: $(headers_to_make)
1231 .PHONY: create-headers
1233 $(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
1234 $(libgij_la_OBJECTS): headers.stamp
1235 $(libjvm_la_OBJECTS): headers.stamp
1237 ## ################################################################
1240 ## This section is for make and multilib madness.
1243 # Work around what appears to be a GNU make bug handling MAKEFLAGS
1244 # values defined in terms of make variables, as is the case for CC and
1245 # friends when we are called from the top level Makefile.
1246 AM_MAKEFLAGS = \
1247         "AR_FLAGS=$(AR_FLAGS)" \
1248         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
1249         "CFLAGS=$(CFLAGS)" \
1250         "CXXFLAGS=$(CXXFLAGS)" \
1251         "CPPFLAGS=$(CPPFLAGS)" \
1252         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
1253         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
1254         "INSTALL=$(INSTALL)" \
1255         "INSTALL_DATA=$(INSTALL_DATA)" \
1256         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
1257         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
1258         "GCJFLAGS=$(GCJFLAGS)" \
1259         "LDFLAGS=$(LDFLAGS)" \
1260         "LIBCFLAGS=$(LIBCFLAGS)" \
1261         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
1262         "MAKE=$(MAKE)" \
1263         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
1264         "PICFLAG=$(PICFLAG)" \
1265         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
1266         "SHELL=$(SHELL)" \
1267         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
1268         "exec_prefix=$(exec_prefix)" \
1269         "infodir=$(infodir)" \
1270         "libdir=$(libdir)" \
1271         "mandir=$(mandir)" \
1272         "prefix=$(prefix)" \
1273         "gxx_include_dir=$(gxx_include_dir)" \
1274         "AR=$(AR)" \
1275         "AS=$(AS)" \
1276         "LD=$(LD)" \
1277         "LIBCFLAGS=$(LIBCFLAGS)" \
1278         "NM=$(NM)" \
1279         "PICFLAG=$(PICFLAG)" \
1280         "RANLIB=$(RANLIB)" \
1281         "DESTDIR=$(DESTDIR)" \
1282         "JAR=$(JAR)"
1284 # Subdir rules rely on $(FLAGS_TO_PASS)
1285 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
1287 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
1289 MAKEOVERRIDES=
1291 # No install-html or install-pdf support in automake yet
1292 .PHONY: install-html install-pdf
1293 install-html:
1294 install-pdf:
1296 # Multilib support variables.
1297 MULTISRCTOP =
1298 MULTIBUILDTOP =
1299 MULTIDIRS =
1300 MULTISUBDIR =
1301 MULTIDO = true
1302 MULTICLEAN = true
1304 # Multilib support.
1305 .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
1306         maintainer-clean-multi
1308 all-recursive: all-multi
1309 install-recursive: install-multi
1310 mostlyclean-recursive: mostlyclean-multi
1311 clean-recursive: clean-multi
1312 distclean-recursive: distclean-multi
1313 maintainer-clean-recursive: maintainer-clean-multi
1315 all-multi:
1316         : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
1317 install-multi:
1318         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
1319 mostlyclean-multi:
1320         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
1321 clean-multi:
1322         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
1323 distclean-multi:
1324         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
1325 maintainer-clean-multi:
1326         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean