
FT2SOURCEDIR = $(TOP)/extras/freetype2/src
FT2INCDIR = $(TOP)/extras/freetype2/include

FT2INCS =  -I$(FT2INCDIR) \
           -I$(FT2SOURCEDIR)/base \
           -I$(FT2SOURCEDIR)/gzip \
           -I$(FT2SOURCEDIR)/raster \
           -I$(FT2SOURCEDIR)/sfnt \
           -I$(FT2SOURCEDIR)/truetype \
           -I$(FT2SOURCEDIR)/cff \
           -I$(FT2SOURCEDIR)/type1 \
           -I$(FT2SOURCEDIR)/type42 \
           -I$(FT2SOURCEDIR)/psaux \
           -I$(FT2SOURCEDIR)/psnames \
           -I$(FT2SOURCEDIR)/pshinter \
           -I$(FT2SOURCEDIR)/autohint \
           -I$(FT2SOURCEDIR)/bdf \
           -I$(FT2SOURCEDIR)/pcf


/*
 * The variable `HasUsableFileMmap' should be set to YES if mmap(2) can
 * reliably be used to access regular files.  This should be done in
 * the platform-specific `*.cf' files.
 *
 * mmap(2) use is optional in FreeType, so no harm is done if we miss
 * a few architectures.
 */
#if HasUsableFileMmap
MMAPDEFINES = -DHAVE_MMAP=1 -DHAVE_FCNTL_H=1
LinkFile(ftsystem_unix.c, $(FT2SOURCEDIR)/../builds/unix/ftsystem.c)
FTSYSTEM_SRC = ftsystem_unix.c
FTSYSTEM_OBJ = ftsystem_unix.o
#else
FTSYSTEM_SRC = ftsystem_ansi.c
FTSYSTEM_OBJ = ftsystem_ansi.o
#endif

DEFINES = ServerExtraDefines StrcasecmpDefines $(MMAPDEFINES)

FT2SRCS = ftbase.c ftbbox.c ftinit.c ftglyph.c $(FTSYSTEM_SRC) fttype1.c \
          ftxf86.c ftgzip.c raster.c sfnt.c truetype.c cff.c type1.c \
          psaux.c psnames.c pshinter.c  autohint.c \
          ftbdf.c bdf.c pcf.c

FT2OBJS = ftbase.o ftbbox.o ftinit.o ftglyph.o $(FTSYSTEM_OBJ) fttype1.o \
          ftxf86.o  ftgzip.o raster.o sfnt.o truetype.o cff.o type1.o \
          psaux.o psnames.o pshinter.o autohint.o \
          ftbdf.o bdf.o pcf.o

INCLUDES = -I. -I$(FONTINCSRC) -I../include -I$(XINCLUDESRC) \
           -I$(SERVERSRC)/include $(FT2INCS) -I$(INCLUDESRC)

SRCS = xttcap.c ftfuncs.c ftenc.c fttools.c $(FT2SRCS)
OBJS = xttcap.o ftfuncs.o ftenc.o fttools.o $(FT2OBJS)

LinkSourceFile(ftbase.c,$(FT2SOURCEDIR)/base)
LinkSourceFile(ftbbox.c,$(FT2SOURCEDIR)/base)
LinkSourceFile(ftinit.c,$(FT2SOURCEDIR)/base)
LinkSourceFile(ftglyph.c,$(FT2SOURCEDIR)/base)
/* LinkSourceFile(ftsystem.c,$(FT2SOURCEDIR)/base) */
LinkSourceFile(ftutil.c,$(FT2SOURCEDIR)/base)
LinkSourceFile(fttype1.c,$(FT2SOURCEDIR)/base)
LinkSourceFile(ftxf86.c,$(FT2SOURCEDIR)/base)
LinkSourceFile(ftgzip.c,$(FT2SOURCEDIR)/gzip)
LinkSourceFile(raster.c,$(FT2SOURCEDIR)/raster)
LinkSourceFile(sfnt.c,$(FT2SOURCEDIR)/sfnt)
LinkSourceFile(truetype.c,$(FT2SOURCEDIR)/truetype)
LinkSourceFile(cff.c,$(FT2SOURCEDIR)/cff)
LinkSourceFile(type1.c,$(FT2SOURCEDIR)/type1)
LinkSourceFile(psaux.c,$(FT2SOURCEDIR)/psaux)
LinkSourceFile(psnames.c,$(FT2SOURCEDIR)/psnames)
LinkSourceFile(pshinter.c,$(FT2SOURCEDIR)/pshinter)
LinkSourceFile(autohint.c,$(FT2SOURCEDIR)/autohint)
LinkSourceFile(ftbdf.c,$(FT2SOURCEDIR)/base)
LinkSourceFile(bdf.c,$(FT2SOURCEDIR)/bdf)
LinkSourceFile(pcf.c,$(FT2SOURCEDIR)/pcf)

SubdirLibraryRule($(OBJS))
NormalLibraryObjectRule()
NormalLintTarget($(SRCS))

DependTarget()

