]> git.ipfire.org Git - thirdparty/gcc.git/blame - libjava/Makefile.am
re PR target/30272 (Build failure under SGI Irix (GFortran))
[thirdparty/gcc.git] / libjava / Makefile.am
CommitLineData
ee9dd372
TT
1## Process this file with automake to produce Makefile.in.
2
e3f92d3b 3AUTOMAKE_OPTIONS = foreign subdir-objects
ee9dd372 4
029e5fc0 5ACLOCAL_AMFLAGS = -I . -I .. -I ../config
5aac1dac 6
e9bbd9d7
ZW
7# May be used by various substitution variables.
8gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
9
b0fa81ee 10SUBDIRS = $(DIRLTDL) gcj include classpath
feffe335
KC
11if TESTSUBDIR
12SUBDIRS += testsuite
ee9dd372
TT
13endif
14
0c7829a9
ME
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
22write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
23
ee9dd372
TT
24## ################################################################
25
ed2e3d33
NN
26# autoconf2.13's target_alias
27target_noncanonical = @target_noncanonical@
28
eec69c4e
TT
29# This is required by TL_AC_GXX_INCLUDE_DIR.
30libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
31
97b8365c
TT
32libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
33
ee9dd372
TT
34##
35## What gets installed, and where.
36##
37
27651ad3 38toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la
feffe335
KC
39toolexecmainlib_DATA = libgcj.spec
40
97c074fd
JJ
41if USE_LIBGCJ_BC
42toolexeclib_LTLIBRARIES += libgcj_bc.la
43endif
44
5950e016 45if XLIB_AWT
feffe335 46toolexeclib_LTLIBRARIES += lib-gnu-awt-xlib.la
2622c79d
RR
47endif
48
fb5b5d97
TF
49dbexec_LTLIBRARIES = libjvm.la
50
7fbbd122 51pkgconfigdir = $(libdir)/pkgconfig
7fbbd122 52
395cb211 53jardir = $(datadir)/java
27651ad3 54jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
97b8365c
TT
55if INSTALL_ECJ_JAR
56jar_DATA += $(ECJ_BUILD_JAR)
57endif
ee9dd372 58
c33b7bf0
TF
59if JAVA_HOME_SET
60JAVA_HOME_DIR = $(JAVA_HOME)
61BOOT_CLASS_PATH_DIR = $(JAVA_HOME)/lib/rt.jar
62else
63JAVA_HOME_DIR = $(prefix)
01ade80d 64BOOT_CLASS_PATH_DIR = $(jardir)/libgcj-$(gcc_version).jar
c33b7bf0
TF
65endif
66
558b8548
TT
67## Name of the default .db.
68db_name = classmap.db
206318ea 69## Compiler specific component of the .db file
35913fae 70db_pathtail = gcj-$(gcc_version)/$(db_name)
558b8548 71
f2646bf2 72## For now, only on native systems. FIXME.
ee9dd372 73if NATIVE
27651ad3 74bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool \
97b8365c
TT
75 gappletviewer gjarsigner gkeytool gjar gjavah gnative2ascii \
76 gorbd grmid gserialver gtnameserv
558b8548
TT
77
78## It is convenient to actually build and install the default database
79## when gcj-dbtool is available.
80dbexec_DATA = $(db_name)
ee9dd372
TT
81endif
82
6c80c45e
TT
83bin_SCRIPTS = addr2name.awk
84
97b8365c
TT
85if BUILD_ECJ1
86## We build ecjx and not ecj1 because in one mode, ecjx will not work
87## until after 'make install', and we don't want it to be picked up in
88## the build tree by gcj via a -B option.
89libexecsub_PROGRAMS = ecjx
90endif
91
ee9dd372
TT
92## ################################################################
93
94##
95## Compilers and compilation flags.
96##
97
02809848
PB
98if BASH_JAR
99bin_SCRIPTS += scripts/jar
100endif
ee9dd372 101
ee84a135
TT
102## The compiler with whatever flags we want for both -c and -C
103## compiles.
c94432c5 104GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
ee84a135 105
c0975bc7
AP
106extra_ldflags_libjava = @extra_ldflags_libjava@
107
108GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
109 $(LDFLAGS) -o $@
97b8365c
TT
110GCJ_FOR_ECJX = @GCJ_FOR_ECJX@
111GCJ_FOR_ECJX_LINK = $(GCJ_FOR_ECJX) -o $@
c0975bc7
AP
112LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) \
113 $(LDFLAGS) $(extra_ldflags_libjava) -o $@
a3ffcff3 114
52a11cbf 115GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
ee9dd372 116
a3c44036 117WARNINGS = -Wextra -Wall
baeff970
MK
118## Some systems don't allow `$' in identifiers by default, so we force
119## it with -fdollars-in-identifiers. -Wswitch-enum detects bugs in
120## the verifier implementation, and maybe other places. We need
121## _GNU_SOURCE defined for some Linux builds. It doesn't hurt to
122## always define it. Some systems, including Linux, need
123## -D_FILE_OFFSET_BITS=64 to enable > 2GB file support.
124AM_CXXFLAGS = \
125 -fno-rtti \
126 -fnon-call-exceptions \
127 $(THREADCXXFLAGS) \
cdd3612a 128 -fdollars-in-identifiers \
b446a5f1 129 -Wswitch-enum \
b845ed9f 130 -D_FILE_OFFSET_BITS=64 \
baeff970 131 @LIBGCJ_CXXFLAGS@ \
baeff970
MK
132 $(WARNINGS) \
133 -D_GNU_SOURCE \
134 -DPREFIX="\"$(prefix)\"" \
df3e8c70 135 -DTOOLEXECLIBDIR="\"$(toolexeclibdir)\"" \
c33b7bf0
TF
136 -DJAVA_HOME="\"$(JAVA_HOME_DIR)\"" \
137 -DBOOT_CLASS_PATH="\"$(BOOT_CLASS_PATH_DIR)\"" \
558b8548 138 -DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
dc0a6205 139 -DGCJ_ENDORSED_DIRS="\"$(jardir)/gcj-endorsed\"" \
fb5b5d97 140 -DGCJ_VERSIONED_LIBDIR="\"$(dbexecdir)\"" \
8c0633b7 141 -DPATH_SEPARATOR="\"$(CLASSPATH_SEPARATOR)\"" \
aa893047 142 -DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\"" \
5cfa6a4e 143 -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"$(db_pathtail)\""
e3f92d3b
MK
144
145AM_GCJFLAGS = \
ed89de94 146 @LIBGCJ_JAVAFLAGS@ \
9ecd0347 147 -fclasspath= -fbootclasspath=$(BOOTCLASSPATH) \
e3f92d3b 148 --encoding=UTF-8 \
cca1655e 149 -Wno-deprecated -fbootstrap-classes
e3f92d3b 150
3cf735f6 151AM_CFLAGS = @LIBGCJ_CFLAGS@
feffe335
KC
152if USING_GCC
153AM_CFLAGS += $(WARNINGS)
ee9dd372
TT
154endif
155
ae522139
MW
156## Extra CFLAGS used for JNI C sources shared with GNU Classpath.
157PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long
158
1f577886 159JCFLAGS = -g
3cf735f6 160JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
ee9dd372 161
c8fb9813 162LIBFFIINCS = @LIBFFIINCS@
58eb6e7c 163
b0fa81ee
TT
164AM_CPPFLAGS = -I$(top_srcdir) \
165 -Iinclude -I$(top_srcdir)/include \
166 -I$(top_srcdir)/classpath/include \
21276379 167 -Iclasspath/include \
b0fa81ee 168 -I$(top_srcdir)/classpath/native/fdlibm \
456d47b3 169 $(GCINCS) $(THREADINCS) $(INCLTDL) \
52a11cbf 170 $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
ee9dd372 171
97b8365c 172BOOTCLASSPATH = $(srcdir)/classpath/lib
9ecd0347 173
ee9dd372
TT
174## ################################################################
175
176##
f34ff6d6 177## How to build libgcj.a and libgcj.jar
ee9dd372
TT
178##
179
fedf5454 180libgij_la_SOURCES = gij.cc
e3f92d3b 181libgij_la_DEPENDENCIES = libgcj.la libgcj.spec
a2fcf673 182## See jv_convert_LDADD.
84c40293 183libgij_la_LIBADD = -L$(here)/.libs libgcj.la
a2fcf673
JJ
184## The mysterious backslash in the grep pattern is consumed by make.
185libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
186 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
fedf5454 187
94f473ee 188libgcj_la_SOURCES = prims.cc jni.cc jvmti.cc exception.cc stacktrace.cc \
36739040 189 link.cc defineclass.cc interpret.cc verify.cc \
b0fa81ee 190 $(nat_source_files)
72095b64
KC
191
192if USING_BOEHMGC
193libgcj_la_SOURCES += boehm.cc
194endif
195
196if USING_NOGC
197libgcj_la_SOURCES += nogc.cc
198endif
199
72095b64
KC
200if USING_POSIX_PLATFORM
201libgcj_la_SOURCES += posix.cc
202endif
203
204if USING_WIN32_PLATFORM
205libgcj_la_SOURCES += win32.cc
206endif
207
208if USING_DARWIN_CRT
209libgcj_la_SOURCES += darwin.cc
210endif
211
212if USING_POSIX_THREADS
213libgcj_la_SOURCES += posix-threads.cc
214endif
215
216if USING_WIN32_THREADS
217libgcj_la_SOURCES += win32-threads.cc
218endif
219
220if USING_NO_THREADS
221libgcj_la_SOURCES += no-threads.cc
222endif
bbbf4955 223
b08fd659
AH
224## Objects from C++ sources in subdirs.
225nat_files = $(nat_source_files:.cc=.lo)
226xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
227
2e9ab75d
BM
228# Include THREADLIBS here to ensure that the correct version of
229# certain linuxthread functions get linked:
ff78c80b 230## The mysterious backslash in the grep pattern is consumed by make.
5c009209
TT
231libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
232 $(LIBLTDL) $(SYS_ZLIBS) \
76b972d6
L
233 -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
234 $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
9ecd0347 235libgcj_la_LIBADD = \
b0fa81ee 236 classpath/native/fdlibm/libfdlibm.la \
97b8365c
TT
237 java/lang/Object.lo \
238 java/lang/Class.lo \
239 java/process-$(PLATFORM).lo \
b0fa81ee
TT
240 $(all_packages_source_files:.list=.lo) \
241 $(bc_objects) \
242 $(propertyo_files) \
97b8365c 243 $(LIBMAGIC) $(LIBFFI) $(ZLIBS) $(GCLIBS)
e9bbd9d7 244libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
97b8365c
TT
245 java/lang/Object.lo \
246 java/lang/Class.lo \
247 java/process-$(PLATFORM).lo \
b0fa81ee 248 $(all_packages_source_files:.list=.lo) \
5aa9bbc4 249 $(LIBLTDL) $(libgcj_la_LIBADD)
89b6698a
TT
250libgcj_la_LINK = $(LIBLINK)
251
97b8365c
TT
252## A hack to make sure the various gcj-related macros, like
253## LTGCJCOMPILE, are defined by automake. This is never actually
254## compiled.
255EXTRA_libgcj_la_SOURCES = java/lang/Object.java
256
257libgcj_tools_la_SOURCES = classpath/tools/tools.zip
258libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch -fno-indirect-classes -fsource-filename=$(here)/classpath/tools/all-classes.lst
27651ad3 259libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
76b972d6
L
260 -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
261 $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
56d30bd5 262libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
27651ad3
TF
263libgcj_tools_la_LINK = $(LIBLINK)
264
fb5b5d97
TF
265## libjvm.so
266libjvm_la_SOURCES = jni-libjvm.cc
267libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
268## See jv_convert_LDADD.
269libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
5fa432a2 270libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC)
558b8548
TT
271
272## The .db file. This rule is only used for native builds, so it is
273## safe to invoke gcj-dbtool.
cb8faadc 274$(db_name): gcj-dbtool$(EXEEXT)
558b8548
TT
275## In case it exists already.
276 @rm -f $(db_name)
277## We don't actually care if it fails -- if it does, just make an
278## empty file. This is simpler than trying to discover when mmap is
279## not available.
280 ./gcj-dbtool -n $(db_name) || touch $(db_name)
281
34bab46d 282lib_gnu_awt_xlib_la_SOURCES = $(xlib_nat_source_files)
9365047a
TT
283lib_gnu_awt_xlib_la_LIBADD = gnu/awt/xlib.lo gnu/gcj/xlib.lo
284lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-$(gcc_version).jar \
285 libgcj.la libgcj.spec \
34bab46d 286 $(lib_gnu_awt_xlib_la_LIBADD)
456d47b3
MK
287## We require libstdc++-v3 to be in the same build tree.
288lib_gnu_awt_xlib_la_CPPFLAGS = \
d933abbe 289 $(AM_CPPFLAGS) \
456d47b3
MK
290 -I../libstdc++-v3/include \
291 -I../libstdc++-v3/include/$(target_noncanonical) \
292 -I$(srcdir)/../libstdc++-v3/libsupc++
ff78c80b 293## The mysterious backslash in the grep pattern is consumed by make.
5f9cea34
TT
294lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
295 @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
f34ff6d6 296 -rpath $(toolexeclibdir) \
36739040 297 -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
072b0db2 298lib_gnu_awt_xlib_la_LINK = $(LIBLINK)
a697c5f7 299
97c074fd
JJ
300## Support for libgcj_bc: dummy shared library.
301##
302## This lets us have one soname in BC objects and another in C++ ABI objects.
303libgcj_bc_la_SOURCES = libgcj_bc.c
76b972d6
L
304libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
305 $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
97c074fd
JJ
306libgcj_bc_la_LIBADD = libgcj.la
307libgcj_bc_la_DEPENDENCIES = libgcj.la
308libgcj_bc_la_LINK = $(LIBLINK)
309## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.
310## USE_LIBGCJ_BC shouldn't be set on other targets.
311libgcj_bc_dummy_LINK = $(CC) -L$(here)/.libs $(CFLAGS) $(LDFLAGS) -shared \
312 -fPIC -nostdlib
313
314## This rule creates the libgcj_bc dummy library in the .libs directory, for use
315## when testing.
316libgcj_bc.la: $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_DEPENDENCIES)
317 $(libgcj_bc_la_LINK) $(am_libgcj_bc_la_rpath) $(libgcj_bc_la_LDFLAGS) \
318 $(libgcj_bc_la_OBJECTS) $(libgcj_bc_la_LIBADD) $(LIBS) || exit; \
319 rm .libs/libgcj_bc.so; \
320 mv .libs/libgcj_bc.so.1.0.0 .libs/libgcj_bc.so; \
321 $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
322 -o .libs/libgcj_bc.so.1.0.0 -lgcj || exit; \
323 rm .libs/libgcj_bc.so.1; \
324 $(LN_S) libgcj_bc.so.1.0.0 .libs/libgcj_bc.so.1
325
578fdcb2 326## Note that property_files is defined in sources.am.
e293cbd5 327propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
b0fa81ee 328
e293cbd5 329$(propertyo_files): %.lo: classpath/resource/%
b0fa81ee
TT
330 $(mkinstalldirs) `dirname $@`; \
331 $(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
332
f4410786 333libgcj-$(gcc_version).jar: classpath/lib/compile-classes
97b8365c
TT
334## Note that this now omits the property files.
335## It doesn't matter since we don't use the jar at runtime.
336 here=`pwd`; cd $(srcdir)/classpath/lib; $(JAR) -cfM \
337 $$here/libgcj-$(gcc_version).jar gnu java javax org sun
b0fa81ee 338
97b8365c 339libgcj-tools-$(gcc_version).jar: classpath/tools/tools.zip
27651ad3
TF
340 cp $< $@
341
342CLEANFILES = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
b0fa81ee 343DISTCLEANFILES = native.dirs
9096b279 344
2db99d05
ME
345mostlyclean-local:
346## Use libtool rm to remove each libtool object
347 find . -name '*.lo' -print | xargs $(LIBTOOL) rm -f
ee9dd372 348
2db99d05
ME
349distclean-local:
350## Remove every .d file that was created.
351 find . -name '*.d' -print | xargs rm -f
352
1acce4c7
JM
353# Just remove the objects from C++ sources, for testing the C++ compiler.
354clean-nat:
ff78c80b 355 rm -f $(nat_files) $(xlib_nat_files)
1acce4c7 356
b0fa81ee 357SUFFIXES = .class .java .h .properties .list
ee9dd372 358
c8dc36d6
TT
359## Pass the list of object files to libtool in a temporary file to
360## avoid tripping platform command line length limits.
072b0db2 361lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
0c7829a9
ME
362 @echo Creating list of files to link...
363 @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
072b0db2
TT
364 $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
365 -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
e4c34f6a 366
ee9dd372
TT
367## ################################################################
368
b0fa81ee
TT
369## Compiling a list of java sources to a single .o.
370
371%.lo: %.list
97b8365c
TT
372 $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(here)/classpath/lib/classes -MT $@ -MD -MP -MF $(basename $@).deps @$<
373
374java/lang/Object.lo: classpath/lib/java/lang/Object.class
375 $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(srcdir)/$(basename $@).java $<
376
377java/lang/Class.lo: classpath/lib/java/lang/Class.class
378 $(LTGCJCOMPILE) -c -o $@ -fsource-filename=$(srcdir)/$(basename $@).java $<
aa893047 379
b0fa81ee
TT
380## ################################################################
381
382## This pulls in a number of variable and target definitions.
383include sources.am
3078e929 384
aa893047
TT
385## ################################################################
386
ee9dd372
TT
387##
388## How to build header files.
389##
390
b0fa81ee
TT
391## We have special rules for certain headers.
392omitted_headers = java/lang/ClassLoader.h java/lang/Thread.h \
393 java/lang/String.h java/lang/reflect/Constructor.h \
394 java/lang/reflect/Field.h java/lang/reflect/Method.h \
395 java/lang/reflect/Proxy.h gnu/gcj/runtime/ExtensionClassLoader.h
396
97b8365c
TT
397generic_header_files = $(ordinary_header_files) $(xlib_nat_headers)
398
399MYGCJH = gjavah
400
401$(generic_header_files): gcjh.stamp
ee9dd372 402
97b8365c
TT
403gcjh.stamp: classpath/lib/compile-classes
404if JAVA_MAINTAINER_MODE
405 $(MYGCJH) --cni --all $(srcdir)/classpath/lib \
406 --cmdfile=$(srcdir)/headers.txt -d $(srcdir) --force
407endif
408 echo > gcjh.stamp
9dd668d2
BM
409
410inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
d3cc3f10 411 java/io/ObjectInputStream$$GetField.h \
7ef52736 412 java/nio/DirectByteBufferImpl$$ReadWrite.h \
1e2a4850
MK
413 java/nio/channels/Pipe$$SinkChannel.h \
414 java/nio/channels/Pipe$$SourceChannel.h \
d3cc3f10 415 java/lang/reflect/Proxy$$ProxyData.h \
9b7fe786
BM
416 java/lang/reflect/Proxy$$ProxyType.h \
417 gnu/java/net/PlainSocketImpl$$SocketInputStream.h \
1e2a4850
MK
418 gnu/java/net/PlainSocketImpl$$SocketOutputStream.h \
419 gnu/java/nio/PipeImpl$$SinkChannelImpl.h \
97b8365c 420 gnu/java/nio/PipeImpl$$SourceChannelImpl.h
ee9dd372 421
97b8365c 422nat_headers = $(ordinary_header_files) $(inner_nat_headers)
b0fa81ee 423nat_headers_install = $(ordinary_header_files)
9dd668d2 424
9365047a 425xlib_nat_headers = $(gnu_awt_xlib_header_files) $(gnu_gcj_xlib_header_files)
2622c79d 426
27e934d8
TT
427## Headers we maintain by hand and which we want to install.
428extra_headers = java/lang/Object.h java/lang/Class.h
429
17ba19fe 430$(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
7f7ba9bf
TT
431 @:
432
97b8365c 433install-exec-hook: install-toolexeclibLTLIBRARIES install-libexecsubPROGRAMS
97c074fd
JJ
434## Support for libgcj_bc: dummy shared library used only at link-time.
435if USE_LIBGCJ_BC
436## Install libgcj_bc dummy lib in the target directory. We also need to delete
437## libtool's .la file, this prevents libtool resetting the lib again
438## later.
97c074fd 439 @echo Installing dummy lib libgcj_bc.so.1.0.0; \
02b8fc06
MK
440 rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
441 mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
97c074fd 442 $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
02b8fc06
MK
443 -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \
444 rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
445 $(LN_S) libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \
446 rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.la;
97c074fd 447endif
97b8365c
TT
448if BUILD_ECJ1
449if NATIVE
52b213f3 450 mv $(DESTDIR)$(libexecsubdir)/`echo ecjx | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(libexecsubdir)/ecj1$(host_exeext)
97b8365c
TT
451else !NATIVE
452## Undo the prepending of the target prefix
52b213f3 453 mv $(DESTDIR)$(libexecsubdir)/$(target_noncanonical)-`echo ecjx | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` $(DESTDIR)$(libexecsubdir)/ecj1$(host_exeext)
97b8365c
TT
454endif !NATIVE
455endif BUILD_ECJ1
97c074fd 456
27e934d8
TT
457## Install the headers. It is fairly ugly that we have to do this by
458## hand.
459install-data-local:
460 $(PRE_INSTALL)
51d0a5cc
TT
461## Install the .pc file.
462 @pc_version=`echo $(GCJVERSION) | sed -e 's/[.][^.]*$$//'`; \
463 file="libgcj-$${pc_version}.pc"; \
d233eb7a 464 $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir); \
51d0a5cc
TT
465 echo " $(INSTALL_DATA) libgcj.pc $(DESTDIR)$(pkgconfigdir)/$$file"; \
466 $(INSTALL_DATA) libgcj.pc $(DESTDIR)$(pkgconfigdir)/$$file
ab847133
TT
467## We use a GNU make trick here so that we don't go over the command
468## length limit of some shells.
0c7829a9 469 @echo Creating list of headers to install...
579ed987 470 @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
ab847133 471 @cat tmp-ilist | while read f; do \
27e934d8 472 d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
dafb7f3f 473 $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
27e934d8 474 if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
dafb7f3f
RS
475 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
476 $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
27e934d8 477 done
ab847133 478 -@rm -f tmp-ilist
579ed987 479## Install inner class headers.
97b8365c
TT
480 $(INSTALL_DATA) $(srcdir)/'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
481 $(INSTALL_DATA) $(srcdir)/'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
482 $(INSTALL_DATA) $(srcdir)/'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
483 $(INSTALL_DATA) $(srcdir)/'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
484 $(INSTALL_DATA) $(srcdir)/'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
485 $(INSTALL_DATA) $(srcdir)/'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
486 $(INSTALL_DATA) $(srcdir)/'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
487 $(INSTALL_DATA) $(srcdir)/'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
488 $(INSTALL_DATA) $(srcdir)/'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
489 $(INSTALL_DATA) $(srcdir)/'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
7ef52736
MK
490## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
491
ee9dd372
TT
492
493## ################################################################
494
495##
496## Additional `check' targets for maintainer convenience.
497##
498
499## This is used for maintainer-check. FIXME: should set from
500## configure using AC_CHECK_TOOL.
501NM = nm
502
503## Try to make sure our library doesn't stomp the namespace.
a3ffcff3
TT
504maintainer-check: libgcj.la
505 $(NM) .libs/libgcj.a | grep ' T ' \
ee9dd372
TT
506## Anything with `4java' is assumed to be from .java source.
507 | grep -v '4java' \
508## Anything with Jv is ok.
509 | grep -v 'Jv' \
510## `terminate' and `unexpected' are part of the runtime.
511 | grep -v 'terminate__Fv' | grep -v 'unexpected__Fv'
512
513## This rule can be used to see if the headers are more or less
514## correct.
e9bbd9d7 515header-check: libgcj-$(gcc_version).jar $(nat_headers)
ee9dd372
TT
516 rm -f htest.cc; \
517 for h in $(nat_headers); do \
518 echo "#include \"$$h\"" >> htest.cc; \
519 done; \
520 $(CXXCOMPILE) -fsyntax-only htest.cc
521
3642e753
TT
522## This rule can be used to see if all the .class files verify
523## correctly.
e9bbd9d7 524class-check: libgcj-$(gcc_version).jar
3642e753
TT
525 @ok=0; find . -name '*.class' -print | fgrep -v testsuite | \
526 while read f; do \
527 echo "$(GCJ_WITH_FLAGS) --syntax-only $$f"; \
528 if $(GCJ_WITH_FLAGS) --syntax-only $$f; then \
529 :; else ok=1; fi; \
530 done; exit $$ok
ee9dd372 531
0c7829a9
ME
532## This rule checks whether write_entries_to_file works properly.
533write-entries-to-file-check:
534 @echo Creating list of files to link...
535 @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
536
ee9dd372
TT
537## ################################################################
538
539##
540## The `jv-convert' program and code to rebuild the converter header
541## files.
542##
543
544## it only makes sense to try to rebuild the JIS .h files on native
545## systems.
546if NATIVE
547if MAINTAINER_MODE
548noinst_PROGRAMS = gen-from-JIS
e3f92d3b
MK
549
550gen_from_JIS_SOURCES = \
551 gnu/gcj/convert/gen-from-JIS.c \
552 gnu/gcj/convert/make-trie.c
553
554gen_from_JIS_DEPENDENCIES = \
555 gnu/gcj/convert/JIS0201.h \
556 gnu/gcj/convert/JIS0208.h \
557 gnu/gcj/convert/JIS0212.h
558
559$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
560 ./gen-from-JIS JIS0208 >$(srcdir)/gnu/gcj/convert/JIS0208_to_Unicode.cc
561
562$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc: ./gen-from-JIS$(EXEEXT)
563 ./gen-from-JIS JIS0212 >$(srcdir)/gnu/gcj/convert/JIS0212_to_Unicode.cc
564
565$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc: ./gen-from-JIS$(EXEEXT)
566 ./gen-from-JIS toJIS >$(srcdir)/gnu/gcj/convert/Unicode_to_JIS.cc
567
568# The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
569# You can get it from
570# ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
571
572$(srcdir)/gnu/gcj/convert/JIS0201.h: # gnu/gcj/convert/JIS0201.TXT
573 echo '/* This file is automatically generated from Unicode tables */' > tmp-0201; \
574 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0201.TXT \
575 | sed -n -e 's|\(0x..\).*\(0x....\).*#\(.*\)$$|MAP(0x00, \1, \2) /*\3 */|p' \
576 >> tmp-0201; \
577 mv tmp-0201 $(srcdir)/gnu/gcj/convert/JIS0201.h
578
579# The Unicode consortium does not permit re-distributing the file JIS0208.TXT.
580# You can get it from
581# ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
582
583$(srcdir)/gnu/gcj/convert/JIS0208.h: # gnu/gcj/convert/JIS0208.TXT
584 echo '/* This file is automatically generated from Unicode tables */' > tmp-0208; \
585 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0208.TXT \
586 | sed -n -e 's|\(0x....\).*0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\2, 0x\3, \4) /*\5 */|p' \
587 >> tmp-0208; \
588 mv tmp-0208 $(srcdir)/gnu/gcj/convert/JIS0208.h
589
590# The Unicode consortium does not permit re-distributing the file JIS0212.TXT.
591# You can get it from
592# ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/
593
594$(srcdir)/gnu/gcj/convert/JIS0212.h: # gnu/gcj/convert/JIS0212.TXT
595 echo '/* This file is automatically generated from Unicode tables */' > tmp-0212; \
596 tr -d '\r' <$(srcdir)/gnu/gcj/convert/JIS0212.TXT \
597 | sed -n -e 's|0x\(..\)\(..\).*\(0x....\).*#\(.*\)$$|MAP(0x\1, 0x\2, \3) /*\4 */|p' \
598 >> tmp-0212; \
599 mv tmp-0212 $(srcdir)/gnu/gcj/convert/JIS0212.h
600
ee9dd372
TT
601endif
602endif
603
ee9dd372
TT
604
605jv_convert_SOURCES =
d5d9a8b6
TT
606## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
607## need this because we are explicitly using libtool to link using the
608## `.la' file.
f994389b 609jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
5c009209 610 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
327f2480 611jv_convert_LINK = $(GCJLINK)
eb9c4fdf
AO
612## We don't explicitly link in the libraries we need; libgcj.la brings
613## in all dependencies. We need the -L so that gcj can find libgcj
614## with `-lgcj', but it must come first, otherwise the -L flags
615## brought in from libgcj.la would cause the install directories to be
616## searched before the build-tree ones, and we'd get errors because of
617## different libraries with the same SONAME from picky linkers such as
618## Solaris'. FIXME: should be _libs on some systems.
619jv_convert_LDADD = -L$(here)/.libs libgcj.la
81d4a072
TT
620## Depend on the spec file to make sure it is up to date before
621## linking this program.
e3f92d3b 622jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
ee9dd372 623
b0fa81ee 624gcj_dbtool_SOURCES = \
b0fa81ee
TT
625gnu/gcj/tools/gcj_dbtool/natMain.cc
626
36739040
TT
627## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
628## need this because we are explicitly using libtool to link using the
629## `.la' file.
630gcj_dbtool_LDFLAGS = --main=gnu.gcj.tools.gcj_dbtool.Main \
631 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
632gcj_dbtool_LINK = $(GCJLINK)
633## We don't explicitly link in the libraries we need; libgcj.la brings
634## in all dependencies. We need the -L so that gcj can find libgcj
635## with `-lgcj', but it must come first, otherwise the -L flags
636## brought in from libgcj.la would cause the install directories to be
637## searched before the build-tree ones, and we'd get errors because of
638## different libraries with the same SONAME from picky linkers such as
639## Solaris'. FIXME: should be _libs on some systems.
97b8365c 640gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$(here)/.libs libgcj.la
36739040
TT
641## Depend on the spec file to make sure it is up to date before
642## linking this program.
97b8365c 643gcj_dbtool_DEPENDENCIES = gnu/gcj/tools/gcj_dbtool.lo libgcj.la libgcj.spec
36739040 644
e3f92d3b 645gij_SOURCES =
58eb6e7c
AG
646## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
647## need this because we are explicitly using libtool to link using the
648## `.la' file.
ade710a5
TF
649gij_LDFLAGS = -rpath $(libdir)/gcj-$(gcc_version) -rpath $(toolexeclibdir) \
650 -shared-libgcc $(THREADLDFLAGS)
327f2480 651gij_LINK = $(GCJLINK)
eb9c4fdf 652## See jv_convert_LDADD.
e3f92d3b 653gij_LDADD = -L$(here)/.libs libgij.la
58eb6e7c
AG
654## Depend on the spec file to make sure it is up to date before
655## linking this program.
e3f92d3b 656gij_DEPENDENCIES = libgij.la
58eb6e7c 657
97b8365c
TT
658## Build an ecjx from a .jar.
659ecjx_SOURCES =
660## We use the BC ABI here so that we don't need to compile ecj.jar.
661## Hopefully the user has compiled it into his system .db.
662## However, even if not it will run reasonably quickly.
83e7315b 663
97b8365c
TT
664ECJX_BASE_FLAGS = -findirect-dispatch \
665 --main=org.eclipse.jdt.internal.compiler.batch.GCCMain
666
667if NATIVE
668
669ecjx_LINK = $(GCJLINK)
670
671if ENABLE_SHARED
672## Use ecj.jar at runtime.
673ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) -Djava.class.path=$(ECJ_JAR)
674else !ENABLE_SHARED
675## Use ecj.jar at compile time.
125d9388 676ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) -fbootclasspath=$(BOOTCLASSPATH)
97b8365c
TT
677endif !ENABLE_SHARED
678
679ecjx_LDADD = -L$(here)/.libs libgcj.la
680ecjx_DEPENDENCIES = libgcj.la libgcj.spec
38fbab2a
L
681if USE_LIBGCJ_BC
682ecjx_DEPENDENCIES += libgcj_bc.la
683endif
97b8365c
TT
684
685else !NATIVE
686
687ecjx_LINK = $(GCJ_FOR_ECJX_LINK)
688ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR)
689ecjx_LDADD =
690ecjx_DEPENDENCIES =
691
692endif !NATIVE
83e7315b 693
27651ad3
TF
694## This is a dummy definition.
695gappletviewer_SOURCES =
696gappletviewer_LDFLAGS = --main=gnu.classpath.tools.appletviewer.Main \
697 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
698gappletviewer_LINK = $(GCJLINK)
699## See jv_convert_LDADD.
700gappletviewer_LDADD = -L$(here)/.libs libgcj-tools.la
27651ad3
TF
701gappletviewer_DEPENDENCIES = libgcj-tools.la
702
703## This is a dummy definition.
704gjarsigner_SOURCES =
705gjarsigner_LDFLAGS = --main=gnu.classpath.tools.jarsigner.Main \
706 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
707gjarsigner_LINK = $(GCJLINK)
708## See jv_convert_LDADD.
709gjarsigner_LDADD = -L$(here)/.libs libgcj-tools.la
27651ad3
TF
710gjarsigner_DEPENDENCIES = libgcj-tools.la
711
712## This is a dummy definition.
713gkeytool_SOURCES =
714gkeytool_LDFLAGS = --main=gnu.classpath.tools.keytool.Main \
715 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
716gkeytool_LINK = $(GCJLINK)
717## See jv_convert_LDADD.
718gkeytool_LDADD = -L$(here)/.libs libgcj-tools.la
27651ad3
TF
719gkeytool_DEPENDENCIES = libgcj-tools.la
720
97b8365c
TT
721## This is a dummy definition.
722gjar_SOURCES =
723gjar_LDFLAGS = --main=gnu.classpath.tools.jar.Main \
724 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
725gjar_LINK = $(GCJLINK)
726## See jv_convert_LDADD.
727gjar_LDADD = -L$(here)/.libs libgcj-tools.la
728gjar_DEPENDENCIES = libgcj-tools.la
729
730## This is a dummy definition.
731gjavah_SOURCES =
732gjavah_LDFLAGS = --main=gnu.classpath.tools.javah.Main \
733 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
734gjavah_LINK = $(GCJLINK)
735## See jv_convert_LDADD.
736gjavah_LDADD = -L$(here)/.libs libgcj-tools.la
737gjavah_DEPENDENCIES = libgcj-tools.la
738
739## This is a dummy definition.
740gnative2ascii_SOURCES =
741gnative2ascii_LDFLAGS = --main=gnu.classpath.tools.native2ascii.Native2ASCII \
742 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
743gnative2ascii_LINK = $(GCJLINK)
744## See jv_convert_LDADD.
745gnative2ascii_LDADD = -L$(here)/.libs libgcj-tools.la
746gnative2ascii_DEPENDENCIES = libgcj-tools.la
747
748## This is a dummy definition.
749gorbd_SOURCES =
750gorbd_LDFLAGS = --main=gnu.classpath.tools.orbd.Main \
751 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
752gorbd_LINK = $(GCJLINK)
753## See jv_convert_LDADD.
754gorbd_LDADD = -L$(here)/.libs libgcj-tools.la
755gorbd_DEPENDENCIES = libgcj-tools.la
756
757## This is a dummy definition.
758grmid_SOURCES =
759grmid_LDFLAGS = --main=gnu.classpath.tools.rmid.Main \
760 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
761grmid_LINK = $(GCJLINK)
762## See jv_convert_LDADD.
763grmid_LDADD = -L$(here)/.libs libgcj-tools.la
764grmid_DEPENDENCIES = libgcj-tools.la
765
766## This is a dummy definition.
767gserialver_SOURCES =
768gserialver_LDFLAGS = --main=gnu.classpath.tools.serialver.SerialVer \
769 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
770gserialver_LINK = $(GCJLINK)
771## See jv_convert_LDADD.
772gserialver_LDADD = -L$(here)/.libs libgcj-tools.la
773gserialver_DEPENDENCIES = libgcj-tools.la
774
775## This is a dummy definition.
776gtnameserv_SOURCES =
777gtnameserv_LDFLAGS = --main=gnu.classpath.tools.tnameserv.Main \
778 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
779gtnameserv_LINK = $(GCJLINK)
780## See jv_convert_LDADD.
781gtnameserv_LDADD = -L$(here)/.libs libgcj-tools.la
782gtnameserv_DEPENDENCIES = libgcj-tools.la
783
784## This is a dummy definition.
785grmic_SOURCES =
786grmic_LDFLAGS = --main=gnu.classpath.tools.rmic.Main \
787 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
788grmic_LINK = $(GCJLINK)
789## See jv_convert_LDADD.
790grmic_LDADD = -L$(here)/.libs libgcj-tools.la
791grmic_DEPENDENCIES = libgcj-tools.la
792
793## This is a dummy definition.
794grmiregistry_SOURCES =
795grmiregistry_LDFLAGS = --main=gnu.classpath.tools.rmiregistry.Main \
796 -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
797grmiregistry_LINK = $(GCJLINK)
798## See jv_convert_LDADD.
799grmiregistry_LDADD = -L$(here)/.libs libgcj-tools.la
800grmiregistry_DEPENDENCIES = libgcj-tools.la
801
ee9dd372
TT
802## ################################################################
803
ee9dd372 804## This lists all the C++ source files in subdirectories.
a0e894a8 805nat_source_files = \
27d8ff9b
KS
806gnu/classpath/jdwp/natVMFrame.cc \
807gnu/classpath/jdwp/natVMMethod.cc \
808gnu/classpath/jdwp/natVMVirtualMachine.cc \
97b8365c
TT
809gnu/classpath/natConfiguration.cc \
810gnu/classpath/natSystemProperties.cc \
811gnu/classpath/natVMStackWalker.cc \
a11e2c22 812gnu/gcj/natCore.cc \
ee9dd372 813gnu/gcj/convert/JIS0208_to_Unicode.cc \
a0e894a8
TT
814gnu/gcj/convert/JIS0212_to_Unicode.cc \
815gnu/gcj/convert/Unicode_to_JIS.cc \
946efde1 816gnu/gcj/convert/natIconv.cc \
a0e894a8
TT
817gnu/gcj/convert/natInput_EUCJIS.cc \
818gnu/gcj/convert/natInput_SJIS.cc \
819gnu/gcj/convert/natOutput_EUCJIS.cc \
820gnu/gcj/convert/natOutput_SJIS.cc \
6c80c45e
TT
821gnu/gcj/io/natSimpleSHSStream.cc \
822gnu/gcj/io/shs.cc \
67ce7492 823gnu/gcj/jvmti/natBreakpoint.cc \
eeedeb5a 824gnu/gcj/runtime/natFinalizerThread.cc \
8107bcf9 825gnu/gcj/runtime/natSharedLibLoader.cc \
b149e89e 826gnu/gcj/runtime/natSystemClassLoader.cc \
50cc5dd2 827gnu/gcj/runtime/natStringBuffer.cc \
36739040 828gnu/gcj/util/natDebug.cc \
74fa958e 829gnu/java/lang/natMainThread.cc \
97b8365c
TT
830gnu/java/lang/management/natVMClassLoadingMXBeanImpl.cc \
831gnu/java/lang/management/natVMCompilationMXBeanImpl.cc \
832gnu/java/lang/management/natVMGarbageCollectorMXBeanImpl.cc \
833gnu/java/lang/management/natVMMemoryMXBeanImpl.cc \
834gnu/java/lang/management/natVMMemoryManagerMXBeanImpl.cc \
835gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc \
836gnu/java/lang/management/natVMRuntimeMXBeanImpl.cc \
837gnu/java/lang/management/natVMThreadMXBeanImpl.cc \
4a503716
MK
838gnu/java/net/natPlainDatagramSocketImpl.cc \
839gnu/java/net/natPlainSocketImpl.cc \
85aa13b2 840gnu/java/net/protocol/core/natCoreInputStream.cc \
463c03f1
GB
841gnu/java/nio/natVMPipe.cc \
842gnu/java/nio/natVMSelector.cc \
51914674 843gnu/java/nio/natNIOServerSocket.cc \
97b8365c 844gnu/java/nio/natVMChannel.cc \
76c88fd9 845gnu/java/nio/channels/natFileChannelImpl.cc \
a0e894a8 846java/io/natFile.cc \
463c03f1 847java/io/natVMObjectInputStream.cc \
827452ae 848java/io/natVMObjectStreamClass.cc \
97b8365c 849java/lang/management/natVMManagementFactory.cc \
a0e894a8
TT
850java/lang/natCharacter.cc \
851java/lang/natClass.cc \
58eb6e7c 852java/lang/natClassLoader.cc \
42962a48 853java/lang/natConcreteProcess.cc \
463c03f1
GB
854java/lang/natVMDouble.cc \
855java/lang/natVMFloat.cc \
a0e894a8
TT
856java/lang/natMath.cc \
857java/lang/natObject.cc \
858java/lang/natRuntime.cc \
859java/lang/natString.cc \
ef0a7b49 860java/lang/natStringBuffer.cc \
0cb757cc 861java/lang/natStringBuilder.cc \
a0e894a8
TT
862java/lang/natSystem.cc \
863java/lang/natThread.cc \
97b8365c 864java/lang/natThreadLocal.cc \
b54a2715 865java/lang/natVMClassLoader.cc \
18744d9b 866java/lang/natVMThrowable.cc \
2b3d3db6 867java/lang/ref/natReference.cc \
a0e894a8 868java/lang/reflect/natArray.cc \
0f918fea 869java/lang/reflect/natConstructor.cc \
a0e894a8
TT
870java/lang/reflect/natField.cc \
871java/lang/reflect/natMethod.cc \
97b8365c 872java/lang/reflect/natVMProxy.cc \
adefdaca 873java/net/natVMInetAddress.cc \
97b8365c
TT
874java/net/natVMNetworkInterface.cc \
875java/net/natVMURLConnection.cc \
628cacef 876java/nio/channels/natVMChannels.cc \
8086b65d 877java/nio/natVMDirectByteBufferImpl.cc \
464fc7a1 878java/security/natVMAccessController.cc \
be6415be 879java/security/natVMAccessControlState.cc \
a0e894a8 880java/text/natCollator.cc \
ffe2e220 881java/util/natVMTimeZone.cc \
97b8365c 882java/util/concurrent/atomic/natAtomicLong.cc \
92c91cf7 883java/util/logging/natLogger.cc \
0ffac832 884java/util/zip/natDeflater.cc \
97b8365c
TT
885java/util/zip/natInflater.cc \
886sun/misc/natUnsafe.cc
ee9dd372 887
ff78c80b 888xlib_nat_source_files = \
2622c79d
RR
889gnu/gcj/xlib/natClip.cc \
890gnu/gcj/xlib/natColormap.cc \
891gnu/gcj/xlib/natDisplay.cc \
892gnu/gcj/xlib/natDrawable.cc \
893gnu/gcj/xlib/natFont.cc \
894gnu/gcj/xlib/natGC.cc \
895gnu/gcj/xlib/natPixmap.cc \
896gnu/gcj/xlib/natScreen.cc \
897gnu/gcj/xlib/natVisual.cc \
898gnu/gcj/xlib/natWMSizeHints.cc \
899gnu/gcj/xlib/natWindow.cc \
900gnu/gcj/xlib/natWindowAttributes.cc \
901gnu/gcj/xlib/natXAnyEvent.cc \
902gnu/gcj/xlib/natXButtonEvent.cc \
903gnu/gcj/xlib/natXColor.cc \
904gnu/gcj/xlib/natXConfigureEvent.cc \
905gnu/gcj/xlib/natXException.cc \
906gnu/gcj/xlib/natXExposeEvent.cc \
907gnu/gcj/xlib/natXImage.cc \
908gnu/gcj/xlib/natXUnmapEvent.cc
909
ee9dd372
TT
910## ################################################################
911
f0d87cda
TT
912##
913## Creating and installing sources.zip
914##
915
916## Create a zip holding all the sources. This can be meaningfully
917## used in Eclipse.
918src.zip:
919 -rm -f src.zip
920 here=`pwd`; \
510a8dd5
TF
921 ( \
922 ( cd $(srcdir)/classpath; \
97b8365c 923 find java gnu javax org sun -name '*.java' -print | \
f0d87cda
TT
924 while read file; do \
925## Ugly code to avoid "echo -C". Must separate each entry by a newline
926## Gross but easy.
927 echo "x-C" | sed -e 's/^.//'; \
510a8dd5 928 echo $(srcdir)/classpath; \
f0d87cda
TT
929 echo $$file; \
930 done ); \
97b8365c
TT
931 ( cd $(srcdir)/classpath/external/sax; \
932 find org -name '*.java' -print | \
933 while read file; do \
934 echo "x-C" | sed -e 's/^.//'; \
935 echo $(srcdir)/classpath/external/sax; \
936 echo $$file; \
937 done ); \
938 ( cd $(srcdir)/classpath/external/relaxngDatatype; \
939 find org -name '*.java' -print | \
940 while read file; do \
941 echo "x-C" | sed -e 's/^.//'; \
942 echo $(srcdir)/classpath/external/relaxngDatatype; \
943 echo $$file; \
944 done ); \
945 ( cd $(srcdir)/classpath/external/w3c_dom; \
946 find org -name '*.java' -print | \
947 while read file; do \
948 echo "x-C" | sed -e 's/^.//'; \
949 echo $(srcdir)/classpath/external/w3c_dom; \
950 echo $$file; \
951 done ); \
f0d87cda 952## Now the build tree.
510a8dd5
TF
953 ( cd classpath; \
954 find gnu java -name '*.java' -print | \
955 while read file; do \
956 echo "x-C" | sed -e 's/^.//'; \
957 echo `pwd`; \
958 echo $$file; \
959 done ); \
960 ) | \
76c6ea0c
TT
961## Many of the above circumlocutions were because ZIP used to be a
962## relative path to fastjar. It didn't seem worthwhile to change the
963## code when we moved to an external jar.
964 $(JAR) -cfM@ $$here/src.zip
510a8dd5
TF
965## Override GNU Classpath sources with libgcj replacements.
966 here=`pwd`; \
967 ( \
968 ( cd $(srcdir); \
969 find gnu java -name '*.java' -print | \
970 while read file; do \
971 echo "x-C" | sed -e 's/^.//'; \
972 echo $(srcdir); \
973 echo $$file; \
974 done ); \
975 ) | \
76c6ea0c 976 $(JAR) -ufM@ $$here/src.zip
f0d87cda
TT
977
978## We use a variable for this in case the user wants to override it.
979sourcesdir = $(jardir)
980
981install-src.zip: src.zip
e9bbd9d7 982 $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-$(gcc_version).zip
f0d87cda
TT
983
984
985## ################################################################
986
480222b5
TT
987##
988## Dependency tracking madness.
989##
990
480222b5 991## This is an evil hack to work around an automake limitation. We
b0fa81ee
TT
992## need to ensure that all CNI headers are built, not just the ones
993## used internally by libgcj. We can't make the .o files depend on
994## nat_headers, because in that case we'll force a complete rebuild of
995## the C++ code whenever any .java file is touched. So instead we
996## have a dummy rule which is only used once, namely the first time a
997## build is done. On subsequent builds, the dependency tracking for
998## the .cc compilations will have picked up the .h files, and these
999## will be built directly as needed.
1000
1001headers.stamp:
1002## Note that we don't use a real dependency here, since we don't want
1003## to rebuild all the headers here when the header list changes. If
1004## we did rebuild here, then any addition of a .java file would cause
1005## a large number of recompilations.
1006 $(MAKE) create-headers
1007 @echo > headers.stamp
1008
1009headers_to_make = $(nat_headers)
1010if XLIB_AWT
1011headers_to_make += $(xlib_nat_headers)
1012endif
1013
1014create-headers: $(headers_to_make)
1015
1016.PHONY: create-headers
1017
1018$(libgcj_la_OBJECTS) $(gcj_dbtool_OBJECTS) $(xlib_nat_files): headers.stamp
c69094e1 1019$(libgij_la_OBJECTS): headers.stamp
fb5b5d97 1020$(libjvm_la_OBJECTS): headers.stamp
480222b5
TT
1021
1022## ################################################################
1023
ee9dd372
TT
1024##
1025## This section is for make and multilib madness.
1026##
1027
1028# Work around what appears to be a GNU make bug handling MAKEFLAGS
1029# values defined in terms of make variables, as is the case for CC and
1030# friends when we are called from the top level Makefile.
1031AM_MAKEFLAGS = \
1032 "AR_FLAGS=$(AR_FLAGS)" \
1033 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
1034 "CFLAGS=$(CFLAGS)" \
1035 "CXXFLAGS=$(CXXFLAGS)" \
4a2e2916 1036 "CPPFLAGS=$(CPPFLAGS)" \
ee9dd372
TT
1037 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
1038 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
1039 "INSTALL=$(INSTALL)" \
1040 "INSTALL_DATA=$(INSTALL_DATA)" \
1041 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
1042 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
bbf65529 1043 "GCJFLAGS=$(GCJFLAGS)" \
ee9dd372
TT
1044 "LDFLAGS=$(LDFLAGS)" \
1045 "LIBCFLAGS=$(LIBCFLAGS)" \
1046 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
1047 "MAKE=$(MAKE)" \
1048 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
1049 "PICFLAG=$(PICFLAG)" \
1050 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
1051 "SHELL=$(SHELL)" \
6e6958dc 1052 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
ee9dd372
TT
1053 "exec_prefix=$(exec_prefix)" \
1054 "infodir=$(infodir)" \
1055 "libdir=$(libdir)" \
1056 "prefix=$(prefix)" \
dafb7f3f 1057 "gxx_include_dir=$(gxx_include_dir)" \
ee9dd372
TT
1058 "AR=$(AR)" \
1059 "AS=$(AS)" \
ee9dd372
TT
1060 "LD=$(LD)" \
1061 "LIBCFLAGS=$(LIBCFLAGS)" \
1062 "NM=$(NM)" \
1063 "PICFLAG=$(PICFLAG)" \
1064 "RANLIB=$(RANLIB)" \
97b8365c
TT
1065 "DESTDIR=$(DESTDIR)" \
1066 "JAR=$(JAR)"
ee9dd372 1067
bbf65529
AS
1068# Subdir rules rely on $(FLAGS_TO_PASS)
1069FLAGS_TO_PASS = $(AM_MAKEFLAGS)
1070
7f7ba9bf 1071CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
ee9dd372
TT
1072
1073MAKEOVERRIDES=
1074
af18ebae
CD
1075# No install-html support yet.
1076.PHONY: install-html
1077install-html:
1078
ee9dd372
TT
1079# Multilib support variables.
1080MULTISRCTOP =
1081MULTIBUILDTOP =
1082MULTIDIRS =
1083MULTISUBDIR =
1084MULTIDO = true
1085MULTICLEAN = true
1086
1087# Multilib support.
1088.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
1089 maintainer-clean-multi
1090
1091all-recursive: all-multi
1092install-recursive: install-multi
1093mostlyclean-recursive: mostlyclean-multi
1094clean-recursive: clean-multi
1095distclean-recursive: distclean-multi
1096maintainer-clean-recursive: maintainer-clean-multi
1097
1098all-multi:
6c5d742e 1099 : $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
ee9dd372
TT
1100install-multi:
1101 $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
1102mostlyclean-multi:
1103 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
1104clean-multi:
1105 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
1106distclean-multi:
1107 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
1108maintainer-clean-multi:
1109 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean