blob: 7ca05207edef047fc6421c24be5f486248df9204 [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
jchen21981182013-05-23 12:16:17 -070046ifeq ($(PLATFORM), macosx)
47FILES_objc = $(FILES_NO_MOTIF_objc)
48endif # PLATFORM
49
duke6e45e102007-12-01 00:00:00 +000050ifeq ($(PLATFORM), solaris)
51 ifneq ($(ARCH), amd64)
52 FILES_reorder += reorder-$(ARCH)
53 endif
54endif
55
56#
57# Rules
58#
59
60# Class files should be built & clobbered in make/sun/awt
61# If removing this line, also reinclude sun_awt.jmk
62DONT_CLOBBER_CLASSES = true
63
64
65ifndef HEADLESS
66ifeq ($(VARIANT), OPT)
67FILES_m = ../awt/mapfile-mawt-vers
68endif
69endif
70
71# Since this library will be living in a subdirectory below the other libraries
72# we need to add an extra runpath so that libraries in the upper directory
73# are found at runtime.
74LD_RUNPATH_EXTRAS = ..
75
76include $(BUILDDIR)/common/Mapfile-vers.gmk
77include $(BUILDDIR)/common/Library.gmk
78
79$(LIB_LOCATION):
80 $(MKDIR) -p $@
81
duke6e45e102007-12-01 00:00:00 +000082clean::
83
84#
85# Add to the ambient vpath to pick up files in subdirectories
86#
87vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/alphacomposite
88vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image
89vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/gif
90vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/cvutils
91vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/shell
92vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/medialib
93vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl
94vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl
95vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11
96vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/debug
97vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../font
98vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d
99vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops
100vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe
101vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/image
102vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child
103
jchen21981182013-05-23 12:16:17 -0700104ifeq ($(PLATFORM), macosx)
105vpath %.m $(call NativeSrcDirList,,native/sun/font)
106endif # PLATFORM
107
duke6e45e102007-12-01 00:00:00 +0000108#
109# Libraries to link in.
110#
111
112
aphd46bd762009-04-17 15:56:20 +0100113ifeq ($(DEBUG_BINARIES), true)
114 CFLAGS += -g
115endif
duke6e45e102007-12-01 00:00:00 +0000116ifeq ($(HEADLESS),true)
117CFLAGS += -DHEADLESS=$(HEADLESS)
118CPPFLAGS += -DHEADLESS=$(HEADLESS)
119OTHER_LDLIBS =
120else
duke6e45e102007-12-01 00:00:00 +0000121LIBXTST = -lXtst
yan0dcf7c82008-06-19 11:26:54 +0400122ifeq ($(PLATFORM), linux)
123 ifeq ($(ARCH_DATA_MODEL), 64)
124 # XXX what about the rest of them?
125 LIBXT = -lXt
126 else
127 # Allows for builds on Debian GNU Linux, X11 is in a different place
dholmes55e3c862011-03-25 07:09:38 -0400128 LIBXT = $(firstword $(wildcard $(OPENWIN_LIB)/libXt.a) \
yan0dcf7c82008-06-19 11:26:54 +0400129 $(wildcard /usr/lib/libXt.a))
dholmes55e3c862011-03-25 07:09:38 -0400130 LIBSM = $(firstword $(wildcard $(OPENWIN_LIB)/libSM.a) \
yan0dcf7c82008-06-19 11:26:54 +0400131 $(wildcard /usr/lib/libSM.a))
dholmes55e3c862011-03-25 07:09:38 -0400132 LIBICE = $(firstword $(wildcard $(OPENWIN_LIB)/libICE.a) \
yan0dcf7c82008-06-19 11:26:54 +0400133 $(wildcard /usr/lib/libICE.a))
dholmes55e3c862011-03-25 07:09:38 -0400134 LIBXTST = $(firstword $(wildcard $(OPENWIN_LIB)/libXtst.a) \
yan0dcf7c82008-06-19 11:26:54 +0400135 $(wildcard /usr/lib/libXtst.a))
136 endif
137endif
duke6e45e102007-12-01 00:00:00 +0000138
139# Use -lXmu for EditRes support
140LIBXMU_DBG = -lXmu
141LIBXMU_OPT =
142LIBXMU = $(LIBXMU_$(VARIANT))
143
144ifeq ($(PLATFORM), solaris)
yan0dcf7c82008-06-19 11:26:54 +0400145OTHER_LDLIBS = -lXt -lXext $(LIBXTST) $(LIBXMU) -lX11 -lXi
duke6e45e102007-12-01 00:00:00 +0000146endif
147
michaelm5ac8c152012-03-06 20:34:38 +0000148ifneq (,$(findstring $(PLATFORM), linux macosx))
duke6e45e102007-12-01 00:00:00 +0000149OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
yan0dcf7c82008-06-19 11:26:54 +0400150# XXX what is this define below? Isn't it motif-related?
duke6e45e102007-12-01 00:00:00 +0000151OTHER_CFLAGS += -DXMSTRINGDEFINES=1
yan0dcf7c82008-06-19 11:26:54 +0400152OTHER_LDLIBS = $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
duke6e45e102007-12-01 00:00:00 +0000153endif
154
155endif
156# !HEADLESS
157
158OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \
michaelm5ac8c152012-03-06 20:34:38 +0000159 -lawt $(LIBM) $(LIBDL)
duke6e45e102007-12-01 00:00:00 +0000160
161#
162# Sun CC with -Xa misdefines __STDC__ to 0 (zero).
163# The following will force checking of X11 prototypes.
164#
165ifneq ($(CC_VERSION),gcc)
166CPPFLAGS += -DFUNCPROTO=15
167endif
168
169#
170# Other extra flags needed for compiling.
171#
172CPPFLAGS += -I$(CUPS_HEADERS_PATH)
173
174ifndef HEADLESS
yan0dcf7c82008-06-19 11:26:54 +0400175CPPFLAGS += -I$(OPENWIN_HOME)/include
176LDFLAGS += -L$(OPENWIN_LIB)
duke6e45e102007-12-01 00:00:00 +0000177
178endif # !HEADLESS
179
180CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
181 -I$(SHARE_SRC)/native/$(PKGDIR)/../font \
182 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../font \
183 -I$(SHARE_SRC)/native/$(PKGDIR)/image \
184 -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \
185 -I$(SHARE_SRC)/native/$(PKGDIR)/shell \
186 -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \
187 -I$(SHARE_SRC)/native/$(PKGDIR)/medialib \
188 -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib \
189 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d \
190 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d \
191 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops \
192 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe \
193 -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl \
194 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl \
195 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 \
196 -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \
197 -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \
198 -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \
199 -I$(PLATFORM_SRC)/native/$(PKGDIR) \
200 $(EVENT_MODEL)
201
michaelm5ac8c152012-03-06 20:34:38 +0000202ifeq ($(PLATFORM), macosx)
jchen21981182013-05-23 12:16:17 -0700203CPPFLAGS += -I$(CUPS_HEADERS_PATH) \
204 $(call NativeSrcDirList,-I,native/sun/awt) \
205 $(call NativeSrcDirList,-I,native/sun/font)
michaelm5ac8c152012-03-06 20:34:38 +0000206
207ifndef HEADLESS
208CPPFLAGS += -I$(MOTIF_DIR)/include \
209 -I$(OPENWIN_HOME)/include
210LDFLAGS += -L$(MOTIF_LIB) -L$(OPENWIN_LIB)
jchen21981182013-05-23 12:16:17 -0700211else
212LDFLAGS += -framework Accelerate \
213 -framework ApplicationServices \
214 -framework Cocoa \
215 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
216 -framework JavaNativeFoundation \
217 -framework JavaRuntimeSupport
michaelm5ac8c152012-03-06 20:34:38 +0000218endif # !HEADLESS
219endif # PLATFORM
220
duke6e45e102007-12-01 00:00:00 +0000221ifeq ($(PLATFORM), linux)
dholmes55e3c862011-03-25 07:09:38 -0400222 # Checking for the X11/extensions headers at the additional location
223 CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \
224 $(wildcard /usr/include/X11/extensions))
duke6e45e102007-12-01 00:00:00 +0000225endif
226
michaelm96f23c92012-03-23 11:28:58 +0000227ifeq ($(PLATFORM), macosx)
michaelm5ac8c152012-03-06 20:34:38 +0000228 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
229 -I$(OPENWIN_HOME)/include
230endif
231
duke6e45e102007-12-01 00:00:00 +0000232ifeq ($(PLATFORM), solaris)
233 CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
234endif
235
michaelm5ac8c152012-03-06 20:34:38 +0000236ifeq ($(PLATFORM), macosx)
237 CPPFLAGS += -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
238endif
duke6e45e102007-12-01 00:00:00 +0000239
240LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/$(TSOBJDIR) \
241 $(AWT_RUNPATH)
242
243CLASSES.export += java.io.InputStream \
244 java.lang.ThreadGroup
245