source: trunk/openjdk/jdk/make/sun/awt/mawt.gmk

Last change on this file was 278, checked in by dmik, 14 years ago

trunk: Merged in openjdk6 b22 from branches/vendor/oracle.

File size: 7.2 KB
Line 
1#
2# Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26#
27# to create directory:
28#
29INIT += $(LIB_LOCATION)
30
31ifndef HEADLESS
32ifeq ($(PLATFORM), linux)
33ifeq ($(STATIC_MOTIF),false)
34INIT += $(LIB_LOCATION)/libXm.so
35endif
36endif
37endif
38
39#
40# Files
41#
42# mawt.gmk is just used in building X/Motif native code, so
43# this list of java files is no longer included.
44#include FILES_java_unix.gmk
45include $(BUILDDIR)/sun/awt/FILES_c_unix.gmk
46
47include $(BUILDDIR)/sun/awt/FILES_export_unix.gmk
48
49# Check which C files should be built. Headless uses only
50# non-motif files. Also, a version-specific motif file is
51# compiled based on the motif version.
52ifdef HEADLESS
53 FILES_c = $(FILES_NO_MOTIF_c)
54else
55 FILES_c = $(FILES_MOTIF_c) $(FILES_NO_MOTIF_c)
56
57 ifeq ($(MOTIF_VERSION), 2)
58 FILES_c += awt_motif21.c
59 FILES_c += awt_Choice21.c
60 endif
61
62endif
63
64ifeq ($(PLATFORM), solaris)
65 ifneq ($(ARCH), amd64)
66 FILES_reorder += reorder-$(ARCH)
67 endif
68endif
69
70#
71# Rules
72#
73
74# Class files should be built & clobbered in make/sun/awt
75# If removing this line, also reinclude sun_awt.jmk
76DONT_CLOBBER_CLASSES = true
77
78
79ifndef HEADLESS
80ifeq ($(VARIANT), OPT)
81FILES_m = ../awt/mapfile-mawt-vers
82endif
83endif
84
85# Since this library will be living in a subdirectory below the other libraries
86# we need to add an extra runpath so that libraries in the upper directory
87# are found at runtime.
88LD_RUNPATH_EXTRAS = ..
89
90include $(BUILDDIR)/common/Mapfile-vers.gmk
91include $(BUILDDIR)/common/Library.gmk
92
93$(LIB_LOCATION):
94 $(MKDIR) -p $@
95
96ifeq ($(PLATFORM), linux)
97ifeq ($(STATIC_MOTIF),false)
98$(LIB_LOCATION)/libXm.so:
99 $(CP) $(MOTIF_LIB)/libXm.so $(LIB_LOCATION)/libXm.so
100# Automounter problem makes the link fail on Redhat 6.1.
101# $(LN) -s $(MOTIF_LIB)/libXm.so $(LIB_LOCATION)/libXm.so
102endif
103endif
104
105clean::
106
107#
108# Add to the ambient vpath to pick up files in subdirectories
109#
110vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/alphacomposite
111vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image
112vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/gif
113vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/cvutils
114vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/shell
115vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/medialib
116vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl
117vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl
118vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11
119vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/debug
120vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../font
121vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d
122vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops
123vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe
124vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/image
125vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child
126
127#
128# Libraries to link in.
129#
130
131
132ifeq ($(DEBUG_BINARIES), true)
133 CFLAGS += -g
134endif
135ifeq ($(HEADLESS),true)
136CFLAGS += -DHEADLESS=$(HEADLESS)
137CPPFLAGS += -DHEADLESS=$(HEADLESS)
138OTHER_LDLIBS =
139else
140CFLAGS += -DMOTIF_VERSION=$(MOTIF_VERSION)
141
142ifeq ($(STATIC_MOTIF),true)
143 LIBXM = $(MOTIF_LIB)/libXm.a -lXp -lXmu
144 ifeq ($(PLATFORM), linux)
145 ifeq ($(ARCH_DATA_MODEL), 64)
146 LIBXT = -lXt
147 else
148 # Allows for builds on Debian GNU Linux, X11 is in a different place
149 LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \
150 $(wildcard /usr/lib/libXt.a))
151 LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \
152 $(wildcard /usr/lib/libSM.a))
153 LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \
154 $(wildcard /usr/lib/libICE.a))
155 endif
156 endif
157else
158 LIBXM = -L$(MOTIF_LIB) -lXm -lXp
159 ifeq ($(PLATFORM), linux)
160 LIBXT = -lXt
161 LIBSM =
162 LIBICE =
163 endif
164endif
165
166LIBXTST = -lXtst
167
168# Use -lXmu for EditRes support
169LIBXMU_DBG = -lXmu
170LIBXMU_OPT =
171LIBXMU = $(LIBXMU_$(VARIANT))
172
173ifeq ($(PLATFORM), solaris)
174OTHER_LDLIBS = $(LIBXM) -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi
175endif
176
177ifeq ($(PLATFORM), linux)
178OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
179OTHER_CFLAGS += -DMOTIF_VERSION=2
180OTHER_CFLAGS += -DXMSTRINGDEFINES=1
181OTHER_LDLIBS = $(LIBXM) $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
182endif
183
184endif
185# !HEADLESS
186
187OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \
188 -lawt $(LIBM) -ldl
189
190#
191# Sun CC with -Xa misdefines __STDC__ to 0 (zero).
192# The following will force checking of X11 prototypes.
193#
194ifneq ($(CC_VERSION),gcc)
195CPPFLAGS += -DFUNCPROTO=15
196endif
197
198#
199# Other extra flags needed for compiling.
200#
201CPPFLAGS += -I$(CUPS_HEADERS_PATH)
202
203ifndef HEADLESS
204CPPFLAGS += -I$(MOTIF_DIR)/include \
205 -I$(OPENWIN_HOME)/include
206LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
207
208endif # !HEADLESS
209
210CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
211 -I$(SHARE_SRC)/native/$(PKGDIR)/../font \
212 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../font \
213 -I$(SHARE_SRC)/native/$(PKGDIR)/image \
214 -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \
215 -I$(SHARE_SRC)/native/$(PKGDIR)/shell \
216 -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \
217 -I$(SHARE_SRC)/native/$(PKGDIR)/medialib \
218 -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib \
219 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d \
220 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d \
221 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops \
222 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe \
223 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl \
224 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl \
225 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 \
226 -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \
227 -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \
228 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \
229 -I$(PLATFORM_SRC)/native/$(PKGDIR) \
230 $(EVENT_MODEL)
231
232ifeq ($(PLATFORM), linux)
233# Checking for the X11/extensions headers at the additional location
234 CPPFLAGS += -I/X11R6/include/X11/extensions \
235 -I/usr/include/X11/extensions
236endif
237
238ifeq ($(PLATFORM), solaris)
239 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
240endif
241
242
243LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \
244 $(AWT_RUNPATH)
245
246CLASSES.export += java.io.InputStream \
247 java.lang.ThreadGroup
248
Note: See TracBrowser for help on using the repository browser.