[FFmpeg-user] How to build static fontconfig with ffmpeg?

qw applemax82 at 163.com
Tue Jul 17 16:20:54 EEST 2018


Hi,


My environment is Centos 7.4.


I want to build static fontconfig and build ffmpeg with static fontconfig. I succeed in building static libpng/freetype2/harfbuzz/vidstab/fribidi/expat, but I fail to build static fontconfig. The following is my building steps:


1) build libpng-1.6.34.tar.gz
./autogen.sh
./configure --disable-shared --enable-static
make && make install


2) build freetype-2.9.1.tar.bz2
./configure --disable-shared --enable-static --with-png=no --with-harfbuzz=no
make && make install


3) build harfbuzz-1.7.6.tar.bz2
./configure --prefix=/usr/local/ --disable-shared --enable-static --with-freetype=yes
make && make install


4) rebuild freetype2
make clean && make distclean
./configure --disable-shared --enable-static --with-png=yes --with-harfbuzz=yes
make && make install


5) build georgmartius-vid.stab-v1.1.0-0-g60d65da.tar.gz
cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=0
make && make install


6) build fribidi-1.0.1.tar.gz
./bootstrap
./configure --disable-shared --enable-static
make && make install


7) build expat-2.2.5.tar.bz2
./configure --disable-shared --enable-static
make && make install


8) build fontconfig-2.13.0.tar.bz2
./configure --disable-shared --enable-static
make


Then, make reports error messages as below:
/usr/local/lib/libfreetype.a(sfnt.o): In function `Load_SBit_Png':
sfnt.c:(.text+0x3c49): undefined reference to `png_create_read_struct'
sfnt.c:(.text+0x3c63): undefined reference to `png_create_info_struct'
sfnt.c:(.text+0x3c8b): undefined reference to `png_set_longjmp_fn'
sfnt.c:(.text+0x3cb6): undefined reference to `png_destroy_read_struct'
sfnt.c:(.text+0x3d06): undefined reference to `png_set_read_fn'
sfnt.c:(.text+0x3d1b): undefined reference to `png_read_info'


or use another configure command : ./configure --disable-shared --enable-static LDFLAGS="-L/usr/local/lib" LIBS="-lharfbuzz -lfreetype -lpng"
Then, make reports error messages as below:
/usr/local/lib/libfreetype.a(autofit.o): In function `af_face_globals_free':
autofit.c:(.text+0x2d52): undefined reference to `hb_font_destroy'
autofit.c:(.text+0x2d5b): undefined reference to `hb_buffer_destroy'
/usr/local/lib/libfreetype.a(autofit.o): In function `af_shaper_get_coverage':
autofit.c:(.text+0x7544): undefined reference to `hb_font_get_face'
autofit.c:(.text+0x756d): undefined reference to `hb_ot_tags_from_script'
autofit.c:(.text+0x759e): undefined reference to `hb_set_create'
autofit.c:(.text+0x75bb): undefined reference to `hb_ot_layout_collect_lookups'
autofit.c:(.text+0x75c3): undefined reference to `hb_set_is_empty'
autofit.c:(.text+0x75ee): undefined reference to `hb_set_destroy'
autofit.c:(.text+0x75f8): undefined reference to `hb_set_destroy'
autofit.c:(.text+0x7602): undefined reference to `hb_set_destroy'


How to build static fontconfig?


Thanks!


Regards


Andrew



More information about the ffmpeg-user mailing list