Files
packages/utils/fontconfig/Makefile
T
Alexandru Ardelean d7b891ddd0 fontconfig: fix build with SDK producing -dD style output
Some SDK/host GCC configurations, when meson invokes cc.preprocess() to
expand fcobjshash.gperf.h, produce output that includes predefined macro
dumps (e.g. #define __STDC__ 1) alongside linemarker lines. The upstream
cutout.py script, which strips CUT_OUT_BEGIN/END-delimited sections from
the preprocessed output before feeding it to gperf, passes these lines
through verbatim into fcobjshash.gperf.

gperf then copies them into the declarations section of fcobjshash.h.
When fcobjs.c includes fcobjshash.h, the compiler encounters #define
redefinitions and stray # tokens, causing a build failure.

Fix cutout.py to skip any line starting with # (C preprocessor
linemarkers and predefined macro definitions) before writing to the
output gperf file.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-05-13 07:27:14 +03:00

66 lines
1.9 KiB
Makefile

#
# Copyright (C) 2008-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=fontconfig
PKG_VERSION:=2.16.0
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.freedesktop.org/software/fontconfig/release/
PKG_HASH:=6a33dc555cc9ba8b10caf7695878ef134eeb36d0af366041f639b1da9b6ed220
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_LICENSE:=
PKG_LICENSE_FILES:=
PKG_CPE_ID:=cpe:/a:fontconfig_project:fontconfig
PKG_BUILD_DEPENDS:=gperf/host
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/meson.mk
define Package/fontconfig
SECTION:=xorg-util
CATEGORY:=Xorg
SUBMENU:=Font-Utils
TITLE:=fontconfig
DEPENDS:=+libpthread +libexpat +libfreetype
URL:=https://www.freedesktop.org/wiki/Software/fontconfig/
endef
MESON_ARGS += \
-Ddoc=disabled \
-Ddoc-txt=disabled \
-Dnls=disabled \
-Dtests=disabled \
-Dtools=enabled
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/fontconfig $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfontconfig.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fontconfig.pc $(1)/usr/lib/pkgconfig/
endef
define Package/fontconfig/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/share/fontconfig/conf.avail
$(INSTALL_DIR) $(1)/etc/fonts/conf.d
$(CP) $(PKG_INSTALL_DIR)/etc/fonts/fonts.conf $(1)/etc/fonts
$(CP) $(PKG_INSTALL_DIR)/etc/fonts/conf.d/* $(1)/etc/fonts/conf.d
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/share/fontconfig/conf.avail/* $(1)/usr/share/fontconfig/conf.avail
$(INSTALL_DIR) $(1)/etc/init.d
# $(INSTALL_BIN) ./files/fontconfig.init $(1)/etc/init.d/fontconfig
endef
$(eval $(call BuildPackage,fontconfig))