# # fontconfig # kBuild makefile # SUB_DEPTH = .. include $(KBUILD_PATH)/subheader.kmk LIBRARIES += fontconfig fontconfig_TOOL = GCC3OMF fontconfig_DEFS = HAVE_FT_GET_NEXT_CHAR fontconfig_INCS = $(PATH_ROOT)/include fontconfig_CFLAGS = $(shell pkg-config --cflags freetype2) fontconfig_SOURCES = \ fccharset.c \ fontconfig.c \ fcpat.c \ fclang.c \ fcname.c \ fcstr.c \ fcdbg.c \ fcweight.c \ fcrange.c \ fcserialize.c \ fcobjs.c \ fcmatrix.c \ fcdefault.c \ fcfs.c \ fcfreetype.c \ fcblanks.c \ fclist.c \ ftglue.c \ fcmatch.c DLLS += fontconfig_dll # TODO: The DLL should be renamed to match `fntcnfNN` format upon # the next incompatible upstream ABI change fontconfig_dll_TOOL = GCC3OMF fontconfig_dll_NAME = fntcfg2 fontconfig_dll_LIBS = $(fontconfig_1_TARGET) fontconfig_dll_LDFLAGS = $(shell pkg-config --libs freetype2) # If either CFLAGS or LDFLAGS are set, assume that they configure the build flavor # (like in case of the RPM build), otherwise set the flavor ourselves. ifneq ($(strip $(CFLAGS)$(LDFLAGS)),) fontconfig_CFLAGS += $(CFLAGS) fontconfig_dll_LDFLAGS += $(LDFLAGS) else fontconfig_CFLAGS.release += -s -march=pentium -mtune=pentium4 fontconfig_CFLAGS.debug += -g -O0 -DDEBUG fontconfig_dll_LDFLAGS.release += -s fontconfig_dll_LDFLAGS.debug += -g endif # Generate DLL exports from all APIs in public headers # (regexp borrowed from upstream's src/Makefile.am). # # NOTE: As we lack many functions now, the list is filtered with what emxexp returns # (i.e. only actual exports we have). Once we have everything, this second filter # should be removed ($(FONTCONFIG_DEF).tmp and friends). fontconfig_dll_SOURCES += $(FONTCONFIG_DEF) FONTCONFIG_DEF = $(PATH_OBJ)/fntcfg2.def FONTCONFIG_DEF_IN = $(PATH_ROOT)/fntcfg2.def.in FONTCONFIG_PUBLIC_API = $(PATH_ROOT)/include/fontconfig/*.h OTHER_CLEAN += $(FONTCONFIG_DEF) $(FONTCONFIG_DEF).tmp $(FONTCONFIG_DEF): $(FONTCONFIG_PUBLIC_API) $(FONTCONFIG_DEF_IN) $(FONTCONFIG_DEF).tmp $(call MSG_L1,Generating $@) $(QUIET)cat $(FONTCONFIG_DEF_IN) > $@ $(QUIET)cat $(FONTCONFIG_PUBLIC_API) | $(GREP) '^Fc[^ ]* *(' | $(SED) -e 's/ *(.*$$//' -e 's/^/ _/' | \ $(GREP) -Fw -f $(FONTCONFIG_DEF).tmp | $(SORT) >>$@ $(QUIET)grep -q _FcInit $@ # check that we got some exports # @todo grep 2.10-2 doesn't understand \r on -f input, so cut it for now $(FONTCONFIG_DEF).tmp: $$(fontconfig_1_TARGET) $(QUIET)emxexp $^ | $(SED) -ne 's/^ *"\(_Fc[^ ]*\)".*/\1/p' | tr -d '\r' >$@ $(QUIET)grep -q _FcInit $@ $(QUIET)grep -q _FcInit $@ # check that we got some exports INSTALLS += fontconfig_headers fontconfig_dll_lib fontconfig_pc # Install public headers. fontconfig_headers_INST = $(INST_INCLUDE)fontconfig/ fontconfig_headers_DIRS = . fontconfig_headers_SOURCES = \ $(wildcard $(PATH_ROOT)/include/fontconfig/*.h) # Install the import library with the special name to match ld selection rules. fontconfig_dll_lib_INST = $(INST_LIB) fontconfig_dll_lib_SOURCES = $(PATH_STAGE_LIB)/$(fontconfig_dll_NAME).lib=>fontconfig_dll.lib # Generate/install pkgconfig file fontconfig_pc_INST = $(INST_PKGCONFIG) fontconfig_pc_DIRS = . fontconfig_pc_SOURCES = $(PATH_OBJ)/fontconfig.pc OTHER_CLEAN += $(fontconfig_pc_SOURCES) $(fontconfig_pc_SOURCES): $(PATH_ROOT)/fontconfig.pc.in $(call MSG_L1,Generating $@) $(QUIET)$(SED) "s;@VERSION@;$(VERSION);g;" $< \ | $(SED) "s;@prefix@;$(INST_PREFIX);g;" \ > $@ include $(FILE_KBUILD_SUB_FOOTER)