blob: ffe222c9a2ed9f2700b1848ac132621fa00f5d68 [file] [log] [blame]
duke6e45e102007-12-01 00:00:00 +00001#
2# Copyright 2000-2007 Sun Microsystems, Inc. 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. Sun designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22# CA 95054 USA or visit www.sun.com if you need additional information or
23# have any 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
132#CFLAGS += -g
133ifeq ($(HEADLESS),true)
134CFLAGS += -DHEADLESS=$(HEADLESS)
135CPPFLAGS += -DHEADLESS=$(HEADLESS)
136OTHER_LDLIBS =
137else
138CFLAGS += -DMOTIF_VERSION=$(MOTIF_VERSION)
139
140ifeq ($(STATIC_MOTIF),true)
141 LIBXM = $(MOTIF_LIB)/libXm.a -lXp -lXmu
142 ifeq ($(PLATFORM), linux)
143 ifeq ($(ARCH_DATA_MODEL), 64)
144 LIBXT = -lXt
145 else
146 # Allows for builds on Debian GNU Linux, X11 is in a different place
147 LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \
148 $(wildcard /usr/lib/libXt.a))
149 LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \
150 $(wildcard /usr/lib/libSM.a))
151 LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \
152 $(wildcard /usr/lib/libICE.a))
153 endif
154 endif
155else
156 LIBXM = -L$(MOTIF_LIB) -lXm -lXp
157 ifeq ($(PLATFORM), linux)
158 LIBXT = -lXt
159 LIBSM =
160 LIBICE =
161 endif
162endif
163
164LIBXTST = -lXtst
165
166# Use -lXmu for EditRes support
167LIBXMU_DBG = -lXmu
168LIBXMU_OPT =
169LIBXMU = $(LIBXMU_$(VARIANT))
170
171ifeq ($(PLATFORM), solaris)
172OTHER_LDLIBS = $(LIBXM) -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi
173endif
174
175ifeq ($(PLATFORM), linux)
176OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
177OTHER_CFLAGS += -DMOTIF_VERSION=2
178OTHER_CFLAGS += -DXMSTRINGDEFINES=1
179OTHER_LDLIBS = $(LIBXM) $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
180endif
181
182endif
183# !HEADLESS
184
185OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \
186 -lawt $(LIBM) -ldl
187
188#
189# Sun CC with -Xa misdefines __STDC__ to 0 (zero).
190# The following will force checking of X11 prototypes.
191#
192ifneq ($(CC_VERSION),gcc)
193CPPFLAGS += -DFUNCPROTO=15
194endif
195
196#
197# Other extra flags needed for compiling.
198#
199CPPFLAGS += -I$(CUPS_HEADERS_PATH)
200
201ifndef HEADLESS
202CPPFLAGS += -I$(MOTIF_DIR)/include \
203 -I$(OPENWIN_HOME)/include
204LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
205
206endif # !HEADLESS
207
208CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
209 -I$(SHARE_SRC)/native/$(PKGDIR)/../font \
210 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../font \
211 -I$(SHARE_SRC)/native/$(PKGDIR)/image \
212 -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \
213 -I$(SHARE_SRC)/native/$(PKGDIR)/shell \
214 -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \
215 -I$(SHARE_SRC)/native/$(PKGDIR)/medialib \
216 -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib \
217 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d \
218 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d \
219 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops \
220 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe \
221 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl \
222 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl \
223 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 \
224 -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \
225 -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \
226 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \
227 -I$(PLATFORM_SRC)/native/$(PKGDIR) \
228 $(EVENT_MODEL)
229
230ifeq ($(PLATFORM), linux)
231# Checking for the X11/extensions headers at the additional location
232 CPPFLAGS += -I/X11R6/include/X11/extensions \
233 -I/usr/include/X11/extensions
234endif
235
236ifeq ($(PLATFORM), solaris)
237 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
238endif
239
240
241LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \
242 $(AWT_RUNPATH)
243
244CLASSES.export += java.io.InputStream \
245 java.lang.ThreadGroup
246