summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-09-15 23:42:51 -0400
committerBehdad Esfahbod <behdad@behdad.org>2008-09-16 03:58:19 -0400
commit20daa425d8c46b6885653d2433f6027e4990d618 (patch)
tree472fb0f21fcf4f2425aa0f01987bbb13ed8eb523
parent1a3863688c0c09d047e5ee5b65e87c71c6393e3f (diff)
[configure.ac] Generate boilerplate/Makefile.am.config
Same scheme as in src/
-rwxr-xr-xautogen.sh6
-rw-r--r--boilerplate/Makefile.am87
-rw-r--r--boilerplate/Makefile.sources56
-rw-r--r--build/aclocal.enable.m429
-rw-r--r--build/aclocal.makefile.m4143
-rw-r--r--build/configure.ac.features (renamed from build/configure.ac.enable)181
-rw-r--r--configure.ac2
7 files changed, 308 insertions, 196 deletions
diff --git a/autogen.sh b/autogen.sh
index 99dd84a5a..ed9ece8d8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -169,9 +169,9 @@ do_cmd $ACLOCAL $ACLOCAL_FLAGS
do_cmd $AUTOHEADER
-# create dummy src/Makefile.am.config and ChangeLog to make automake happy
-rm -f src/Makefile.am.config
-touch src/Makefile.am.config
+# create dummy */Makefile.am.config and ChangeLog to make automake happy
+> boilerplate/Makefile.am.config
+> src/Makefile.am.config
touch ChangeLog
# We don't call gtkdocize right now. When we do, we should then modify
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index a24a6d08f..5a5168c57 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -1,35 +1,31 @@
+# Note: All source files are listed in Makefile.sources.
+
include $(top_srcdir)/build/Makefile.am.common
+include $(srcdir)/Makefile.am.config
+
+AM_CPPFLAGS = \
+ -I$(srcdir) \
+ -I$(top_builddir)/src \
+ -I$(top_srcdir)/src \
+ $(CAIRO_CFLAGS) \
+ $(NULL)
EXTRA_DIST += Makefile.win32
EXTRA_LTLIBRARIES += libcairoboilerplate.la
-libcairoboilerplate_la_SOURCES = \
- cairo-boilerplate.c \
- cairo-boilerplate.h \
- cairo-boilerplate-getopt.c \
- cairo-boilerplate-getopt.h \
- cairo-boilerplate-scaled-font.h \
- cairo-boilerplate-system.c \
- cairo-boilerplate-system.h \
+libcairoboilerplate_la_SOURCES = \
+ $(enabled_cairo_boilerplate_headers) \
+ $(enabled_cairo_boilerplate_private) \
+ $(enabled_cairo_boilerplate_sources) \
$(NULL)
-libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la $(CAIRO_LDADD)
+libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la
if CAIRO_HAS_BEOS_SURFACE
-#libcairoboilerplate_la_SOURCES += cairo-boilerplate-beos.cpp
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-beos-private.h
# BeOS system headers trigger this warning
-libcairoboilerplate_la_CXXFLAGS = -Wno-multichar
+AM_CPPFLAGS += -Wno-multichar
endif
-if CAIRO_HAS_DIRECTFB_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-directfb.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-directfb-private.h
-endif
-
-if CAIRO_HAS_GLITZ_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-glitz.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-glitz-private.h
if CAIRO_CAN_TEST_GLITZ_AGL_SURFACE
libcairoboilerplate_la_LIBADD += $(GLITZ_AGL_LIBS)
endif
@@ -42,65 +38,16 @@ endif
if CAIRO_CAN_TEST_GLITZ_WGL_SURFACE
libcairoboilerplate_la_LIBADD += $(GLITZ_WGL_LIBS)
endif
-endif
-
-if CAIRO_HAS_PDF_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-pdf.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-pdf.h
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-pdf-private.h
-endif
-
-if CAIRO_HAS_PS_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-ps.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-ps.h
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-ps-private.h
-endif
-
-if CAIRO_HAS_QUARTZ_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-quartz.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-quartz-private.h
-endif
-
-if CAIRO_HAS_SVG_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-svg.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-svg.h
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-svg-private.h
-endif
-
-if CAIRO_HAS_TEST_SURFACES
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-test-surfaces.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-test-surfaces-private.h
-endif
if CAIRO_HAS_WIN32_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-win32.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-win32-printing.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-win32-private.h
libcairoboilerplate_la_LIBADD += -lwinspool
endif
-if CAIRO_HAS_XCB_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-xcb.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-xcb-private.h
-endif
-
-if CAIRO_HAS_XLIB_SURFACE
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-xlib.c
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-xlib.h
-libcairoboilerplate_la_SOURCES += cairo-boilerplate-xlib-private.h
-endif
-
-AM_CPPFLAGS = \
- -I$(srcdir) \
- -I$(top_builddir)/src \
- -I$(top_srcdir)/src \
- $(CAIRO_CFLAGS)
-
test: check
if CROSS_COMPILING
else
-TESTS += check-link
+TESTS += check-link$(EXEEXT)
endif
check_PROGRAMS += check-link
diff --git a/boilerplate/Makefile.sources b/boilerplate/Makefile.sources
new file mode 100644
index 000000000..eaf904041
--- /dev/null
+++ b/boilerplate/Makefile.sources
@@ -0,0 +1,56 @@
+# Makefile.sources
+#
+# This file is pretty similar to $(top_srcdir)/src/Makefile.sources,
+# but for boilerplate. Unlike that file, there are no special headers.
+#
+
+cairo_boilerplate_headers = \
+ cairo-boilerplate-getopt.h \
+ cairo-boilerplate-scaled-font.h \
+ cairo-boilerplate-system.h \
+ cairo-boilerplate.h \
+ $(NULL)
+cairo_boilerplate_sources = \
+ cairo-boilerplate-getopt.c \
+ cairo-boilerplate-system.c \
+ cairo-boilerplate.c \
+ $(NULL)
+
+# automake is stupid enough to always use c++ linker if we enable the
+# following lines, even if beos surface is not enabled. Disable it for now.
+cairo_boilerplate_beos_private = cairo-boilerplate-beos-private.h
+#libcairoboilerplate_la_SOURCES += cairo-boilerplate-beos.cpp
+
+cairo_boilerplate_directfb_private = cairo-boilerplate-directfb-private.h
+cairo_boilerplate_directfb_sources = cairo-boilerplate-directfb.c
+
+cairo_boilerplate_glitz_private = cairo-boilerplate-glitz-private.h
+cairo_boilerplate_glitz_sources = cairo-boilerplate-glitz.c
+
+cairo_boilerplate_pdf_headers = cairo-boilerplate-pdf.h
+cairo_boilerplate_pdf_private = cairo-boilerplate-pdf-private.h
+cairo_boilerplate_pdf_sources = cairo-boilerplate-pdf.c
+
+cairo_boilerplate_ps_headers = cairo-boilerplate-ps.h
+cairo_boilerplate_ps_private = cairo-boilerplate-ps-private.h
+cairo_boilerplate_ps_sources = cairo-boilerplate-ps.c
+
+cairo_boilerplate_quartz_private = cairo-boilerplate-quartz-private.h
+cairo_boilerplate_quartz_sources = cairo-boilerplate-quartz.c
+
+cairo_boilerplate_svg_headers = cairo-boilerplate-svg.h
+cairo_boilerplate_svg_private = cairo-boilerplate-svg-private.h
+cairo_boilerplate_svg_sources = cairo-boilerplate-svg.c
+
+cairo_boilerplate_test_surfaces_private = cairo-boilerplate-test-surfaces-private.h
+cairo_boilerplate_test_surfaces_sources = cairo-boilerplate-test-surfaces.c
+
+cairo_boilerplate_win32_private = cairo-boilerplate-win32-private.h
+cairo_boilerplate_win32_sources = cairo-boilerplate-win32.c cairo-boilerplate-win32-printing.c
+
+cairo_boilerplate_xcb_private = cairo-boilerplate-xcb-private.h
+cairo_boilerplate_xcb_sources = cairo-boilerplate-xcb.c
+
+cairo_boilerplate_xlib_headers = cairo-boilerplate-xlib.h
+cairo_boilerplate_xlib_private = cairo-boilerplate-xlib-private.h
+cairo_boilerplate_xlib_sources = cairo-boilerplate-xlib.c
diff --git a/build/aclocal.enable.m4 b/build/aclocal.enable.m4
index 31432a4e6..f7a660fa4 100644
--- a/build/aclocal.enable.m4
+++ b/build/aclocal.enable.m4
@@ -222,8 +222,8 @@ m4_define([_CAIRO_ACCUMULATORS_REGISTER],
m4_foreach_w([cr_var], [$1], [m4_pattern_allow([CAIRO_]cr_var)])dnl
])dnl
-m4_define([_CAIRO_SH_ESCAPE],['m4_bpatsubst([$1],['],[\'])'])dnl
-m4_define([_CAIRO_SH_ESCAPE_UNQUOTED],["m4_bpatsubst([$1],["],[\"])"])dnl
+m4_define([_CAIRO_SH_ESCAPE],['m4_bpatsubst([$1],['],[\\'])'])dnl
+m4_define([_CAIRO_SH_ESCAPE_UNQUOTED],["m4_bpatsubst([$1],["],[\\"])"])dnl
dnl
dnl CAIRO_ACCUMULATORS_REGISTER(VARS, SEPARATOR=[], INITIAL-VALUE=[])
@@ -246,12 +246,12 @@ dnl so it can reference other shell variables for example.
dnl
AC_DEFUN([CAIRO_ACCUMULATORS_REGISTER_UNQUOTED],
[dnl
- _CAIRO_ACCUMULATORS_REGISTER([$1],[$2],_CAIRO_SH_ESCAPE_UNQUOTED[$3])dnl
+ _CAIRO_ACCUMULATORS_REGISTER([$1],[$2],_CAIRO_SH_ESCAPE_UNQUOTED([$3]))dnl
])dnl
m4_define([_CAIRO_ACCUMULATOR_CHECK],
[dnl
- m4_ifdef([cr_acc_$1_sep],,[m4_fatal([Accumulator ]$1[ not defined.])])dnl
+ m4_ifdef([cr_acc_$1_sep],,[m4_fatal([Accumulator `]$1[' not defined.])])dnl
])dnl
m4_define([_CAIRO_ACCUMULATE],
@@ -309,6 +309,26 @@ AC_DEFUN([CAIRO_ACCUMULATE_UNQUOTED_BEFORE],
])dnl
dnl
+dnl CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED(VAR, VALUE)
+dnl
+dnl Like CAIRO_ACCUMULATE_UNQUOTED but VALUE is not tested for emptiness.
+dnl
+AC_DEFUN([CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED],
+[dnl
+ _CAIRO_ACCUMULATE([$1], [$2], [CAIRO_$1="${CAIRO_$1}]m4_do([cr_acc_$1_sep])["]_CAIRO_SH_ESCAPE_UNQUOTED([$2]))dnl
+])dnl
+
+dnl
+dnl CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED_BEFORE(VAR, VALUE)
+dnl
+dnl Like CAIRO_ACCUMULATE_UNQUOTED_BEFORE but VALUE is not tested for emptiness.
+dnl
+AC_DEFUN([CAIRO_ACCUMULATE_UNQUOTED_BEFORE],
+[dnl
+ _CAIRO_ACCUMULATE([$1], [$2], [CAIRO_$1=]_CAIRO_SH_ESCAPE_UNQUOTED([$2])["]m4_do([cr_acc_$1_sep])[${CAIRO_$1}"])dnl
+])dnl
+
+dnl
dnl CAIRO_ACCUMULATORS_FOREACH(VAR, COMMANDS)
dnl
dnl Run COMMANDS for each registered accumulator.
@@ -439,4 +459,3 @@ AC_DEFUN([CAIRO_FEATURE_HOOK_REGISTER],
], m4_newline)dnl
])dnl
-
diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
new file mode 100644
index 000000000..e7a19c11e
--- /dev/null
+++ b/build/aclocal.makefile.m4
@@ -0,0 +1,143 @@
+dnl
+dnl These are the facilities for generating Makefile.am.config and
+dnl Makefile.win32.config files.
+dnl
+
+dnl ===========================================================================
+
+dnl
+dnl Define cr_feature_tag ala other cr_feature_* macros
+dnl Expands to CAIRO_HAS_FEATURE_ID
+dnl
+m4_define([_CAIRO_BUILD_FEATURE_TAG_NORMALIZED],
+ [CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])dnl
+m4_define([_CAIRO_BUILD_FEATURE_TAG],
+ [_CAIRO_BUILD_FEATURE_TAG_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])dnl
+m4_define([cr_feature_tag],
+ [_CAIRO_BUILD_FEATURE_TAG(cr_feature,cr_feature_what)])dnl
+
+
+dnl ===========================================================================
+dnl
+dnl CAIRO_INIT_MAKEFILES()
+dnl
+dnl Sets up automake conditionals for all features
+dnl
+AC_DEFUN([CAIRO_INIT_MAKEFILES],
+[dnl
+ dnl Allow feature tags in the output
+ m4_pattern_allow(^CAIRO_HAS_)dnl
+
+ dnl Automake conditionals for all features
+ CAIRO_FEATURE_HOOK_REGISTER(*,*,*,
+ [dnl
+ AM_CONDITIONAL(cr_feature_tag, test "x$use_$1" = xyes)dnl
+ ])dnl
+])dnl
+
+dnl ===========================================================================
+
+m4_define([_CAIRO_MAKEFILES])dnl
+
+dnl
+dnl CAIRO_CONFIG_MAKEFILE(TAG, DIR)
+dnl
+dnl Create DIR/Makefile.*.config files
+dnl TAG is a TAG used by other CAIRO_MAKEFILE_* macros to append to these
+dnl Makefile's.
+dnl
+AC_DEFUN([CAIRO_CONFIG_MAKEFILE],
+[dnl
+ m4_append_uniq([_CAIRO_MAKEFILES], [$1], [ ],,
+ [m4_fatal([Makefile `$1' already registered])])dnl
+
+ dnl Remember directory for this makefile tag
+ m4_define([cr_make_$1_dir],[$2])dnl
+
+ dnl Accumulators
+ CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_AMAKE, m4_newline, [# Generated by configure. Do not edit.]m4_newline[include $(top_srcdir)/$2/Makefile.sources]m4_newline)dnl
+ CAIRO_ACCUMULATORS_REGISTER_UNQUOTED(MAKEFILE_$1_WIN32, m4_newline, [$CAIRO_MAKEFILE_$1_AMAKE])dnl
+
+ dnl Generate
+ CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.am.config],
+ [echo "$CAIRO_MAKEFILE_$1_AMAKE"],
+ [CAIRO_MAKEFILE_$1_AMAKE='$CAIRO_MAKEFILE_$1_AMAKE'])dnl
+ CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.win32.config],
+ [echo "$CAIRO_MAKEFILE_$1_WIN32"],
+ [CAIRO_MAKEFILE_$1_WIN32='$CAIRO_MAKEFILE_$1_WIN32'])dnl
+])dnl
+
+m4_define([_CAIRO_MAKEFILE_CHECK],
+[dnl
+ m4_ifdef([cr_make_$1_dir],,[m4_fatal([Makefile `]$1[' not defined.])])dnl
+])dnl
+
+m4_pattern_allow([cr_make_tmp])
+
+dnl
+dnl CAIRO_MAKEFILE_ACCUMULATE(TAG, CONTENT)
+dnl
+dnl Accumulates CONTENT to Makefile's for TAG. If TAG is *,
+dnl CONTENT is added to all Makefile's.
+dnl
+AC_DEFUN([CAIRO_MAKEFILE_ACCUMULATE],
+[dnl
+ m4_if([$1],[*],,[_CAIRO_MAKEFILE_CHECK([$1])])dnl
+ m4_foreach_w([cr_makefile], m4_if([$1],[*],_CAIRO_MAKEFILES,[$1]),
+ [dnl
+ m4_pushdef([cr_make_acc_contents],[$2])dnl
+ cr_make_tmp=_CAIRO_SH_ESCAPE(cr_make_acc_contents(cr_makefile))
+ m4_popdef([cr_make_acc_contents])dnl
+ CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([MAKEFILE_]cr_makefile[_AMAKE], [$cr_make_tmp])dnl
+ CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([MAKEFILE_]cr_makefile[_WIN32], [$cr_make_tmp])dnl
+ ])dnl
+])dnl
+
+m4_define([_CAIRO_MAKEFILE_ACCUMULATE_FEATURE],
+[dnl
+ m4_case([$2],
+ [*],,
+ [yes], [CAIRO_ACCUMULATE([$1], [$3])],
+ [no], [CAIRO_ACCUMULATE([$1], [$3]m4_newline[$4])],
+ [m4_fatal([Invalid ENABLED value `]$2['])])dnl
+ CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([$1], [$6])dnl
+ m4_case([$2],
+ [*],,
+ [yes], [CAIRO_ACCUMULATE([$1], [$5])],
+ [no], [CAIRO_ACCUMULATE([$1], [$5])],
+ [m4_fatal([Invalid ENABLED value `]$2['])])dnl
+])dnl
+
+dnl
+dnl CAIRO_MAKEFILE_ACCUMULATE_FEATURE(TAG, ENABLED, DEFAULT, WHAT, CONTENT)
+dnl
+dnl Accumulates CONTENT to Makefile's for TAG for each feature matching
+dnl ENABLED, DEFAULT, and WHAT. Those parameters are similar to those
+dnl passed to CAIRO_FEATURE_HOOK_REGISTER.
+dnl If TAG is *, CONTENT is added to all Makefile's.
+dnl
+AC_DEFUN([CAIRO_MAKEFILE_ACCUMULATE_FEATURE],
+[dnl
+ m4_if([$1],[*],,[_CAIRO_MAKEFILE_CHECK([$1])])dnl
+ m4_pushdef([cr_make_acc_contents],[$5])dnl
+ CAIRO_FEATURE_HOOK_REGISTER(*,[$3],[$4],
+ [dnl
+ m4_foreach_w([cr_makefile], m4_if([$1],[*],_CAIRO_MAKEFILES,[$1]),
+ [dnl
+ m4_pushdef([cr_make_acc_contents],[$5])dnl
+ cr_make_tmp=_CAIRO_SH_ESCAPE(]]cr_make_acc_contents([[[[]]]]cr_makefile(),[$][1],[$][2],[$][3],[$][4])[[)
+ _CAIRO_MAKEFILE_ACCUMULATE_FEATURE(
+ [MAKEFILE_]cr_makefile[_AMAKE],
+ [$2],
+ [if ]cr_feature_tag, [else], [endif],
+ [$cr_make_tmp])dnl
+ _CAIRO_MAKEFILE_ACCUMULATE_FEATURE(
+ [MAKEFILE_]cr_makefile[_WIN32],
+ [$2],
+ [ifeq ($(]cr_feature_tag[),1)], [else], [endif],
+ [$cr_make_tmp])dnl
+ ])dnl
+ ])dnl
+ m4_popdef([cr_make_acc_contents])dnl
+])dnl
+
diff --git a/build/configure.ac.enable b/build/configure.ac.features
index 1e757fb6b..bb143cc72 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.features
@@ -34,21 +34,6 @@ AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
dnl
-dnl Define cr_feature_tag ala other cr_feature_* macros
-dnl Expands to CAIRO_HAS_FEATURE_ID
-dnl
-m4_define([_CAIRO_BUILD_FEATURE_TAG_NORMALIZED],
- [CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])dnl
-m4_define([_CAIRO_BUILD_FEATURE_TAG],
- [_CAIRO_BUILD_FEATURE_TAG_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])dnl
-m4_define([cr_feature_tag],
- [_CAIRO_BUILD_FEATURE_TAG(cr_feature,cr_feature_what)])dnl
-
-dnl Allow feature tags in the output
-m4_pattern_allow(^CAIRO_HAS_)dnl
-
-
-dnl
dnl Define cr_feature_pc and friends ala other cr_feature_* macros
dnl
m4_define([cr_pc_modname],
@@ -68,107 +53,74 @@ dnl ===========================================================================
dnl ===========================================================================
dnl
-dnl Automake conditionals for all features
-dnl
-CAIRO_FEATURE_HOOK_REGISTER(*,*,*,
-[dnl
- AM_CONDITIONAL(cr_feature_tag, test "x$use_$1" = xyes)dnl
-])dnl
-
-
-dnl ===========================================================================
-dnl
dnl Generate {src,boilerplate}/Makefile.{am,win32}.config
dnl
-dnl Accumulators
-dnl CAIRO_ACCUMULATE(FEATURES, cr_feature_tag)
-CAIRO_ACCUMULATORS_REGISTER(CONFIG_AMAKE,m4_newline,[# Generated by configure. Do not edit.
-include $(top_srcdir)/src/Makefile.sources
-
-all_cairo_files = $(all_cairo_headers) $(all_cairo_private) $(all_cairo_sources)
-enabled_cairo_files = $(enabled_cairo_headers) $(enabled_cairo_private) $(enabled_cairo_sources)
-
-all_cairo_headers = $(cairo_headers)
-all_cairo_private = $(cairo_private)
-all_cairo_sources = $(cairo_sources)
-enabled_cairo_headers = $(cairo_headers)
-enabled_cairo_private = $(cairo_private)
-enabled_cairo_sources = $(cairo_sources)
-
-supported_cairo_headers = $(cairo_headers)
-unsupported_cairo_headers =
-])dnl
-
-CAIRO_ACCUMULATORS_REGISTER_UNQUOTED(CONFIG_WIN32,m4_newline,[$CAIRO_CONFIG_AMAKE])dnl
-
-dnl Generate
-CAIRO_CONFIG_COMMANDS([$srcdir/src/Makefile.am.config],
- [echo "$CAIRO_CONFIG_AMAKE"],
- [CAIRO_CONFIG_AMAKE='$CAIRO_CONFIG_AMAKE'])dnl
-CAIRO_CONFIG_COMMANDS([$srcdir/src/Makefile.win32.config],
- [echo "$CAIRO_CONFIG_WIN32"],
- [CAIRO_CONFIG_WIN32='$CAIRO_CONFIG_WIN32'])dnl
-
-dnl Collect list of all supported public cairo headers
-CAIRO_FEATURE_HOOK_REGISTER(*,!no,!,
+CAIRO_INIT_MAKEFILES()
+CAIRO_CONFIG_MAKEFILE([cairo], [src])dnl
+CAIRO_CONFIG_MAKEFILE([cairo_boilerplate], [boilerplate])dnl
+
+
+dnl Collect list of all supported public headers
+CAIRO_MAKEFILE_ACCUMULATE(*,
+[supported_$1_headers = $($1_headers)]dnl
+)dnl
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,!no,!,
+[supported_$1_headers += $($1_$2_headers)]dnl
+)dnl
+
+dnl Collect list of all unsupported public headers
+CAIRO_MAKEFILE_ACCUMULATE(*,
+[unsupported_$1_headers =]dnl
+)dnl
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,no,!,
+[unsupported_$1_headers += $($1_$2_headers)]dnl
+)dnl
+
+dnl Collect list of source files for all public features
+CAIRO_MAKEFILE_ACCUMULATE(*,
[dnl
- CAIRO_ACCUMULATE(CONFIG_AMAKE, [supported_cairo_headers += $(cairo_$1_headers)])dnl
- CAIRO_ACCUMULATE(CONFIG_WIN32, [supported_cairo_headers += $(cairo_$1_headers)])dnl
+all_$1_files = $(all_$1_headers) $(all_$1_private) $(all_$1_sources)
+all_$1_headers = $($1_headers)
+all_$1_private = $($1_private)
+all_$1_sources = $($1_sources)
])dnl
-
-dnl Collect list of all unsupported public cairo headers
-CAIRO_FEATURE_HOOK_REGISTER(*,no,!,
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,!,
[dnl
- CAIRO_ACCUMULATE(CONFIG_AMAKE, [unsupported_cairo_headers += $(cairo_$1_headers)])dnl
- CAIRO_ACCUMULATE(CONFIG_WIN32, [unsupported_cairo_headers += $(cairo_$1_headers)])dnl
+all_$1_headers += $($1_$2_headers)
+all_$1_private += $($1_$2_private)
+all_$1_sources += $($1_$2_sources)
])dnl
-dnl Collect list of source files for all/enabled public features
-CAIRO_FEATURE_HOOK_REGISTER(*,*,!,
+dnl Collect list of source files for enabled public features
+CAIRO_MAKEFILE_ACCUMULATE(*,
[dnl
- CAIRO_ACCUMULATE(CONFIG_AMAKE, [dnl
-all_cairo_headers += $(cairo_$1_headers)
-all_cairo_private += $(cairo_$1_private)
-all_cairo_sources += $(cairo_$1_sources)
-if cr_feature_tag
-enabled_cairo_headers += $(cairo_$1_headers)
-enabled_cairo_private += $(cairo_$1_private)
-enabled_cairo_sources += $(cairo_$1_sources)
-endif
-])dnl
- CAIRO_ACCUMULATE(CONFIG_WIN32, [dnl
-all_cairo_headers += $(cairo_$1_headers)
-all_cairo_private += $(cairo_$1_private)
-all_cairo_sources += $(cairo_$1_sources)
-ifeq ($(cr_feature_tag),1)
-enabled_cairo_headers += $(cairo_$1_headers)
-enabled_cairo_private += $(cairo_$1_private)
-enabled_cairo_sources += $(cairo_$1_sources)
-endif
+enabled_$1_files = $(enabled_$1_headers) $(enabled_$1_private) $(enabled_$1_sources)
+enabled_$1_headers = $($1_headers)
+enabled_$1_private = $($1_private)
+enabled_$1_sources = $($1_sources)
])dnl
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,yes,*,!,
+[dnl
+enabled_$1_headers += $($1_$2_headers)
+enabled_$1_private += $($1_$2_private)
+enabled_$1_sources += $($1_$2_sources)
])dnl
-dnl Collect list of source files for all/enabled private features
-CAIRO_FEATURE_HOOK_REGISTER(*,*,,
+dnl No public headers for private features
+
+dnl Collect list of source files for all private features
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,,
[dnl
- dnl No public headers for private features
- CAIRO_ACCUMULATE(CONFIG_AMAKE, [dnl
-all_cairo_private += $(cairo_$1_private) $(cairo_$1_headers)
-all_cairo_sources += $(cairo_$1_sources)
-if cr_feature_tag
-enabled_cairo_private += $(cairo_$1_private) $(cairo_$1_headers)
-enabled_cairo_sources += $(cairo_$1_sources)
-endif
-])dnl
- CAIRO_ACCUMULATE(CONFIG_WIN32, [dnl
-all_cairo_private += $(cairo_$1_private) $(cairo_$1_headers)
-all_cairo_sources += $(cairo_$1_sources)
-ifeq ($(cr_feature_tag),1)
-enabled_cairo_private += $(cairo_$1_private) $(cairo_$1_headers)
-enabled_cairo_sources += $(cairo_$1_sources)
-endif
+all_$1_private += $($1_$2_private) $($1_$2_headers)
+all_$1_sources += $($1_$2_sources)
])dnl
+
+dnl Collect list of source files for enabled private features
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,yes,*,,
+[dnl
+enabled_$1_private += $($1_$2_private) $($1_$2_headers)
+enabled_$1_sources += $($1_$2_sources)
])dnl
@@ -245,22 +197,17 @@ CAIRO_FEATURE_HOOK_REGISTER(yes,!always,!,
])dnl
-dnl Collect list of .pc files for all/enabled non-builtin public features
-
-CAIRO_ACCUMULATE(CONFIG_AMAKE, [dnl
-all_cairo_pkgconf = cairo.pc
-enabled_cairo_pkgconf = cairo.pc
-])dnl
+dnl Collect list of .pc files for all non-builtin public features
+CAIRO_MAKEFILE_ACCUMULATE(cairo,
+[all_$1_pkgconf = cairo.pc])dnl
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(cairo,*,*,!,
+[all_$1_pkgconf += cr_feature_pc])dnl
-CAIRO_FEATURE_HOOK_REGISTER(*,!always,!,
-[dnl
- CAIRO_ACCUMULATE(CONFIG_AMAKE, [dnl
-all_cairo_pkgconf += cr_feature_pc
-if cr_feature_tag
-enabled_cairo_pkgconf += cr_feature_pc
-endif
-])dnl
-])dnl
+dnl Collect list of .pc files for enabled non-builtin public features
+CAIRO_MAKEFILE_ACCUMULATE(cairo,
+[enabled_$1_pkgconf = cairo.pc])dnl
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(cairo,yes,*,!,
+[enabled_$1_pkgconf += cr_feature_pc])dnl
dnl ===========================================================================
diff --git a/configure.ac b/configure.ac
index c48a5dfdc..2ffb7b017 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ dnl
m4_include(build/configure.ac.version) dnl macros setting up various version declares
m4_include(build/configure.ac.tools) dnl checks for tools we use
m4_include(build/configure.ac.system) dnl checks for system functions, headers, libs
-m4_include(build/configure.ac.enable) dnl macros for backend/feature enablement
+m4_include(build/configure.ac.features) dnl macros for backend/feature handling
m4_include(build/configure.ac.warnings) dnl checks for compiler warning
m4_include(build/configure.ac.analysis) dnl checks for analysis tools (lcov, etc)
AC_CACHE_SAVE