comparison make/sun/font/Makefile @ 0:37a05a11f281

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