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 |
|
---|
30 | BUILDDIR = ../..
|
---|
31 | PACKAGE = sun.font
|
---|
32 | LIBRARY = fontmanager
|
---|
33 | PRODUCT = sun
|
---|
34 |
|
---|
35 | ifeq ($(PLATFORM), os2)
|
---|
36 | LIBRARY_SHORT = jfontmgr
|
---|
37 | endif
|
---|
38 |
|
---|
39 | # Indicate we want the C++ compiler to do the linking.
|
---|
40 | CPLUSPLUSLIBRARY=true
|
---|
41 |
|
---|
42 | include $(BUILDDIR)/common/Defs.gmk
|
---|
43 |
|
---|
44 | #
|
---|
45 | # Created without -z defs on linux
|
---|
46 | #
|
---|
47 | ifeq ($(PLATFORM), linux)
|
---|
48 | LDFLAGS_DEFS_OPTION =
|
---|
49 | endif
|
---|
50 |
|
---|
51 | #
|
---|
52 | # Files
|
---|
53 | #
|
---|
54 |
|
---|
55 | #
|
---|
56 | # Use higher optimization level
|
---|
57 | #
|
---|
58 | _OPT = $(CC_HIGHER_OPT)
|
---|
59 |
|
---|
60 | include FILES_c.gmk
|
---|
61 |
|
---|
62 | AUTO_FILES_JAVA_DIRS = sun/font
|
---|
63 | FILES_java += java/awt/Font.java java/text/Bidi.java
|
---|
64 |
|
---|
65 | FILES_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 |
|
---|
81 | ifeq ($(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 |
|
---|
93 | else
|
---|
94 | ifeq ($(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 |
|
---|
101 | else # 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 |
|
---|
109 | endif # PLATFORM
|
---|
110 | endif # PLATFORM
|
---|
111 |
|
---|
112 | #In the non-OpenJDK mode we need to build T2K
|
---|
113 | ifndef OPENJDK
|
---|
114 | t2k:
|
---|
115 | $(ECHO) "lib=" $(ACTUAL_LIBRARY)
|
---|
116 | $(MAKE) -C t2k
|
---|
117 |
|
---|
118 | all build: t2k
|
---|
119 | t2k: library
|
---|
120 | clean clobber::
|
---|
121 | $(MAKE) -C t2k clean
|
---|
122 | else
|
---|
123 |
|
---|
124 | FILES_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 | #
|
---|
143 | library:: $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX)
|
---|
144 |
|
---|
145 | $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX):
|
---|
146 | ifeq ($(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
|
---|
152 | else
|
---|
153 | ifeq ($(USING_SYSTEM_FT_LIB), false)
|
---|
154 | $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@.6
|
---|
155 | endif
|
---|
156 | endif
|
---|
157 | endif
|
---|
158 |
|
---|
159 | #ifeq ($(PLATFORM), solaris)
|
---|
160 | # FILES_reorder += reorder-$(ARCH)
|
---|
161 | #endif
|
---|
162 | include $(BUILDDIR)/common/Mapfile-vers.gmk
|
---|
163 | include $(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 | #
|
---|
170 | vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
|
---|
171 | vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/bidi
|
---|
172 | vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/layout
|
---|
173 | vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
|
---|
174 |
|
---|
175 | ifeq ($(PLATFORM), os2)
|
---|
176 | vpath %.c $(PLATFORM_SRC_OS2)/native/$(PKGDIR)
|
---|
177 | endif
|
---|
178 |
|
---|
179 | #
|
---|
180 | # Fontmanager is headless (independent of X/Motif)
|
---|
181 | #
|
---|
182 | CFLAGS += -DHEADLESS
|
---|
183 | CXXFLAGS += -DHEADLESS
|
---|
184 |
|
---|
185 | ifndef OPENJDK
|
---|
186 | CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
|
---|
187 | else
|
---|
188 | CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
|
---|
189 | OTHER_LDLIBS += $(FREETYPE_LIB)
|
---|
190 | endif
|
---|
191 |
|
---|
192 | ifeq ($(filter-out windows os2, $(PLATFORM)),)
|
---|
193 | vpath %.cpp $(PLATFORM_SRC)/native/sun/windows
|
---|
194 | vpath %.cpp $(PLATFORM_SRC)/native/sun/java2d/d3d
|
---|
195 | else # PLATFORM
|
---|
196 |
|
---|
197 | #
|
---|
198 | # Libraries to link, and other C flags.
|
---|
199 | #
|
---|
200 |
|
---|
201 | ifeq ($(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)
|
---|
205 | else # 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
|
---|
210 | endif
|
---|
211 |
|
---|
212 | endif # 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
|
---|
218 | ifeq ($(PLATFORM), os2)
|
---|
219 | I_OPT = -iquote # preserve trailing space
|
---|
220 | else
|
---|
221 | I_OPT = -I
|
---|
222 | endif
|
---|
223 |
|
---|
224 | CPPFLAGS += $(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 |
|
---|
236 | ifeq ($(filter-out windows os2, $(PLATFORM)),)
|
---|
237 | CPPFLAGS += $(I_OPT)$(PLATFORM_SRC)/native/sun/windows \
|
---|
238 | $(I_OPT)$(PLATFORM_SRC)/native/sun/java2d/d3d
|
---|
239 | endif
|
---|
240 |
|
---|