mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Configure: Rewrite detection for Xft2 to properly use PKG_CONFIG macro
The goal is to use standard macros, which make code easier to maintain (smaller, more consistent). We still keep the legacy "xfg-config" method because we don't want to drop support for old hardware/software. A side effect is the change in the name of the variables for the makefile, but this goes in favour of consistency. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
0e274dc979
commit
0bbb122b94
@@ -8,7 +8,7 @@ noinst_PROGRAMS = fontl puzzle colorpick
|
|||||||
|
|
||||||
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
||||||
$(top_builddir)/WINGs/libWUtil.la \
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
@XFTLIBS@ @INTLIBS@ @XLIBS@
|
@XFT_LIBS@ @INTLIBS@ @XLIBS@
|
||||||
|
|
||||||
colorpick_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
|
colorpick_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs \
|
|||||||
|
|
||||||
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
||||||
$(top_builddir)/WINGs/libWUtil.la \
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
@XFTLIBS@ @INTLIBS@
|
@XFT_LIBS@ @INTLIBS@
|
||||||
|
|
||||||
test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
|
test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ lib_LTLIBRARIES = libWUtil.la libWINGs.la
|
|||||||
|
|
||||||
|
|
||||||
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@
|
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@
|
||||||
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFTLIBS@ @FCLIBS@ @LIBM@ @PANGOLIBS@
|
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFT_LIBS@ @FCLIBS@ @LIBM@ @PANGOLIBS@
|
||||||
libWUtil_la_LIBADD = @LIBBSD@
|
libWUtil_la_LIBADD = @LIBBSD@
|
||||||
|
|
||||||
EXTRA_DIST = BUGS make-rgb Examples Extras Tests
|
EXTRA_DIST = BUGS make-rgb Examples Extras Tests
|
||||||
@@ -92,7 +92,7 @@ AM_CFLAGS =
|
|||||||
AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
|
AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
|
||||||
-I$(top_srcdir)/WINGs/WINGs -I$(top_builddir)/WINGs/WINGs \
|
-I$(top_srcdir)/WINGs/WINGs -I$(top_builddir)/WINGs/WINGs \
|
||||||
-I$(top_builddir)/wrlib -I$(top_srcdir)/src \
|
-I$(top_builddir)/wrlib -I$(top_srcdir)/src \
|
||||||
@XFTFLAGS@ @HEADER_SEARCH_PATH@
|
@XFT_CFLAGS@ @HEADER_SEARCH_PATH@
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = WINGs.pc WUtil.pc
|
pkgconfig_DATA = WINGs.pc WUtil.pc
|
||||||
@@ -106,7 +106,7 @@ WINGs.pc: Makefile
|
|||||||
@echo 'Version: $(VERSION)' >> $@
|
@echo 'Version: $(VERSION)' >> $@
|
||||||
@echo 'Requires: wrlib WUtil' >> $@
|
@echo 'Requires: wrlib WUtil' >> $@
|
||||||
@echo 'Libs: $(lib_search_path) -lWINGs' >> $@
|
@echo 'Libs: $(lib_search_path) -lWINGs' >> $@
|
||||||
@echo 'Libs.private: $(XFTLIBS) $(PANGOLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
|
@echo 'Libs.private: $(XFT_LIBS) $(PANGOLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
|
||||||
@echo 'Cflags: $(inc_search_path)' >> $@
|
@echo 'Cflags: $(inc_search_path)' >> $@
|
||||||
|
|
||||||
WUtil.pc: Makefile
|
WUtil.pc: Makefile
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ noinst_PROGRAMS = wtest wmquery wmfile testmywidget
|
|||||||
|
|
||||||
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
|
||||||
$(top_builddir)/WINGs/libWUtil.la \
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
@XFTLIBS@ @INTLIBS@ @XLIBS@
|
@XFT_LIBS@ @INTLIBS@ @XLIBS@
|
||||||
|
|
||||||
|
|
||||||
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
|
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
|
||||||
@@ -17,4 +17,4 @@ wtest_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
|
|||||||
EXTRA_DIST = logo.xpm upbtn.xpm wm.html wm.png
|
EXTRA_DIST = logo.xpm upbtn.xpm wm.html wm.png
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
|
AM_CPPFLAGS = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
|
||||||
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@
|
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFT_CFLAGS@ @HEADER_SEARCH_PATH@
|
||||||
|
|||||||
62
configure.ac
62
configure.ac
@@ -615,51 +615,24 @@ AC_SUBST(FCLIBS)
|
|||||||
|
|
||||||
dnl Xft2 antialiased font support
|
dnl Xft2 antialiased font support
|
||||||
dnl =============================
|
dnl =============================
|
||||||
|
m4_define([XFT_MIN_VERSION], [2.1.0])
|
||||||
|
PKG_CHECK_MODULES([XFT], [xft >= ]XFT_MIN_VERSION,
|
||||||
|
[], dnl Module found, nothing to do
|
||||||
|
[XFT_CFLAGS=failed])
|
||||||
|
AS_IF([test "x$XFT_CFLAGS" = "xfailed"],
|
||||||
|
[dnl pkg-config did not find it, try the legacy method
|
||||||
|
AC_CHECK_PROG([XFTCONFIG], [xft-config], [xft-config])
|
||||||
|
AS_IF([test -z "$XFTCONFIG"],
|
||||||
|
[AC_MSG_ERROR([libXft2 is not installed, is too old or could not be found -- $XFT_PKG_ERRORS]) ])
|
||||||
|
XFT_LIBS=`$XFTCONFIG --libs`
|
||||||
|
XFT_CFLAGS=`$XFTCONFIG --cflags`
|
||||||
|
WM_CHECK_XFT_VERSION(XFT_MIN_VERSION,
|
||||||
|
[], dnl Version is ok, nothing to do
|
||||||
|
[AC_MSG_ERROR([Version of libXft is too old, consider upgrading to] XFT_MIN_VERSION [or newer]) ])
|
||||||
|
])
|
||||||
|
AC_SUBST(XFT_CFLAGS)
|
||||||
|
AC_SUBST(XFT_LIBS)
|
||||||
|
|
||||||
xft=yes
|
|
||||||
XFTLIBS=""
|
|
||||||
|
|
||||||
if test "x$PKG_CONFIG" != x -a "`$PKG_CONFIG xft; echo $?`" = 0; then
|
|
||||||
XFTCONFIG="$PKG_CONFIG xft"
|
|
||||||
pkgconfig_xft=yes
|
|
||||||
else
|
|
||||||
AC_CHECK_PROG(XFTCONFIG, xft-config, xft-config)
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for the Xft2 library])
|
|
||||||
|
|
||||||
if test "x$XFTCONFIG" != x; then
|
|
||||||
XFTLIBS=`$XFTCONFIG --libs`
|
|
||||||
XFTFLAGS=`$XFTCONFIG --cflags`
|
|
||||||
AC_MSG_RESULT([found])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([not found])
|
|
||||||
echo
|
|
||||||
echo "ERROR!!! libXft2 is not installed or could not be found."
|
|
||||||
echo " Xft2 is a requirement for building Window Maker."
|
|
||||||
echo " Please install it (along with fontconfig) before continuing."
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
minXFT="2.1.0"
|
|
||||||
goodxft="no"
|
|
||||||
|
|
||||||
dnl
|
|
||||||
dnl The macro below will use $XFTFLAGS (defined above) to find Xft.h
|
|
||||||
dnl
|
|
||||||
WM_CHECK_XFT_VERSION($minXFT, goodxft=yes, goodxft=no)
|
|
||||||
|
|
||||||
if test "$goodxft" = no; then
|
|
||||||
echo
|
|
||||||
echo "ERROR!!! libXft on this system is an old version."
|
|
||||||
echo " Please consider upgrading to at least version ${minXFT}."
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_SUBST(XFTFLAGS)
|
|
||||||
AC_SUBST(XFTLIBS)
|
|
||||||
|
|
||||||
dnl PANGO support
|
dnl PANGO support
|
||||||
dnl =============
|
dnl =============
|
||||||
@@ -952,7 +925,6 @@ echo "Supported core features: :$supported_core"
|
|||||||
echo "Supported X extensions: :$supported_xext"
|
echo "Supported X extensions: :$supported_xext"
|
||||||
echo "Supported graphic format libraries :$supported_gfx"
|
echo "Supported graphic format libraries :$supported_gfx"
|
||||||
echo "Unsupported features :$unsupported"
|
echo "Unsupported features :$unsupported"
|
||||||
echo "Antialiased text support in WINGs : $xft"
|
|
||||||
echo "Pango text layout support in WINGs : $pango"
|
echo "Pango text layout support in WINGs : $pango"
|
||||||
echo "Translated languages to support :$supported_locales"
|
echo "Translated languages to support :$supported_locales"
|
||||||
AS_IF([test "x$debug" = "xyes"],
|
AS_IF([test "x$debug" = "xyes"],
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ m4_pattern_allow([^WM_OSDEP(_[A-Z]*)?$])
|
|||||||
|
|
||||||
# WM_CHECK_XFT_VERSION(MIN_VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
|
# WM_CHECK_XFT_VERSION(MIN_VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
|
||||||
#
|
#
|
||||||
# $XFTFLAGS should be defined before calling this macro,
|
# $XFT_CFLAGS should be defined before calling this macro,
|
||||||
# else it will not be able to find Xft.h
|
# else it will not be able to find Xft.h
|
||||||
#
|
#
|
||||||
AC_DEFUN([WM_CHECK_XFT_VERSION],
|
AC_DEFUN([WM_CHECK_XFT_VERSION],
|
||||||
[
|
[
|
||||||
CPPFLAGS_old="$CPPFLAGS"
|
CPPFLAGS_old="$CPPFLAGS"
|
||||||
CPPFLAGS="$CPPFLAGS $XFTFLAGS $inc_search_path"
|
CPPFLAGS="$CPPFLAGS $XFT_CFLAGS $inc_search_path"
|
||||||
xft_major_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
xft_major_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||||
xft_minor_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
xft_minor_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||||
xft_micro_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
xft_micro_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||||
|
|||||||
Reference in New Issue
Block a user