OpenWrt Forum Archive

Topic: compile libgd/libpng with freetype support: freetype-config not found

The content of this topic has been archived on 1 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

In BB r40502, it was possible to compile libgd with freetype support (needed for text-overlays in fswebcam), by changing the libgd Makefile :

add +libfreetype to the DEPENDS line
chg –without-freetype \ to –with-freetype=$(STAGING_DIR)/usr \

Today I tried the same with r43601, which ended with this error:

checking libpng-config script... /home/tmomas/openwrt/14.07/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/bin/libpng-config, cflags: -I/home/tmomas/openwrt/14.07/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include/libpng12, libs: -L/home/tmomas/openwrt/14.07/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -lpng12
configure: error: freetype support requested, but not found: /home/tmomas/openwrt/14.07/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/bin/freetype-config
make[3]: *** [/home/tmomas/openwrt/14.07/build_dir/target-mips_34kc_uClibc-0.9.33.2/libgd-2.1.0/.configured_] Error 1
make[3]: Leaving directory `/home/tmomas/openwrt/14.07/feeds/packages/libs/libgd'
make[2]: *** [package/feeds/packages/libgd/compile] Error 2
make[2]: Leaving directory `/home/tmomas/openwrt/14.07'
make[1]: *** [/home/tmomas/openwrt/14.07/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/tmomas/openwrt/14.07'
make: *** [world] Error 2

Indeed, there's no staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/bin/freetype-config, however, I found these:

find /home/tmomas/openwrt/ -name *freetype-config*
/home/tmomas/openwrt/14.07/build_dir/target-mips_34kc_uClibc-0.9.33.2/freetype-2.4.8/builds/unix/freetype-config
/home/tmomas/openwrt/14.07/build_dir/target-mips_34kc_uClibc-0.9.33.2/freetype-2.4.8/builds/unix/freetype-config.in
/home/tmomas/openwrt/14.07/build_dir/target-mips_34kc_uClibc-0.9.33.2/freetype-2.4.8/ipkg-install/usr/bin/freetype-config
/home/tmomas/openwrt/14.07/staging_dir/target-mips_34kc_uClibc-0.9.33.2/host/bin/freetype-config

The last one in staging_dir comes closest to what is required by libpng, but it hast "host" in it's path instead of "usr".

How do I tell libgd / libpng that the freetype-config is in /host/bin/freetype-config instead of /usr/bin/freetype-config?

@tmo26, I know my response is way too late for you to be useful, but perhaps it may be useful for others who bump into the same problem. The comments below are applicable to OpenWRT Designated Driver r48456.

To enable freetype support in gd, in Makefile:

1. change --without-freetype to --with-freetype=$(STAGING_DIR)/host

2. if you are building PHP5 with GD support, add +PACKAGE_php5-mod-gd:libfreetype to GD's BuildModule line in Makefile (circa line 542) so that it becomes:
$(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php5-mod-gd:libjpeg +PACKAGE_php5-mod-gd:libpng +PACKAGE_php5-mod-gd:libfreetype))

The discussion might have continued from here.