Makefile revision 1693
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# This code is free software; you can redistribute it and/or modify it
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# under the terms of the GNU General Public License version 2 only, as
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# published by the Free Software Foundation. Sun designates this
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# particular file as subject to the "Classpath" exception as provided
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# by Sun in the LICENSE file that accompanied this code.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# This code is distributed in the hope that it will be useful, but WITHOUT
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# version 2 for more details (a copy is included in the LICENSE file that
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# accompanied this code).
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You should have received a copy of the GNU General Public License version
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# CA 95054 USA or visit www.sun.com if you need additional information or
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# have any questions.
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Makefile for building all of font tools
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserBUILDDIR = ../..
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserPACKAGE = sun.font
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLIBRARY = fontmanager
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPRODUCT = sun
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Indicate we want the C++ compiler to do the linking.
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserCPLUSPLUSLIBRARY=true
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Use higher optimization level
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsOPTIMIZATION_LEVEL = HIGHER
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude $(BUILDDIR)/common/Defs.gmk
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Created without -z defs on linux
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntifeq ($(PLATFORM), linux)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt LDFLAGS_DEFS_OPTION =
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Files
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntinclude FILES_c.gmk
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserAUTO_FILES_JAVA_DIRS = sun/font
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserFILES_java += java/awt/Font.java java/text/Bidi.java
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserFILES_export = \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/SunLayoutEngine.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User java/awt/Font.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User java/text/Bidi.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/FileFont.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/FileFontStrike.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/FontManager.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/GlyphList.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/NativeFont.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/StrikeCache.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/NullFontScaler.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/FreetypeFontScaler.java \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User sun/java2d/loops/DrawGlyphList.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/java2d/loops/DrawGlyphListAA.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/java2d/loops/DrawGlyphListLCD.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/java2d/loops/GraphicsPrimitive.java
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userifeq ($(PLATFORM), windows)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User LDLIBS += user32.lib gdi32.lib $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User OTHER_CFLAGS += -DCC_NOEX
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User OTHER_CXXFLAGS += -DCC_NOEX
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userelse # PLATFORM unix
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User FILES_export += \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/NativeStrike.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/NativeStrikeDisposer.java \
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User sun/font/X11TextRenderer.java \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User sun/awt/X11GraphicsEnvironment.java
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntendif # PLATFORM
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#In the non-OpenJDK mode we need to build T2K
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userifndef OPENJDK
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Usert2k:
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User $(ECHO) "lib=" $(ACTUAL_LIBRARY)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User $(MAKE) -C t2k
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userall build: t2k
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Usert2k: library
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userclean clobber::
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User $(MAKE) -C t2k clean
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userelse
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserFILES_m=mapfile-vers.openjdk
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#make sure freetype dll will be available at runtime as well as link time
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#NB: Default freetype build system uses -h linker option and
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# result .so contains hardcoded library name that is later
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# used for adding dependencies to other objects
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# (e.g. libfontmanager.so).
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# It is not obvious how to extract that hardcoded name (libfreetype.so.6)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# without overcomplicating logic here.
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# To workaround this we hardcode .6 suffix for now.
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# Note that .so.6 library will not be found by System.loadLibrary()
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# but fortunately we need to load FreeType library explicitly
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# on windows only
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#TODO: rework this to avoid hardcoding library name in the makefile
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userlibrary:: $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX):
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userifeq ($(PLATFORM), windows)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userelse
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User ifeq ($(USING_SYSTEM_FT_LIB), false)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@.6
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User endif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userendif
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#ifeq ($(PLATFORM), solaris)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# FILES_reorder += reorder-$(ARCH)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#endif
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userinclude $(BUILDDIR)/common/Mapfile-vers.gmk
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userinclude $(BUILDDIR)/common/Library.gmk
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User.PHONY: t2k build all clean clobber
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# Add to the ambient vpath to pick up files in subdirectories
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Uservpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Uservpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/layout
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Uservpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# Fontmanager is headless (independent of X/Motif)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCFLAGS += -DHEADLESS
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserCXXFLAGS += -DHEADLESS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifndef OPENJDK
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewselse
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews OTHER_LDLIBS += $(FREETYPE_LIB)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifeq ($(PLATFORM), windows)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsvpath %.cpp $(PLATFORM_SRC)/native/sun/windows
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewselse # PLATFORM
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# Libraries to link, and other C flags.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifeq ($(PLATFORM), solaris)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt # Note that on Solaris, fontmanager is built against the headless library.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/headless
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews OTHER_LDLIBS += -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -lc $(LIBM) $(LIBCXX)
else # PLATFORM is linux
OTHER_LDLIBS += -lawt $(LIBM) $(LIBCXX)
ifeq ("$(CC_VER_MAJOR)", "3")
OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
endif
endif
endif # PLATFORM
# set up compile flags..
CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR) \
-I$(SHARE_SRC)/native/$(PKGDIR)/layout \
-I$(SHARE_SRC)/native/sun/awt/image/cvutils \
-I$(PLATFORM_SRC)/native/sun/awt \
-I$(SHARE_SRC)/native/sun/awt/debug \
-I$(SHARE_SRC)/native/sun/java2d/loops \
-I$(SHARE_SRC)/native/sun/java2d/pipe \
-I$(PLATFORM_SRC)/native/sun/java2d \
-I$(SHARE_SRC)/native/sun/java2d \
-I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
ifeq ($(PLATFORM), windows)
CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows
endif
# Make the Layout Engine build standalone
CPPFLAGS += -DLE_STANDALONE