jdk/make/sun/font/Makefile
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 550 e85f91b9bb95
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Makefile for building all of font tools
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
BUILDDIR = ../..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
PACKAGE = sun.font
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
LIBRARY = fontmanager
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
PRODUCT = sun
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
# Indicate we want the C++ compiler to do the linking.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
CPLUSPLUSLIBRARY=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
include $(BUILDDIR)/common/Defs.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# Created without -z defs on linux
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
ifeq ($(PLATFORM), linux)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  LDFLAGS_DEFS_OPTION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
# Files
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
# Use higher optimization level
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
_OPT = $(CC_HIGHER_OPT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
include FILES_c.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
AUTO_FILES_JAVA_DIRS = sun/font
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
FILES_java += java/awt/Font.java java/text/Bidi.java 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
FILES_export = \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    sun/font/SunLayoutEngine.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    java/awt/Font.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    java/text/Bidi.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    sun/font/FileFont.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    sun/font/FontManager.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    sun/font/GlyphList.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    sun/font/NativeFont.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    sun/font/StrikeCache.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    sun/font/NullFontScaler.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    sun/font/FreetypeFontScaler.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    sun/java2d/loops/DrawGlyphList.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    sun/java2d/loops/DrawGlyphListAA.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    sun/java2d/loops/DrawGlyphListLCD.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    sun/java2d/loops/GraphicsPrimitive.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
  # Files built here do not compile with warning level 3 if warnings are fatal
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
  COMPILER_WARNINGS_FATAL=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
  LDLIBS += user32.lib gdi32.lib $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
  OTHER_CFLAGS += -DCC_NOEX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
  OTHER_CXXFLAGS += -DCC_NOEX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
  FILES_export += sun/java2d/d3d/D3DTextRenderer.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
else # PLATFORM unix
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
  FILES_export += \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    sun/font/NativeStrike.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    sun/font/NativeStrikeDisposer.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    sun/font/X11TextRenderer.java \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    sun/awt/X11GraphicsEnvironment.java 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
#In the non-OpenJDK mode we need to build T2K
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
ifndef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
t2k:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
	$(ECHO) "lib=" $(ACTUAL_LIBRARY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
	$(MAKE) -C t2k
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
all build: t2k
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
t2k: library
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
clean clobber::
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
	$(MAKE) -C t2k clean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
FILES_m=mapfile-vers.openjdk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
#make sure freetype dll will be available at runtime as well as link time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
#NB: Default freetype build system uses -h linker option and 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
#   result .so contains hardcoded library name that is later 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#   used for adding dependencies to other objects 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#   (e.g. libfontmanager.so).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
#   
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
#   It is not obvious how to extract that hardcoded name (libfreetype.so.6)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#   without overcomplicating logic here.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
#   To workaround this we hardcode .6 suffix for now.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#   Note that .so.6 library will not be found by System.loadLibrary()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
#        but fortunately we need to load FreeType library explicitly 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#        on windows only  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#TODO: rework this to avoid hardcoding library name in the makefile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
library:: $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
$(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX):
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
	$(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
else 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
  ifeq ($(USING_SYSTEM_FT_LIB), false)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
	$(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
endif 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
#ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
#  FILES_reorder += reorder-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
include $(BUILDDIR)/common/Mapfile-vers.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
include $(BUILDDIR)/common/Library.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
.PHONY: t2k build all clean clobber
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
# Add to the ambient vpath to pick up files in subdirectories
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
vpath %.c   $(PLATFORM_SRC)/native/$(PKGDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/bidi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
vpath %.cpp   $(SHARE_SRC)/native/$(PKGDIR)/layout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
vpath %.cpp   $(SHARE_SRC)/native/$(PKGDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
# Fontmanager is headless (independent of X/Motif)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
CFLAGS       += -DHEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
CXXFLAGS     += -DHEADLESS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
ifndef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
  CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
  CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
  OTHER_LDLIBS += $(FREETYPE_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
vpath %.cpp   $(PLATFORM_SRC)/native/sun/windows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
vpath %.cpp   $(PLATFORM_SRC)/native/sun/java2d/d3d
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
else # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
# Libraries to link, and other C flags.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
  # Note that on Solaris, fontmanager is built against the headless library.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
  LDFLAGS      += -L$(LIBDIR)/$(LIBARCH)/headless
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
  OTHER_LDLIBS += -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -lc $(LIBM) $(LIBCXX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
else # PLATFORM is linux
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 OTHER_LDLIBS  += -lawt $(LIBM) $(LIBCXX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
  ifeq ("$(CC_VER_MAJOR)", "3")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
  endif                           
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
# set up compile flags..
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            -I$(SHARE_SRC)/native/$(PKGDIR)/layout \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            -I$(SHARE_SRC)/native/$(PKGDIR)/bidi \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
	    -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
	    -I$(PLATFORM_SRC)/native/sun/awt \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
	    -I$(SHARE_SRC)/native/sun/awt/debug \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
	    -I$(SHARE_SRC)/native/sun/java2d/loops \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
	    -I$(SHARE_SRC)/native/sun/java2d/pipe \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            -I$(PLATFORM_SRC)/native/sun/java2d \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
	    -I$(SHARE_SRC)/native/sun/java2d \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
	    -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
	    -I$(PLATFORM_SRC)/native/sun/java2d/d3d
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211