annotate make/sun/font/Makefile @ 8480:105d6ed3d7bd

Merge from main OpenJDK repository
author Greg Lewis <glewis@eyesbeyond.com>
date Sat, 20 Aug 2016 11:59:31 -0700
parents 66ad975b45a7 3d030fe77f74
children d468376d877c
rev   line source
duke@0 1 #
ohair@4081 2 # Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
ohair@2486 7 # published by the Free Software Foundation. Oracle designates this
duke@0 8 # particular file as subject to the "Classpath" exception as provided
ohair@2486 9 # by Oracle in the LICENSE file that accompanied this code.
duke@0 10 #
duke@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 15 # accompanied this code).
duke@0 16 #
duke@0 17 # You should have received a copy of the GNU General Public License version
duke@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 20 #
ohair@2486 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@2486 22 # or visit www.oracle.com if you need additional information or have any
ohair@2486 23 # questions.
duke@0 24 #
duke@0 25
duke@0 26 #
duke@0 27 # Makefile for building all of font tools
duke@0 28 #
duke@0 29
duke@0 30 BUILDDIR = ../..
duke@0 31 PACKAGE = sun.font
duke@0 32 LIBRARY = fontmanager
duke@0 33 PRODUCT = sun
duke@0 34
duke@0 35 # Indicate we want the C++ compiler to do the linking.
duke@0 36 CPLUSPLUSLIBRARY=true
duke@0 37
ohair@460 38 # Use higher optimization level
prr@6792 39 ifeq ($(PLATFORM), windows)
prr@6792 40 OPTIMIZATION_LEVEL = HIGHEST
prr@6792 41 else
prr@6792 42 OPTIMIZATION_LEVEL = HIGHER
prr@6792 43 endif
ohair@460 44
duke@0 45 include $(BUILDDIR)/common/Defs.gmk
duke@0 46
duke@0 47 #
duke@0 48 # Created without -z defs on linux
duke@0 49 #
duke@0 50 ifeq ($(PLATFORM), linux)
duke@0 51 LDFLAGS_DEFS_OPTION =
duke@0 52 endif
duke@0 53
duke@0 54 #
duke@0 55 # Files
duke@0 56 #
duke@0 57
duke@0 58 include FILES_c.gmk
duke@0 59
duke@0 60 AUTO_FILES_JAVA_DIRS = sun/font
duke@0 61 FILES_java += java/awt/Font.java java/text/Bidi.java
duke@0 62
duke@0 63 FILES_export = \
duke@0 64 sun/font/SunLayoutEngine.java \
duke@0 65 java/awt/Font.java \
duke@0 66 java/text/Bidi.java \
duke@0 67 sun/font/FileFont.java \
prr@301 68 sun/font/FileFontStrike.java \
duke@0 69 sun/font/FontManager.java \
duke@0 70 sun/font/GlyphList.java \
duke@0 71 sun/font/NativeFont.java \
duke@0 72 sun/font/StrikeCache.java \
duke@0 73 sun/font/NullFontScaler.java \
duke@0 74 sun/font/FreetypeFontScaler.java \
duke@0 75 sun/java2d/loops/DrawGlyphList.java \
duke@0 76 sun/java2d/loops/DrawGlyphListAA.java \
duke@0 77 sun/java2d/loops/DrawGlyphListLCD.java \
duke@0 78 sun/java2d/loops/GraphicsPrimitive.java
duke@0 79
duke@0 80 ifeq ($(PLATFORM), windows)
duke@0 81
duke@0 82 LDLIBS += user32.lib gdi32.lib $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib
duke@0 83
duke@0 84 OTHER_CFLAGS += -DCC_NOEX
duke@0 85 OTHER_CXXFLAGS += -DCC_NOEX
duke@0 86
duke@0 87 else # PLATFORM unix
duke@0 88
duke@0 89 FILES_export += \
duke@0 90 sun/font/NativeStrike.java \
duke@0 91 sun/font/NativeStrikeDisposer.java \
duke@0 92 sun/font/X11TextRenderer.java \
duke@0 93 sun/awt/X11GraphicsEnvironment.java
duke@0 94
duke@0 95 endif # PLATFORM
duke@0 96
goetz@8472 97 # Turn off aliasing with GCC for ExtensionSubtables.cpp (and others on GCC < 4.3)
goetz@8472 98 # Turn off strict overflow with GCC for IndicRearrangementProcessor.cpp on GCC >= 4.3
goetz@8472 99 # Ensure signed integers wrap with GCC for IndicRearrangementProcessor.cpp on GCC < 4.3
glewis@5415 100 ifneq (,$(findstring $(PLATFORM), bsd linux))
andrew@5287 101 CXXFLAGS += $(CXXFLAGS_$(@F))
andrew@5287 102 CXXFLAGS_ExtensionSubtables.o = -fno-strict-aliasing
goetz@8435 103 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
goetz@8472 104 # GCC >= 4.3. This flag is not known in gcc 4.1.2.
andrew@8385 105 CXXFLAGS_IndicRearrangementProcessor.o := -fno-strict-overflow
andrew@8385 106 CXXFLAGS_IndicRearrangementProcessor2.o := -fno-strict-overflow
goetz@8472 107 else
goetz@8472 108 CXXFLAGS_ContextualGlyphSubstProc.o = -fno-strict-aliasing
goetz@8472 109 CXXFLAGS_IndicRearrangementProcessor.o := -fwrapv -fno-strict-aliasing
goetz@8472 110 CXXFLAGS_IndicRearrangementProcessor2.o := -fwrapv
goetz@8472 111 CXXFLAGS_MorphTables2.o = -fno-strict-aliasing
andrew@5287 112 endif
goetz@8435 113 endif
andrew@5287 114
duke@0 115 #In the non-OpenJDK mode we need to build T2K
duke@0 116 ifndef OPENJDK
duke@0 117 t2k:
duke@0 118 $(ECHO) "lib=" $(ACTUAL_LIBRARY)
duke@0 119 $(MAKE) -C t2k
duke@0 120
duke@0 121 all build: t2k
duke@0 122 t2k: library
duke@0 123 clean clobber::
duke@0 124 $(MAKE) -C t2k clean
duke@0 125 else
duke@0 126
duke@0 127 FILES_m=mapfile-vers.openjdk
duke@0 128
duke@0 129 #make sure freetype dll will be available at runtime as well as link time
duke@0 130 #
duke@0 131 #NB: Default freetype build system uses -h linker option and
duke@0 132 # result .so contains hardcoded library name that is later
duke@0 133 # used for adding dependencies to other objects
duke@0 134 # (e.g. libfontmanager.so).
duke@0 135 #
duke@0 136 # It is not obvious how to extract that hardcoded name (libfreetype.so.6)
duke@0 137 # without overcomplicating logic here.
duke@0 138 # To workaround this we hardcode .6 suffix for now.
duke@0 139 #
duke@0 140 # Note that .so.6 library will not be found by System.loadLibrary()
duke@0 141 # but fortunately we need to load FreeType library explicitly
duke@0 142 # on windows only
duke@0 143 #
duke@0 144 #TODO: rework this to avoid hardcoding library name in the makefile
duke@0 145 #
duke@0 146 ifeq ($(PLATFORM), windows)
mchung@2188 147 FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX)
mchung@2188 148 OTHER_LDLIBS += $(FREETYPE_LIB_PATH)/freetype.lib
duke@0 149 else
duke@0 150 ifeq ($(USING_SYSTEM_FT_LIB), false)
mchung@2188 151 FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX).6
duke@0 152 endif
mchung@2188 153 OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype
duke@0 154 endif
mchung@2188 155
mchung@2188 156 library:: $(FREETYPE_LIB)
mchung@2188 157
mchung@2188 158 $(FREETYPE_LIB):
mchung@2188 159 $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@
duke@0 160 endif
duke@0 161
duke@0 162 #ifeq ($(PLATFORM), solaris)
duke@0 163 # FILES_reorder += reorder-$(ARCH)
duke@0 164 #endif
duke@0 165 include $(BUILDDIR)/common/Mapfile-vers.gmk
duke@0 166 include $(BUILDDIR)/common/Library.gmk
duke@0 167
duke@0 168 .PHONY: t2k build all clean clobber
duke@0 169
duke@0 170 #
duke@0 171 # Add to the ambient vpath to pick up files in subdirectories
duke@0 172 #
duke@0 173 vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
duke@0 174 vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/layout
duke@0 175 vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
duke@0 176
duke@0 177 #
duke@0 178 # Fontmanager is headless (independent of X/Motif)
duke@0 179 #
duke@0 180 CFLAGS += -DHEADLESS
duke@0 181 CXXFLAGS += -DHEADLESS
duke@0 182
duke@0 183 ifndef OPENJDK
duke@0 184 CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
duke@0 185 else
duke@0 186 CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
duke@0 187 endif
duke@0 188
duke@0 189 ifeq ($(PLATFORM), windows)
duke@0 190 vpath %.cpp $(PLATFORM_SRC)/native/sun/windows
duke@0 191 else # PLATFORM
duke@0 192
duke@0 193 #
duke@0 194 # Libraries to link, and other C flags.
duke@0 195 #
duke@0 196
glewis@5102 197 ifneq (,$(findstring $(PLATFORM), bsd macosx))
michaelm@4834 198 OTHER_INCLUDES += -I$(X11_PATH)/include
michaelm@4834 199 OTHER_LDLIBS += -lawt $(LIBM) $(LIBCXX)
michaelm@4834 200 ifeq ($(OS_VENDOR),Apple)
michaelm@4834 201 # XXXDARWIN Match BSD/Linux behavior -- the mawt.dylib symbols will
michaelm@4834 202 # be available at runtime.
michaelm@4834 203 OTHER_LDLIBS += -undefined dynamic_lookup
michaelm@4834 204 endif
michaelm@4834 205 else
duke@0 206 ifeq ($(PLATFORM), solaris)
duke@0 207 # Note that on Solaris, fontmanager is built against the headless library.
duke@0 208 LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/headless
duke@0 209 OTHER_LDLIBS += -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -lc $(LIBM) $(LIBCXX)
duke@0 210 else # PLATFORM is linux
duke@0 211 OTHER_LDLIBS += -lawt $(LIBM) $(LIBCXX)
duke@0 212 ifeq ("$(CC_VER_MAJOR)", "3")
duke@0 213 OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
duke@0 214 endif
duke@0 215 endif
michaelm@4834 216 endif
duke@0 217
duke@0 218 endif # PLATFORM
duke@0 219
duke@0 220 # set up compile flags..
duke@0 221
michaelm@4834 222 ifeq ($(PLATFORM), macosx))
michaelm@4834 223 CPPFLAGS += -I$(CLASSHDRDIR)
michaelm@4834 224 endif
michaelm@4834 225
duke@0 226 CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR) \
duke@0 227 -I$(SHARE_SRC)/native/$(PKGDIR)/layout \
duke@0 228 -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
duke@0 229 -I$(PLATFORM_SRC)/native/sun/awt \
duke@0 230 -I$(SHARE_SRC)/native/sun/awt/debug \
duke@0 231 -I$(SHARE_SRC)/native/sun/java2d/loops \
duke@0 232 -I$(SHARE_SRC)/native/sun/java2d/pipe \
duke@0 233 -I$(PLATFORM_SRC)/native/sun/java2d \
duke@0 234 -I$(SHARE_SRC)/native/sun/java2d \
duke@0 235 -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
duke@0 236
duke@0 237 ifeq ($(PLATFORM), windows)
tdv@430 238 CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows
duke@0 239 endif
duke@0 240
srl@1788 241 # Make the Layout Engine build standalone
srl@1788 242 CPPFLAGS += -DLE_STANDALONE
srl@1788 243
srl@1788 244