source: trunk/openjdk/jdk/make/sun/font/Makefile

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: 6.8 KB
Line 
1#
2# Copyright (c) 1997, 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# Makefile for building all of font tools
28#
29
30BUILDDIR = ../..
31PACKAGE = sun.font
32LIBRARY = fontmanager
33PRODUCT = sun
34
35ifeq ($(PLATFORM), os2)
36LIBRARY_SHORT = jfontmgr
37endif
38
39# Indicate we want the C++ compiler to do the linking.
40CPLUSPLUSLIBRARY=true
41
42include $(BUILDDIR)/common/Defs.gmk
43
44#
45# Created without -z defs on linux
46#
47ifeq ($(PLATFORM), linux)
48 LDFLAGS_DEFS_OPTION =
49endif
50
51#
52# Files
53#
54
55#
56# Use higher optimization level
57#
58_OPT = $(CC_HIGHER_OPT)
59
60include FILES_c.gmk
61
62AUTO_FILES_JAVA_DIRS = sun/font
63FILES_java += java/awt/Font.java java/text/Bidi.java
64
65FILES_export = \
66 sun/font/SunLayoutEngine.java \
67 java/awt/Font.java \
68 java/text/Bidi.java \
69 sun/font/FileFont.java \
70 sun/font/FontManager.java \
71 sun/font/GlyphList.java \
72 sun/font/NativeFont.java \
73 sun/font/StrikeCache.java \
74 sun/font/NullFontScaler.java \
75 sun/font/FreetypeFontScaler.java \
76 sun/java2d/loops/DrawGlyphList.java \
77 sun/java2d/loops/DrawGlyphListAA.java \
78 sun/java2d/loops/DrawGlyphListLCD.java \
79 sun/java2d/loops/GraphicsPrimitive.java
80
81ifeq ($(PLATFORM), windows)
82
83 # Files built here do not compile with warning level 3 if warnings are fatal
84 COMPILER_WARNINGS_FATAL=false
85
86 LDLIBS += user32.lib gdi32.lib $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib
87
88 OTHER_CFLAGS += -DCC_NOEX
89 OTHER_CXXFLAGS += -DCC_NOEX
90
91 FILES_export += sun/java2d/d3d/D3DTextRenderer.java
92
93else
94ifeq ($(PLATFORM), os2)
95
96 LDLIBS += -luser32.lib -lgdi32.lib -l$(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib
97
98 # no D3D ATM
99 #FILES_export += sun/java2d/d3d/D3DTextRenderer.java
100
101else # PLATFORM unix
102
103 FILES_export += \
104 sun/font/NativeStrike.java \
105 sun/font/NativeStrikeDisposer.java \
106 sun/font/X11TextRenderer.java \
107 sun/awt/X11GraphicsEnvironment.java
108
109endif # PLATFORM
110endif # PLATFORM
111
112#In the non-OpenJDK mode we need to build T2K
113ifndef OPENJDK
114t2k:
115 $(ECHO) "lib=" $(ACTUAL_LIBRARY)
116 $(MAKE) -C t2k
117
118all build: t2k
119t2k: library
120clean clobber::
121 $(MAKE) -C t2k clean
122else
123
124FILES_m=mapfile-vers.openjdk
125
126#make sure freetype dll will be available at runtime as well as link time
127#
128#NB: Default freetype build system uses -h linker option and
129# result .so contains hardcoded library name that is later
130# used for adding dependencies to other objects
131# (e.g. libfontmanager.so).
132#
133# It is not obvious how to extract that hardcoded name (libfreetype.so.6)
134# without overcomplicating logic here.
135# To workaround this we hardcode .6 suffix for now.
136#
137# Note that .so.6 library will not be found by System.loadLibrary()
138# but fortunately we need to load FreeType library explicitly
139# on windows only
140#
141#TODO: rework this to avoid hardcoding library name in the makefile
142#
143library:: $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX)
144
145$(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX):
146ifeq ($(filter-out windows os2, $(PLATFORM)),)
147 ifeq ($(PLATFORM), windows)
148 $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@
149 eles
150 # we link to the static library so far, see #32 for details
151 endif
152else
153 ifeq ($(USING_SYSTEM_FT_LIB), false)
154 $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@.6
155 endif
156endif
157endif
158
159#ifeq ($(PLATFORM), solaris)
160# FILES_reorder += reorder-$(ARCH)
161#endif
162include $(BUILDDIR)/common/Mapfile-vers.gmk
163include $(BUILDDIR)/common/Library.gmk
164
165.PHONY: t2k build all clean clobber
166
167#
168# Add to the ambient vpath to pick up files in subdirectories
169#
170vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
171vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/bidi
172vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/layout
173vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
174
175ifeq ($(PLATFORM), os2)
176vpath %.c $(PLATFORM_SRC_OS2)/native/$(PKGDIR)
177endif
178
179#
180# Fontmanager is headless (independent of X/Motif)
181#
182CFLAGS += -DHEADLESS
183CXXFLAGS += -DHEADLESS
184
185ifndef OPENJDK
186 CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
187else
188 CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
189 OTHER_LDLIBS += $(FREETYPE_LIB)
190endif
191
192ifeq ($(filter-out windows os2, $(PLATFORM)),)
193vpath %.cpp $(PLATFORM_SRC)/native/sun/windows
194vpath %.cpp $(PLATFORM_SRC)/native/sun/java2d/d3d
195else # PLATFORM
196
197#
198# Libraries to link, and other C flags.
199#
200
201ifeq ($(PLATFORM), solaris)
202 # Note that on Solaris, fontmanager is built against the headless library.
203 LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/headless
204 OTHER_LDLIBS += -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -lc $(LIBM) $(LIBCXX)
205else # PLATFORM is linux
206 OTHER_LDLIBS += -lawt $(LIBM) $(LIBCXX)
207 ifeq ("$(CC_VER_MAJOR)", "3")
208 OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
209 endif
210endif
211
212endif # PLATFORM
213
214# set up compile flags..
215
216# some font headers interfere with the compiler headers (e.g. Features.h vs
217# features.h) on OS/2. Use -iquote to solve that
218ifeq ($(PLATFORM), os2)
219I_OPT = -iquote # preserve trailing space
220else
221I_OPT = -I
222endif
223
224CPPFLAGS += $(I_OPT)$(SHARE_SRC)/native/$(PKGDIR) \
225 $(I_OPT)$(SHARE_SRC)/native/$(PKGDIR)/layout \
226 $(I_OPT)$(SHARE_SRC)/native/$(PKGDIR)/bidi \
227 $(I_OPT)$(SHARE_SRC)/native/sun/awt/image/cvutils \
228 $(I_OPT)$(PLATFORM_SRC)/native/sun/awt \
229 $(I_OPT)$(SHARE_SRC)/native/sun/awt/debug \
230 $(I_OPT)$(SHARE_SRC)/native/sun/java2d/loops \
231 $(I_OPT)$(SHARE_SRC)/native/sun/java2d/pipe \
232 $(I_OPT)$(PLATFORM_SRC)/native/sun/java2d \
233 $(I_OPT)$(SHARE_SRC)/native/sun/java2d \
234 $(I_OPT)$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
235
236ifeq ($(filter-out windows os2, $(PLATFORM)),)
237CPPFLAGS += $(I_OPT)$(PLATFORM_SRC)/native/sun/windows \
238 $(I_OPT)$(PLATFORM_SRC)/native/sun/java2d/d3d
239endif
240
Note: See TracBrowser for help on using the repository browser.