blob: 5abf993d1d7d4dba56d04097666bfe2a0d56db74 [file] [log] [blame]
duke6e45e102007-12-01 00:00:00 +00001#
alanb0d058232012-11-02 15:50:11 +00002# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
duke6e45e102007-12-01 00:00:00 +00003# 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
ohair2283b9d2010-05-25 15:58:33 -07007# published by the Free Software Foundation. Oracle designates this
duke6e45e102007-12-01 00:00:00 +00008# particular file as subject to the "Classpath" exception as provided
ohair2283b9d2010-05-25 15:58:33 -07009# by Oracle in the LICENSE file that accompanied this code.
duke6e45e102007-12-01 00:00:00 +000010#
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#
ohair2283b9d2010-05-25 15:58:33 -070021# 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.
duke6e45e102007-12-01 00:00:00 +000024#
25
26#
27# to create directory:
28#
29INIT += $(LIB_LOCATION)
30
duke6e45e102007-12-01 00:00:00 +000031#
32# Files
33#
34# mawt.gmk is just used in building X/Motif native code, so
35# this list of java files is no longer included.
36#include FILES_java_unix.gmk
37include $(BUILDDIR)/sun/awt/FILES_c_unix.gmk
38
39include $(BUILDDIR)/sun/awt/FILES_export_unix.gmk
40
41# Check which C files should be built. Headless uses only
42# non-motif files. Also, a version-specific motif file is
43# compiled based on the motif version.
serbdf025b42011-11-12 04:13:38 +040044FILES_c = $(FILES_NO_MOTIF_c)
duke6e45e102007-12-01 00:00:00 +000045
46ifeq ($(PLATFORM), solaris)
47 ifneq ($(ARCH), amd64)
48 FILES_reorder += reorder-$(ARCH)
49 endif
50endif
51
52#
53# Rules
54#
55
56# Class files should be built & clobbered in make/sun/awt
57# If removing this line, also reinclude sun_awt.jmk
58DONT_CLOBBER_CLASSES = true
59
60
61ifndef HEADLESS
62ifeq ($(VARIANT), OPT)
63FILES_m = ../awt/mapfile-mawt-vers
64endif
65endif
66
67# Since this library will be living in a subdirectory below the other libraries
68# we need to add an extra runpath so that libraries in the upper directory
69# are found at runtime.
70LD_RUNPATH_EXTRAS = ..
71
72include $(BUILDDIR)/common/Mapfile-vers.gmk
73include $(BUILDDIR)/common/Library.gmk
74
75$(LIB_LOCATION):
76 $(MKDIR) -p $@
77
duke6e45e102007-12-01 00:00:00 +000078clean::
79
80#
81# Add to the ambient vpath to pick up files in subdirectories
82#
83vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/alphacomposite
84vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image
85vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/gif
86vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/cvutils
87vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/shell
88vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/medialib
89vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl
90vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl
91vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11
92vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/debug
93vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../font
94vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d
95vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops
96vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe
97vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/image
98vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child
99
100#
101# Libraries to link in.
102#
103
104
aphd46bd762009-04-17 15:56:20 +0100105ifeq ($(DEBUG_BINARIES), true)
106 CFLAGS += -g
107endif
duke6e45e102007-12-01 00:00:00 +0000108ifeq ($(HEADLESS),true)
109CFLAGS += -DHEADLESS=$(HEADLESS)
110CPPFLAGS += -DHEADLESS=$(HEADLESS)
111OTHER_LDLIBS =
112else
duke6e45e102007-12-01 00:00:00 +0000113LIBXTST = -lXtst
yan0dcf7c82008-06-19 11:26:54 +0400114ifeq ($(PLATFORM), linux)
115 ifeq ($(ARCH_DATA_MODEL), 64)
116 # XXX what about the rest of them?
117 LIBXT = -lXt
118 else
119 # Allows for builds on Debian GNU Linux, X11 is in a different place
dholmes55e3c862011-03-25 07:09:38 -0400120 LIBXT = $(firstword $(wildcard $(OPENWIN_LIB)/libXt.a) \
yan0dcf7c82008-06-19 11:26:54 +0400121 $(wildcard /usr/lib/libXt.a))
dholmes55e3c862011-03-25 07:09:38 -0400122 LIBSM = $(firstword $(wildcard $(OPENWIN_LIB)/libSM.a) \
yan0dcf7c82008-06-19 11:26:54 +0400123 $(wildcard /usr/lib/libSM.a))
dholmes55e3c862011-03-25 07:09:38 -0400124 LIBICE = $(firstword $(wildcard $(OPENWIN_LIB)/libICE.a) \
yan0dcf7c82008-06-19 11:26:54 +0400125 $(wildcard /usr/lib/libICE.a))
dholmes55e3c862011-03-25 07:09:38 -0400126 LIBXTST = $(firstword $(wildcard $(OPENWIN_LIB)/libXtst.a) \
yan0dcf7c82008-06-19 11:26:54 +0400127 $(wildcard /usr/lib/libXtst.a))
128 endif
129endif
duke6e45e102007-12-01 00:00:00 +0000130
131# Use -lXmu for EditRes support
132LIBXMU_DBG = -lXmu
133LIBXMU_OPT =
134LIBXMU = $(LIBXMU_$(VARIANT))
135
136ifeq ($(PLATFORM), solaris)
yan0dcf7c82008-06-19 11:26:54 +0400137OTHER_LDLIBS = -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi
duke6e45e102007-12-01 00:00:00 +0000138endif
139
michaelm5ac8c152012-03-06 20:34:38 +0000140ifneq (,$(findstring $(PLATFORM), linux macosx))
duke6e45e102007-12-01 00:00:00 +0000141OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
yan0dcf7c82008-06-19 11:26:54 +0400142# XXX what is this define below? Isn't it motif-related?
duke6e45e102007-12-01 00:00:00 +0000143OTHER_CFLAGS += -DXMSTRINGDEFINES=1
yan0dcf7c82008-06-19 11:26:54 +0400144OTHER_LDLIBS = $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
duke6e45e102007-12-01 00:00:00 +0000145endif
146
147endif
148# !HEADLESS
149
150OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \
michaelm5ac8c152012-03-06 20:34:38 +0000151 -lawt $(LIBM) $(LIBDL)
duke6e45e102007-12-01 00:00:00 +0000152
153#
154# Sun CC with -Xa misdefines __STDC__ to 0 (zero).
155# The following will force checking of X11 prototypes.
156#
157ifneq ($(CC_VERSION),gcc)
158CPPFLAGS += -DFUNCPROTO=15
159endif
160
161#
162# Other extra flags needed for compiling.
163#
164CPPFLAGS += -I$(CUPS_HEADERS_PATH)
165
166ifndef HEADLESS
yan0dcf7c82008-06-19 11:26:54 +0400167CPPFLAGS += -I$(OPENWIN_HOME)/include
168LDFLAGS += -L$(OPENWIN_LIB)
duke6e45e102007-12-01 00:00:00 +0000169
170endif # !HEADLESS
171
172CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
173 -I$(SHARE_SRC)/native/$(PKGDIR)/../font \
174 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../font \
175 -I$(SHARE_SRC)/native/$(PKGDIR)/image \
176 -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \
177 -I$(SHARE_SRC)/native/$(PKGDIR)/shell \
178 -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \
179 -I$(SHARE_SRC)/native/$(PKGDIR)/medialib \
180 -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib \
181 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d \
182 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d \
183 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops \
184 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe \
185 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl \
186 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl \
187 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 \
188 -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \
189 -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \
190 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \
191 -I$(PLATFORM_SRC)/native/$(PKGDIR) \
192 $(EVENT_MODEL)
193
michaelm5ac8c152012-03-06 20:34:38 +0000194ifeq ($(PLATFORM), macosx)
195CPPFLAGS += -I$(CUPS_HEADERS_PATH)
196
197ifndef HEADLESS
198CPPFLAGS += -I$(MOTIF_DIR)/include \
199 -I$(OPENWIN_HOME)/include
200LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
201
202endif # !HEADLESS
203endif # PLATFORM
204
duke6e45e102007-12-01 00:00:00 +0000205ifeq ($(PLATFORM), linux)
dholmes55e3c862011-03-25 07:09:38 -0400206 # Checking for the X11/extensions headers at the additional location
207 CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \
208 $(wildcard /usr/include/X11/extensions))
duke6e45e102007-12-01 00:00:00 +0000209endif
210
michaelm96f23c92012-03-23 11:28:58 +0000211ifeq ($(PLATFORM), macosx)
michaelm5ac8c152012-03-06 20:34:38 +0000212 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
213 -I$(OPENWIN_HOME)/include
214endif
215
duke6e45e102007-12-01 00:00:00 +0000216ifeq ($(PLATFORM), solaris)
217 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
218endif
219
michaelm5ac8c152012-03-06 20:34:38 +0000220ifeq ($(PLATFORM), macosx)
221 CPPFLAGS += -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
222endif
duke6e45e102007-12-01 00:00:00 +0000223
224LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \
225 $(AWT_RUNPATH)
226
227CLASSES.export += java.io.InputStream \
228 java.lang.ThreadGroup
229