mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 06:00:10 +01:00
[build/enable.ac] Add a feature "type" argument (font, surface, ...)
This commit is contained in:
parent
c8e75f1007
commit
33ed2fffb5
1 changed files with 41 additions and 32 deletions
|
|
@ -17,14 +17,19 @@ m4_define(cairo_cache_version, 4)
|
|||
dnl ===========================================================================
|
||||
dnl
|
||||
dnl Define a macro to enable features
|
||||
dnl - Macro: _CAIRO_ENABLE_NORMALIZED (NAMESPACE, NAME, ARG, FEATURE_NAME, DEFAULT, COMMANDS)
|
||||
dnl - Macro: _CAIRO_ENABLE_FULL (NAMESPACE, NAME, ARG, FEATURE_NAME, DEFAULT, WHAT, COMMANDS)
|
||||
dnl
|
||||
dnl where:
|
||||
dnl
|
||||
dnl NAMESPACE is the sub-namespace in function names, eg. "ft" for cairo_ft_...
|
||||
dnl NAME is the human-readable name of the backend, eg. "FreeType font"
|
||||
dnl ARG is what enables the backend, eg. "freetype" for --enable-freetype
|
||||
dnl FEATURE_NAME is what's used in cairo-features.h, eg. FT_FONT for CAIRO_HAS_FT_FONT
|
||||
dnl FEATURE_NAME is the feature conditional, eg. CAIRO_HAS_FT_FONT
|
||||
dnl WHAT is the type of feature:
|
||||
dnl "surface" for surface backends
|
||||
dnl "font" for font backends
|
||||
dnl "functions" for set of functions
|
||||
dnl "" for private configurations
|
||||
dnl DEFAULT is the default state of the backend:
|
||||
dnl "no" for experimental backends, eg. your favorite new backend
|
||||
dnl "yes" for mandatory backends, eg. png
|
||||
|
|
@ -37,11 +42,11 @@ dnl should also set $(NAMESPACE)_REQUIRES/CFLAGS/LIBS/...
|
|||
dnl appropriately. Look at the macro definition for more details,
|
||||
dnl or ask if in doubt.
|
||||
dnl
|
||||
AC_DEFUN([_CAIRO_ENABLE_NORMALIZED],
|
||||
AC_DEFUN([_CAIRO_ENABLE_FULL],
|
||||
[ AC_ARG_ENABLE([$3],
|
||||
AS_HELP_STRING([--enable-$3=@<:@no/auto/yes@:>@],
|
||||
[Enable cairo's $2 backend @<:@default=$5@:>@]),
|
||||
enable_$1=$enableval, enable_$1=$5)
|
||||
[Enable cairo's $2 backend @<:@default=$6@:>@]),
|
||||
enable_$1=$enableval, enable_$1=$6)
|
||||
case $enable_$1 in
|
||||
no)
|
||||
use_$1="no (disabled, use --enable-$3 to enable)"
|
||||
|
|
@ -61,7 +66,7 @@ AC_DEFUN([_CAIRO_ENABLE_NORMALIZED],
|
|||
$1[]_NONPKGCONFIG_CFLAGS=$ac_env_[]$1[]_NONPKGCONFIG_CFLAGS_value
|
||||
$1[]_NONPKGCONFIG_LIBS=$ac_env_[]$1[]_NONPKGCONFIG_LIBS_value
|
||||
$1[]_BASE=cairo
|
||||
$6
|
||||
$7
|
||||
cairo_cv_backend_[]$1[]_use=$use_[]$1
|
||||
cairo_cv_backend_[]$1[]_cache_version=cairo_cache_version
|
||||
cairo_cv_backend_[]$1[]_requires=$[]$1[]_REQUIRES
|
||||
|
|
@ -127,16 +132,16 @@ AC_DEFUN([_CAIRO_ENABLE_NORMALIZED],
|
|||
])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(CAIRO_HAS_$4, test "x$use_$1" = xyes)
|
||||
AM_CONDITIONAL($4, test "x$use_$1" = xyes)
|
||||
|
||||
dnl Collect list of all supported but disabled features
|
||||
AS_IF([test "x$use_$1" != xyes -a "x$5" != xno],
|
||||
AS_IF([test "x$use_$1" != xyes -a "x$6" != xno],
|
||||
[
|
||||
CAIRO_NO_FEATURES="$4 $CAIRO_NO_FEATURES"
|
||||
])
|
||||
|
||||
dnl Collect list of all (un)supported features and cairo headers
|
||||
AS_IF([test "x$5" = xno],
|
||||
AS_IF([test "x$6" = xno],
|
||||
[
|
||||
CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
|
||||
unsupported_cairo_headers += $(cairo_$1_headers)'
|
||||
|
|
@ -156,7 +161,7 @@ all_cairo_pkgconf += $(cairo_$1_pkgconf)
|
|||
all_cairo_headers += $(cairo_$1_headers)
|
||||
all_cairo_private += $(cairo_$1_private)
|
||||
all_cairo_sources += $(cairo_$1_sources)
|
||||
if CAIRO_HAS_$4
|
||||
if $4
|
||||
enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
|
||||
enabled_cairo_headers += $(cairo_$1_headers)
|
||||
enabled_cairo_private += $(cairo_$1_private)
|
||||
|
|
@ -168,7 +173,7 @@ all_cairo_pkgconf += $(cairo_$1_pkgconf)
|
|||
all_cairo_headers += $(cairo_$1_headers)
|
||||
all_cairo_private += $(cairo_$1_private)
|
||||
all_cairo_sources += $(cairo_$1_sources)
|
||||
ifeq ($(CAIRO_HAS_$4),1)
|
||||
ifeq ($($4),1)
|
||||
enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
|
||||
enabled_cairo_headers += $(cairo_$1_headers)
|
||||
enabled_cairo_private += $(cairo_$1_private)
|
||||
|
|
@ -176,7 +181,7 @@ enabled_cairo_sources += $(cairo_$1_sources)
|
|||
endif
|
||||
'
|
||||
dnl Collect warning message for enabled unsupported backends
|
||||
AS_IF([test "x$use_$1" = xyes -a "x$5" = xno],
|
||||
AS_IF([test "x$use_$1" = xyes -a "x$6" = xno],
|
||||
[
|
||||
CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
|
||||
*** The $2 backend is still under active development and
|
||||
|
|
@ -187,7 +192,7 @@ endif
|
|||
])
|
||||
|
||||
dnl Collect warning message for disabled recommended backends
|
||||
AS_IF([test "x$use_$1" != xyes -a "x$5" = xyes],
|
||||
AS_IF([test "x$use_$1" != xyes -a "x$6" = xyes],
|
||||
[
|
||||
CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
|
||||
*** It is strictly recommended that you do NOT disable
|
||||
|
|
@ -196,19 +201,23 @@ endif
|
|||
])
|
||||
])
|
||||
|
||||
dnl Like _CAIRO_ENABLE_NORMALIZED, but sanities input
|
||||
AC_DEFUN([_CAIRO_ENABLE],
|
||||
[
|
||||
_CAIRO_ENABLE_NORMALIZED(
|
||||
m4_translit([$1],[A-Z_ -],[a-z___]),
|
||||
[$2],
|
||||
m4_translit([$3],[A-Z_ -],[a-z---]),
|
||||
m4_translit([$4],[a-z_ -],[A-Z___]),
|
||||
[$5],
|
||||
[$6]
|
||||
)
|
||||
])
|
||||
m4_define([_CAIRO_BUILD_FEATURE_NAME_NORMALIZED],
|
||||
[CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])
|
||||
|
||||
m4_define([_CAIRO_BUILD_FEATURE_NAME],
|
||||
[_CAIRO_BUILD_FEATURE_NAME_NORMALIZED(m4_translit([$1],[a-z_ -],[A-Z___]),m4_translit(m4_ifval([$2],[ $2]),[a-z_ -],[A-Z___]))])
|
||||
|
||||
dnl Like _CAIRO_ENABLE*, but takes an object type too
|
||||
AC_DEFUN([_CAIRO_ENABLE],
|
||||
[_CAIRO_ENABLE_FULL(
|
||||
m4_translit([$1],[A-Z_ -],[a-z___]),
|
||||
[$2],
|
||||
m4_translit([$1],[A-Z_ -],[a-z---]),
|
||||
_CAIRO_BUILD_FEATURE_NAME([$1],[$3]),
|
||||
[$3],
|
||||
[$4],
|
||||
[$5]
|
||||
)])
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl
|
||||
|
|
@ -232,13 +241,13 @@ dnl appropriately. Look at the macro definition for more details,
|
|||
dnl or ask if in doubt.
|
||||
dnl
|
||||
AC_DEFUN([CAIRO_ENABLE],
|
||||
[_CAIRO_ENABLE([$1],[$2],[$1],[$1],[$3],[$4])])
|
||||
[_CAIRO_ENABLE([$1],[$2],,[$3],[$4])])
|
||||
AC_DEFUN([CAIRO_ENABLE_SURFACE_BACKEND],
|
||||
[_CAIRO_ENABLE([$1],[$2 surface backend],[$1],[$1_SURFACE],[$3],[$4])])
|
||||
[_CAIRO_ENABLE([$1],[$2 surface backend],surface,[$3],[$4])])
|
||||
AC_DEFUN([CAIRO_ENABLE_FONT_BACKEND],
|
||||
[_CAIRO_ENABLE([$1],[$2 font backend],[$1],m4_bpatsubst([$1],[_font$],[])[_FONT],[$3],[$4])])
|
||||
[_CAIRO_ENABLE([$1],[$2 font backend],font,[$3],[$4])])
|
||||
AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
|
||||
[_CAIRO_ENABLE([$1],[$2 functions],[$1],[$1_FUNCTIONS],[$3],[$4])])
|
||||
[_CAIRO_ENABLE([$1],[$2 functions],functions,[$3],[$4])])
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl
|
||||
|
|
@ -381,11 +390,11 @@ CAIRO_CONFIG_COMMANDS([src/cairo-features.h],
|
|||
echo '#define CAIRO_FEATURES_H'
|
||||
echo ''
|
||||
for FEATURE in $CAIRO_FEATURES; do
|
||||
echo "#define CAIRO_HAS_$FEATURE 1"
|
||||
echo "#define $FEATURE 1"
|
||||
done | LANG=C sort
|
||||
echo ''
|
||||
for FEATURE in $CAIRO_NO_FEATURES; do
|
||||
echo "/*#undef CAIRO_HAS_$FEATURE */"
|
||||
echo "/*#undef $FEATURE */"
|
||||
done | LANG=C sort
|
||||
echo ''
|
||||
echo '#endif'
|
||||
|
|
@ -402,7 +411,7 @@ CAIRO_CONFIG_COMMANDS([$srcdir/src/cairo-supported-features.h],
|
|||
echo '/* This is a dummy header, to trick gtk-doc only */'
|
||||
echo ''
|
||||
for FEATURE in $CAIRO_SUPPORTED_FEATURES; do
|
||||
echo "#define CAIRO_HAS_$FEATURE 1"
|
||||
echo "#define $FEATURE 1"
|
||||
done
|
||||
echo ''
|
||||
echo '#endif'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue