Compiling glib on CentOS

Do you get this error message while compiling glib on CentOS ?

checking for LIBFFI... no
configure: error: Package requirements (libffi >= 3.0.0) were not met:

No package 'libffi' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

First, let’s check if libffi is installed:

[laurent@new-host]/usr/lib/pkgconfig> rpm -qa | grep libffi
libffi-3.0.5-3.2.el6.i686

[laurent@new-host]/> sudo find . -name *libffi*
./usr/share/doc/libffi-3.0.5
./usr/lib/libffi.so.5
./usr/lib/libffi.so.5.0.6
./var/lib/yum/yumdb/l/61825035e703e1d6d36e2c2f67e195b58eaf7475-libffi-3.0.5-3.2.el6-i686

OK, it is installed, so this certainly means that pkg-config doesn’t know about it. For more information concerning pkg-config, check this link.

 

[laurent@new-host]/usr/lib/pkgconfig> pkg-config --print-errors libffi
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found

OK: why am I missing the /usr/lib/pkgconfig/libffi.pc file ?

That’s because it’s part of the ‘libffi-devel’ package that is not installed by default !

Install it using yum and you’ll get everything you need:

[laurent@new-host]/usr/lib/pkgconfig> rpm -ql libffi-devel-3.0.5-3.2.el6.i686
/usr/lib/libffi-3.0.5
/usr/lib/libffi-3.0.5/include
/usr/lib/libffi-3.0.5/include/ffi.h
/usr/lib/libffi-3.0.5/include/ffitarget.h
/usr/lib/libffi.so
/usr/lib/pkgconfig/libffi.pc
/usr/share/info/libffi.info.gz
/usr/share/man/man3/ffi.3.gz
/usr/share/man/man3/ffi_call.3.gz
/usr/share/man/man3/ffi_prep_cif.3.gz

Laurent KUBASKI

Advertisements