diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2008-01-28 23:26:35 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2008-01-28 23:26:35 -0500 |
commit | 47e0ecbea51cae73a85db277972b80eff0c4b9f6 (patch) | |
tree | 49a7acdb1188354bd8ff6b6b09a1645028450a7c | |
parent | 9d8990b6bdec8e574e37346c363b3a850a246452 (diff) |
[configure.in] Generate a cairo-no-features.h with macros for disabled supported backends
to trick gtk-doc with it.
-rw-r--r-- | configure.in | 33 | ||||
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rwxr-xr-x | src/check-headers.sh | 2 |
3 files changed, 36 insertions, 5 deletions
diff --git a/configure.in b/configure.in index 66ec5699..96712536 100644 --- a/configure.in +++ b/configure.in @@ -983,7 +983,7 @@ _EOF for FEATURE in $CAIRO_FEATURES; do echo "#define CAIRO_HAS_$FEATURE 1" >> $outfile done - echo >> $outfile + echo '' >> $outfile for FEATURE in $CAIRO_NO_FEATURES; do echo "/* #undef CAIRO_HAS_$FEATURE */" >> $outfile done @@ -1004,6 +1004,37 @@ _EOF CAIRO_VERSION_MINOR=$CAIRO_VERSION_MINOR CAIRO_VERSION_MICRO=$CAIRO_VERSION_MICRO ]) +AC_CONFIG_COMMANDS([src/cairo-no-features.h], +[ + nofeaturesfile=src/cairo-no-features.h + outfile=$nofeaturesfile.tmp + AC_MSG_NOTICE([creating $nofeaturesfile]) + cat > $outfile <<_EOF +/* Generated by configure. Do not edit */ +#ifndef CAIRO_NO_FEATURES_H +#define CAIRO_NO_FEATURES_H + +#include <cairo-features.h> + +/* This is a dummy header, to trick gtk-doc only */ + +_EOF + for FEATURE in $CAIRO_NO_FEATURES; do + echo "#define CAIRO_HAS_$FEATURE 1" >> $outfile + done + + echo '' >> $outfile + echo '#endif' >> $outfile + + if cmp -s $outfile $nofeaturesfile; then + AC_MSG_NOTICE([$nofeaturesfile is unchanged]) + rm -f $outfile + else + mv $outfile $nofeaturesfile + fi +],[ + CAIRO_NO_FEATURES='$CAIRO_NO_FEATURES' +]) AC_CONFIG_FILES([ Makefile boilerplate/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index c1a2361e..e908b9b8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -289,9 +289,9 @@ $(backend_pkgconfigs): $(top_srcdir)/configure $(top_builddir)/config.h: $(top_srcdir)/config.h.in cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h -DISTCLEANFILES += cairo-features.h -cairo-features.h: - cd $(top_builddir) && ./config.status src/cairo-features.h +DISTCLEANFILES += cairo-features.h cairo-no-features.h +cairo-features.h cairo-no-features.h: + cd $(top_builddir) && ./config.status src/$@ CLEANFILES = cairo.def cairo.def: $(cairo_headers) cairo-features.h diff --git a/src/check-headers.sh b/src/check-headers.sh index 2ac74fd2..4792b2db 100755 --- a/src/check-headers.sh +++ b/src/check-headers.sh @@ -7,7 +7,7 @@ status=0 echo Checking public headers for missing cairo_public decorators -find "$srcdir" -name '*.h' ! -name '*-private.h' ! -name '*-test.h' ! -name 'cairoint.h' | +find "$srcdir" -name '*.h' ! -name '*-private.h' ! -name '*-test.h' ! -name 'cairoint.h' ! -name 'cairo-no-features.h' | xargs grep -B 1 '^cairo_.*[ ]\+(' | awk ' /^--$/ { context=""; public=0; next; } |