* m4/pr40134.m4: Added a configure switch for ARM linker problem.
[cacao.git] / src / cacao / Makefile.am
1 ## src/cacao/Makefile.am
2 ##
3 ## Copyright (C) 1996-2005, 2006, 2007, 2008
4 ## CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 ##
6 ## This file is part of CACAO.
7 ##
8 ## This program is free software; you can redistribute it and/or
9 ## modify it under the terms of the GNU General Public License as
10 ## published by the Free Software Foundation; either version 2, or (at
11 ## your option) any later version.
12 ##
13 ## This program is distributed in the hope that it will be useful, but
14 ## WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 ## General Public License for more details.
17 ##
18 ## You should have received a copy of the GNU General Public License
19 ## along with this program; if not, write to the Free Software
20 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 ## 02110-1301, USA.
22
23
24 AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR)
25
26 if ENABLE_STATICVM
27 cacao_LDFLAGS = \
28         -all-static
29 else
30 cacao_LDFLAGS =
31 endif
32
33 if ENABLE_LIBJVM
34 lib_LTLIBRARIES = \
35         libjvm.la
36
37 libjvm_la_LDFLAGS = \
38         -avoid-version
39
40 if WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
41 if WITH_GNU_LD
42 libjvm_la_LDFLAGS += \
43         -Xlinker --version-script=$(top_srcdir)/contrib/mapfile-vers-product
44 else
45 # This is for the Solaris LD.
46 libjvm_la_LDFLAGS += \
47         -Xlinker -M$(top_srcdir)/contrib/mapfile-vers-product
48 endif
49 endif
50
51 if GCC_PR40134
52 libjvm_la_LDFLAGS += -lgcc
53 endif
54
55 cacao_LDFLAGS += \
56         -export-dynamic
57
58 CACAO_LIBS =
59 else
60 noinst_LTLIBRARIES = \
61         libjvm.la
62
63 cacao_LDFLAGS += \
64         -export-dynamic
65
66 CACAO_LIBS = \
67         libjvm.la
68 endif
69
70 if ENABLE_RT_TIMING
71 cacao_LDFLAGS += -lrt
72 endif
73
74 if ENABLE_PYTHON
75 cacao_LDFLAGS += \
76     @PYTHON_LSPEC@
77 endif
78
79 libjvm_la_SOURCES =
80
81 # Dummy C++ source to cause C++ linking.
82 # http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries
83 nodist_EXTRA_libjvm_la_SOURCES = \
84         dummy.cxx
85
86 libjvm_la_LIBADD = \
87         $(top_builddir)/src/fdlibm/libfdlibm.la \
88         $(top_builddir)/src/mm/libmm.la \
89         $(top_builddir)/src/native/libnative.la \
90         $(top_builddir)/src/threads/libthreads.la \
91         $(top_builddir)/src/toolbox/libtoolbox.la \
92         $(top_builddir)/src/vm/libvm.la \
93         $(GC_LIB)
94
95 bin_PROGRAMS = \
96         cacao
97
98 cacao_SOURCES = \
99         cacao.cpp
100
101 cacao_LDADD = \
102         $(CACAO_LIBS)
103
104 cacao_DEPENDENCIES = \
105         $(cacao_LDADD)
106
107
108 if WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
109 install-data-local:
110         $(mkdir_p) $(prefix)/jre/lib/$(JAVA_ARCH)/server
111         $(LN_S) -f $(libdir)/libjvm.so $(prefix)/jre/lib/$(JAVA_ARCH)/server
112         $(ECHO) $(ECHO_N) > $(prefix)/jre/lib/$(JAVA_ARCH)/server/Xusage.txt
113         $(ECHO) $(ECHO_N) > $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjsig.so
114
115 uninstall-local:
116         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjvm.so
117         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/Xusage.txt
118         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjsig.so
119 endif
120
121
122 ## Local variables:
123 ## mode: Makefile
124 ## indent-tabs-mode: t
125 ## c-basic-offset: 4
126 ## tab-width: 8
127 ## compile-command: "automake --add-missing"
128 ## End: