diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-07-15 13:26:34 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-07-15 13:26:34 +0100 |
commit | 1caa34103925c53b180cd614f5c6b425b5a3f271 (patch) | |
tree | 02e974f51fee963907cd0da1ab298274ae7d46a0 /boilerplate | |
parent | 818ad38a0e323892231469520a4b077f4dae31d4 (diff) |
Fix build under distcheck
Need to play a little dance to get the sources included and paths correct
whilst building source files with objdir != srcdir under distcheck.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/Makefile.am | 10 | ||||
-rw-r--r-- | boilerplate/make-cairo-boilerplate-constructors.c | 19 |
2 files changed, 18 insertions, 11 deletions
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am index 523453a4..763f9a61 100644 --- a/boilerplate/Makefile.am +++ b/boilerplate/Makefile.am @@ -49,15 +49,15 @@ endif libcairoboilerplate_la_LIBADD += $(CAIROBOILERPLATE_LIBS) make-cairo-boilerplate-constructors$(EXEEXT): make-cairo-boilerplate-constructors.c - $(CC) -o $@ make-cairo-boilerplate-constructors.c + $(CC) $^ -o $@ cairo-boilerplate-constructors.c: Makefile $(enabled_cairo_boilerplate_sources) make-cairo-boilerplate-constructors$(EXEEXT) - (cd $(srcdir) && ./make-cairo-boilerplate-constructors$(EXEEXT) $(enabled_cairo_boilerplate_sources)) > $@ + echo '(cd $(srcdir) && $(top_builddir)/boilerplate/make-cairo-boilerplate-constructors$(EXEEXT) $(enabled_cairo_boilerplate_sources)) > $@' + ./make-cairo-boilerplate-constructors$(EXEEXT) $(srcdir) $(enabled_cairo_boilerplate_sources) > $@ BUILT_SOURCES += cairo-boilerplate-constructors.c -EXTRA_DIST += $(BUILT_SOURCES) -CLEANFILES += $(BUILT_SOURCES) -CLEANFILES += make-cairo-boilerplate-constructors +EXTRA_DIST += $(BUILT_SOURCES) make-cairo-boilerplate-constructors.c +CLEANFILES += $(BUILT_SOURCES) make-cairo-boilerplate-constructors test: check diff --git a/boilerplate/make-cairo-boilerplate-constructors.c b/boilerplate/make-cairo-boilerplate-constructors.c index 33068663..b954492c 100644 --- a/boilerplate/make-cairo-boilerplate-constructors.c +++ b/boilerplate/make-cairo-boilerplate-constructors.c @@ -33,6 +33,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <limits.h> #define NAME "make-cairo-boilerplate-constructors.c" @@ -67,8 +68,8 @@ add_name (const char *name) } static int -scan_file (const char *filename, - FILE *fp) +scan_file (const char *filename, + FILE *fp) { int line_num = 0; char linebuf[1024]; @@ -116,16 +117,22 @@ scan_file (const char *filename, int main (int argc, char **argv) { + char buf[PATH_MAX]; int i; int fail = 0; struct name *node; - for (i=1; i<argc; i++) { - FILE *fp = fopen (argv[i], "r"); - if (fp) { + for (i = 2; i < argc; i++) { + FILE *fp; + + snprintf (buf, sizeof (buf), "%s/%s", argv[1], argv[i]); + + fp = fopen (buf, "r"); + if (fp != NULL) { fail |= scan_file (argv[i], fp); fclose (fp); - } + } else + fail = 1; } if (fail) exit(1); |