#
# @(#)GNUmakefile	1.23 99/02/11
#
# Makefile for building all of font tools
#

BUILDDIR = ../..
include $(BUILDDIR)/Platform.gmk
PACKAGE = sun.awt.font
LIBRARY = fontmanager
PRODUCT = sun

#
# Hack fix for mixed C and C++ library.  You can't link this lib with
# CC because not all the names mangle correctly (FIX ME!)  We can't
# link this with the regular cc because that adds -YP to the link
# line, and then it can't find the C++ lib (-lC).  So we use the C
# linker without the -YP.
#
CPLUSPLUSLIBRARY = true
MIXEDCPLUSPLUSLIBRARY = true

include $(BUILDDIR)/makefiles/Defs.gmk

#
# Files
#
include $(MINCLUDES)sun_fontmanager.cmk
include $(MINCLUDES)sun_fontmanager.jmk

FILES_export = \
    sun/awt/font/NativeFontWrapper.java \
	java/awt/Font.java \
    sun/awt/X11GraphicsEnvironment.java \
	sun/java2d/loops/GraphicsPrimitive.java 

include $(BUILDDIR)/makefiles/Library.gmk

#
# Add to the ambient vpath to pick up files in subdirectories
#
vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/fontmanager/fontobjects
vpath %.c   $(SHARE_SRC)/native/$(PKGDIR)/t2k
vpath %.c   $(PLATFORM_SRC)/native/$(PKGDIR)
vpath %.cpp   $(SHARE_SRC)/native/$(PKGDIR)/fontmanager/fontobjects
vpath %.cpp   $(SHARE_SRC)/native/$(PKGDIR)/fontmanager/textcache
vpath %.cpp   $(SHARE_SRC)/native/$(PKGDIR)
vpath %.cpp   $(PLATFORM_SRC)/native/$(PKGDIR)

#
# Libraries to link, and other C flags.
#
ifeq ($(CC_VERSION),gcc)
CFLAGS       += -fPIC
CXXFLAGS     += -fPIC
else
CFLAGS	     += -xCC -KPIC
CXXFLAGS     += -noex -KPIC
LIBCXX	      = -lC
endif

# If your platform has DPS, it will have Type1 fonts too, in which case
# it is best to enable DPS support until such time as 2D's rasteriser
# can fully handle Type1 fonts in all cases. Default is "yes".
# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
HAVE_DPS = yes
#HAVE_DPS = no
ifeq ($(HAVE_DPS),yes)
CFLAGS   += -DHAVE_DPS
CXXFLAGS += -DHAVE_DPS
endif

CXXFLAGS     += -DCC_NOEX
LDFLAGS      += -L$(OPENWINHOME)/lib -R$(OPENWINHOME)/lib
ifeq ($(HAVE_DPS),yes)
OTHER_LDLIBS  = -lawt$(SUFFIX) -lm $(LIBCXX) -ldps -lX11
else
OTHER_LDLIBS  = -lawt$(SUFFIX) -lm $(LIBCXX) -lX11
endif

CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR) \
            -I$(SHARE_SRC)/native/$(PKGDIR)/fontmanager/include \
            -I$(SHARE_SRC)/native/$(PKGDIR)/t2k \
	    -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
	    -I$(PLATFORM_SRC)/native/sun/awt \
	    -I$(SHARE_SRC)/native/sun/java2d/loops \
	    -I$(OPENWINHOME)/include \
	    -I$(OPENWINHOME)/include/X11 \
	    -DOPENWINHOME="\"$(OPENWINHOME)\""
#
# Has been converted to the JNI: generate JNI-style header files
#
JAVAHFLAGS += -jni
