build fix: use 'xft-config' instead of 'pkg-config' to use the right libs

when linking with binutils-gold and --no-add-needed it is not enough to
just use -lXft but it must be -lXft -fontconfig (and some more). since we
use 'pkg-config --libs' to find out about the needed flags and 'pkg-config'
only returns -lXft (except by using

   pkg-config --libs `pkg-config --print-requires-private xft`

) we switched to 'xft-config --libs' which gives us the complete list of
all needed libs.

the issue was brought to attention by

   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=554386

but the proposed fix was just quick and dirty.
This commit is contained in:
Mathias Gumz 2011-01-23 21:45:19 +01:00
parent e868ff5928
commit e38994ae72

View file

@ -170,24 +170,24 @@ AC_DEFUN([AM_PATH_XFT2],
[ [
if test x$pkg_exec_prefix != x ; then if test x$pkg_exec_prefix != x ; then
xft_args="$xft_args --exec-prefix=$pkg_exec_prefix" xft_args="$xft_args --exec-prefix=$pkg_exec_prefix"
if test x${PKG_CONFIG+set} != xset ; then if test x${XFT_CONFIG+set} != xset ; then
PKG_CONFIG=$pkg_exec_prefix/bin/pkg-config XFT_CONFIG=$pkg_exec_prefix/bin/xft-config
fi fi
fi fi
if test x$xft_prefix != x ; then if test x$xft_prefix != x ; then
xft_args="$xft_args --prefix=$xft_prefix" xft_args="$xft_args --prefix=$xft_prefix"
if test x${PKG_CONFIG+set} != xset ; then if test x${XFT_CONFIG+set} != xset ; then
PKG_CONFIG=$xft_prefix/bin/pkg-config XFT_CONFIG=$xft_prefix/bin/xft-config
fi fi
fi fi
AC_PATH_PROG(PKG_CONFIG, pkg-config, no) AC_PATH_PROG(XFT_CONFIG, xft-config, no)
if test "x$PKG_CONFIG" = "xno" ; then if test "x$XFT_CONFIG" = "xno" ; then
ifelse([$2], , :, [$2]) ifelse([$2], , :, [$2])
else else
XFT_CFLAGS=`$PKG_CONFIG $xftconf_args --cflags xft` XFT_CFLAGS=`$XFT_CONFIG $xftconf_args --cflags`
XFT_LIBS=`$PKG_CONFIG $xftconf_args --libs xft` XFT_LIBS=`$XFT_CONFIG $xftconf_args --libs`
ifelse([$1], , :, [$1]) ifelse([$1], , :, [$1])
fi fi
@ -230,4 +230,4 @@ CFLAGS="$CFLAGS $XFT_CFLAGS"
CXXFLAGS="$CXXFLAGS $XFT_CFLAGS" CXXFLAGS="$CXXFLAGS $XFT_CFLAGS"
LIBS="$LIBS $XFT_LIBS" LIBS="$LIBS $XFT_LIBS"
]) ]