1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

Configure: Rewrite the detection for Pango library

Make use of the standard macro for PKG_CONFIG; the default behaviour is now
to use Pango if present, instead of requiring explicit user request, yet
still not making it mandatory.

The detection code was moved to a macro to keep the configure.ac script
(relatively) small, and consistent with what is done for most other libs.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2021-05-29 18:59:24 +02:00
committed by Carlos R. Mafra
parent 4221e30bd2
commit f049635fa5
4 changed files with 34 additions and 22 deletions

View File

@@ -12,7 +12,7 @@ lib_LTLIBRARIES = libWUtil.la libWINGs.la
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFT_LIBS@ @FCLIBS@ @LIBM@ @PANGOLIBS@
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFT_LIBS@ @FCLIBS@ @LIBM@ @PANGO_LIBS@
libWUtil_la_LIBADD = @LIBBSD@
EXTRA_DIST = BUGS make-rgb Examples Extras Tests
@@ -87,7 +87,7 @@ libWUtil_la_SOURCES = \
wutil.c
AM_CFLAGS =
AM_CFLAGS = @PANGO_CFLAGS@
AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
-I$(top_srcdir)/WINGs/WINGs -I$(top_builddir)/WINGs/WINGs \

View File

@@ -636,24 +636,15 @@ AC_SUBST(XFT_LIBS)
dnl PANGO support
dnl =============
pango=no
AC_ARG_ENABLE(pango, AS_HELP_STRING([--enable-pango], [enable Pango text layout support]),
pango=$enableval, pango=no)
dnl The libray can be used by WINGs to get better support on UTF-8 for i18n
AC_ARG_ENABLE([pango],
[AS_HELP_STRING([--disable-pango], [disable Pango text layout support @<:@default=auto@:>@])],
[AS_CASE([$enableval],
[yes|no], [],
[AC_MSG_ERROR([bad value $enableval for --disable-pango])] )],
[enable_pango=auto])
WM_CHECK_LIBPANGO
PANGOFLAGS=
PANGOLIBS=
if test "$pango" = yes; then
PANGOLIBS=`$PKG_CONFIG pangoxft --libs`
PANGOFLAGS=`$PKG_CONFIG pangoxft --cflags`
if test "x$PANGOLIBS" = "x" ; then
AC_MSG_RESULT([not found])
else
AC_DEFINE(USE_PANGO, 1, [Define if Pango is to be used])
AC_MSG_RESULT([found])
fi
fi
inc_search_path="$inc_search_path $PANGOFLAGS"
AC_SUBST(PANGOLIBS)
dnl ==============================================
dnl Graphic Format Libraries

View File

@@ -224,7 +224,7 @@ Get the @emph{GNU} version from @uref{http://www.gnu.org/software/gettext/}
This library can be used by the @emph{WINGs} toolkit to improve support for @emph{UTF-8} and for
languages written in right-to-left direction, in some widgets.
You have to explicitly ask for its support through (@pxref{Configure Options}).
If detected, it will be automatically used; you may request explicit support/ignore through (@pxref{Configure Options}).
You can get it from @uref{http://www.pango.org/Download}
@item @emph{libbsd}
@@ -484,8 +484,8 @@ even if your system provides it.
@item --disable-magick
Disable @emph{ImageMagick's MagickWand} support in @emph{WRaster}, used to support for image formats.
@item --enable-pango
Disabled by default, enable @emph{Pango} text layout support in @emph{WINGs}.
@item --disable-pango
Disable @emph{Pango} text layout support in @emph{WINGs}.
@item --disable-png
Disable PNG support in @emph{WRaster}; when enabled use @file{libpng}.

View File

@@ -50,6 +50,27 @@ AC_DEFUN([WM_CHECK_XFT_VERSION],
])
# WM_CHECK_LIBPANGO
# -----------------
#
# If the support was not disabled by user, check for the pango library using
# pkg-config, and if found place the appropriate stuff in the variables
# PANGO_CFLAGS (for compiler) and PANGO_LIBS (for linker)
AC_DEFUN([WM_CHECK_LIBPANGO],
[AS_IF([test "x$enable_pango" != "xno"],
[PKG_CHECK_MODULES([PANGO], [pangoxft],
[AC_DEFINE([USE_PANGO], [1], [defined when the pango library is used in WINGs])
pango="yes"],
[pango="no"])
AS_IF([test "x$enable_pango$pango" == "xyesno"],
[AC_MSG_ERROR([Pango library was not found - $PANGO_PKG_ERRORS])])
],
[pango="no"])
AC_SUBST([PANGO_CFLAGS])dnl
AC_SUBST([PANGO_LIBS])dnl
])
# _WM_LIB_CHECK_FUNCTS
# --------------------
# (internal shell functions)