Xft-2 configure.in patch
John Eckerdal
john at hl.lu.se
Wed Oct 30 10:04:46 EST 2002
This patch adds support for Xft-2 during configure time. Works for me(tm).
Note that I can not test if this breaks compilation where earlier versions
of Xft is used. I do not fully understand how configure is supposed to
work internally so I may very well have missed something.
It is against the current cvs.
I did not write this stuff. This is a bad merge of what I found in the
waima configure.in - I do not use waima, never had. It just popped up
on freshmeat when searching for Xft (I was looking for the Xft homepage).
Note that pkg-config is used to determine where Xft is placed. I think
that pkg-config is mandatory for the new Xft but I am not sure. If I
read the stuff correct it should still check for older/other versions
using another way.
--
John Eckerdal the Assembly Gems page
http://www.df.lth.se/~john_e
-------------- next part --------------
? autom4te-2.53.cache
? yourchanges.patch
Index: configure.in
===================================================================
RCS file: /cvs/cvsroot/openbox/configure.in,v
retrieving revision 1.38
diff -p -u -r1.38 configure.in
--- configure.in 2002/10/19 07:20:36 1.38
+++ configure.in 2002/10/30 15:00:12
@@ -143,30 +143,72 @@ AC_ARG_ENABLE(
xft, [ --enable-xft enable support of the Xft extension [default=yes]])
: ${enableval="yes"}
if test "$enableval" = "yes"; then
- AC_MSG_RESULT([yes])
+ AC_MSG_RESULT([yes])
+ xftsucceeded=no
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ if test "x$PKG_CONFIG" != "xno" ; then
+ AC_MSG_CHECKING(for Xft)
+ if $PKG_CONFIG --exists "xft" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING(XFT_CFLAGS)
+ Xft_flags=`$PKG_CONFIG --cflags "xft"`
+ AC_MSG_RESULT($Xft_flags)
+ AC_MSG_CHECKING(XFT_LIBS)
+ Xft_lib=`$PKG_CONFIG --libs "xft"`
+ AC_MSG_RESULT($Xft_lib)
+ xftsucceeded=yes
+ use_xft="yes"
+ XFT="-DXFT"
+ CPPFLAGS="$CPPFLAGS $Xft_flags"
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
- AC_CHECK_LIB(Xft, XftFontOpenXlfd,
- AC_MSG_CHECKING([for X11/Xft/Xft.h])
- AC_TRY_LINK(
-#include <X11/Xlib.h>
-#include <X11/Xft/Xft.h>
-, XftFont foo,
+ if test $xftsucceeded = no; then
+ dnl Checks for freetype/freetype.h
+ have_freetype="false"
+ AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
+ if test "x$FREETYPE_CONFIG" != "xno" ; then
+ FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
+ save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
+ fi
+ AC_MSG_CHECKING([for freetype/freetype.h])
+ AC_TRY_COMPILE(
+#include <freetype/freetype.h>
+ ,,
AC_MSG_RESULT([yes])
- XFT="yes"
- LIBS="$LIBS -lXft"
+ dnl Checks for Xft
- dnl Check for utf8 support in the Xft library
- AC_CHECK_LIB(Xft, XftDrawStringUtf8,
- XFT_UTF8="yes",
+ AC_CHECK_LIB(Xft, XftFontOpen,
+ AC_MSG_CHECKING([for X11/Xft/Xft.h])
+ AC_TRY_COMPILE(
+#include <X11/Xlib.h>
+#include <X11/Xft/Xft.h>
+ ,,
+ AC_MSG_RESULT([yes])
+ use_xft="yes"
+ XFT="-DXFT"; Xft_lib="-lXft",
+ AC_MSG_RESULT([no])
+ AC_MSG_RESULT([** WARNING: X11/Xft/Xft.h is missing])
+ AC_MSG_RESULT([** WARNING: Disabled Xft library support])
),
-
+ AC_MSG_RESULT([** WARNING: Could not find XftFontOpen in -lXft])
+ AC_MSG_RESULT([** WARNING: Disabled Xft library support]))
+ ,
AC_MSG_RESULT([no])
- )
- )
-
+ AC_MSG_RESULT([** WARNING: freetype/freetype.h is missing])
+ AC_MSG_RESULT([** WARNING: Disabled Xft library support])
+ CPPFLAGS="$save_cppflags")
+ fi
else
AC_MSG_RESULT([no])
fi
+AC_SUBST(XFT)
+
+LIBS="$LIBS $Xft_lib"
+
if test "$XFT" = "yes"; then
AC_DEFINE(XFT,1,[Enable support of the Xft extension])
if test "$XFT_UTF8" = "yes"; then
More information about the openbox
mailing list