mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 21:38:03 +02:00
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.
This commit is contained in:
parent
818ad38a0e
commit
1caa341039
7 changed files with 125 additions and 19 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -215,6 +215,8 @@ The Portable Network Graphics image file format (ISO/IEC 15948). Since 1.10
|
|||
@CAIRO_SURFACE_TYPE_WIN32_PRINTING:
|
||||
@CAIRO_SURFACE_TYPE_QUARTZ_IMAGE:
|
||||
@CAIRO_SURFACE_TYPE_SCRIPT:
|
||||
@CAIRO_SURFACE_TYPE_QT:
|
||||
@CAIRO_SURFACE_TYPE_META:
|
||||
|
||||
<!-- ##### FUNCTION cairo_surface_get_type ##### -->
|
||||
<para>
|
||||
|
|
|
|||
|
|
@ -383,6 +383,21 @@ The cairo drawing context
|
|||
@CAIRO_OPERATOR_XOR:
|
||||
@CAIRO_OPERATOR_ADD:
|
||||
@CAIRO_OPERATOR_SATURATE:
|
||||
@CAIRO_OPERATOR_MULTIPLY:
|
||||
@CAIRO_OPERATOR_SCREEN:
|
||||
@CAIRO_OPERATOR_OVERLAY:
|
||||
@CAIRO_OPERATOR_DARKEN:
|
||||
@CAIRO_OPERATOR_LIGHTEN:
|
||||
@CAIRO_OPERATOR_COLOR_DODGE:
|
||||
@CAIRO_OPERATOR_COLOR_BURN:
|
||||
@CAIRO_OPERATOR_HARD_LIGHT:
|
||||
@CAIRO_OPERATOR_SOFT_LIGHT:
|
||||
@CAIRO_OPERATOR_DIFFERENCE:
|
||||
@CAIRO_OPERATOR_EXCLUSION:
|
||||
@CAIRO_OPERATOR_HSL_HUE:
|
||||
@CAIRO_OPERATOR_HSL_SATURATION:
|
||||
@CAIRO_OPERATOR_HSL_COLOR:
|
||||
@CAIRO_OPERATOR_HSL_LUMINOSITY:
|
||||
|
||||
<!-- ##### FUNCTION cairo_set_operator ##### -->
|
||||
<para>
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@ test_sources += $(test)
|
|||
TESTS += cairo-test-suite$(EXEEXT)
|
||||
|
||||
make-cairo-test-constructors$(EXEEXT): make-cairo-test-constructors.c
|
||||
$(CC) -o $@ make-cairo-test-constructors.c
|
||||
$(CC) $^ -o $@
|
||||
|
||||
cairo-test-constructors.c: Makefile $(test_sources) make-cairo-test-constructors$(EXEEXT)
|
||||
(cd $(srcdir) && ./make-cairo-test-constructors$(EXEEXT) $(test_sources)) > $@
|
||||
./make-cairo-test-constructors$(EXEEXT) $(srcdir) $(test_sources) > $@
|
||||
|
||||
cairo_test_suite_SOURCES = \
|
||||
$(cairo_test_suite_sources) \
|
||||
|
|
@ -121,9 +121,8 @@ cairo_test_trace_DEPENDENCIES = \
|
|||
endif
|
||||
|
||||
BUILT_SOURCES += cairo-test-constructors.c
|
||||
EXTRA_DIST += $(BUILT_SOURCES) $(noinst_SCRIPTS) COPYING
|
||||
CLEANFILES += $(BUILT_SOURCES)
|
||||
CLEANFILES += make-cairo-test-constructors
|
||||
EXTRA_DIST += $(BUILT_SOURCES) $(noinst_SCRIPTS) COPYING make-cairo-test-constructors.c
|
||||
CLEANFILES += $(BUILT_SOURCES) make-cairo-test-constructors
|
||||
|
||||
# All tests which have a reference image go here.
|
||||
REFERENCE_IMAGES = \
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#define NAME "make-cairo-test-constructors.c"
|
||||
|
||||
|
|
@ -115,16 +116,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");
|
||||
for (i = 2; i < argc; i++) {
|
||||
FILE *fp;
|
||||
|
||||
snprintf (buf, sizeof (buf), "%s/%s", argv[1], argv[i]);
|
||||
|
||||
fp = fopen (buf, "r");
|
||||
if (fp) {
|
||||
fail |= scan_file (argv[i], fp);
|
||||
fclose (fp);
|
||||
}
|
||||
} else
|
||||
fail = 1;
|
||||
}
|
||||
if (fail)
|
||||
exit(1);
|
||||
|
|
|
|||
76
util/cairo-script/csi-bind.c
Normal file
76
util/cairo-script/csi-bind.c
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
#include <cairo.h>
|
||||
#include <cairo-script-interpreter.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static cairo_status_t
|
||||
write_func (void *closure,
|
||||
const unsigned char *data,
|
||||
unsigned int length)
|
||||
{
|
||||
if (fwrite (data, length, 1, closure) != 1)
|
||||
return CAIRO_STATUS_WRITE_ERROR;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
FILE *in = stdin, *out = stdout;
|
||||
cairo_status_t status;
|
||||
int i;
|
||||
|
||||
if (argc >= 3) {
|
||||
if (strcmp (argv[argc-1], "-")) {
|
||||
out = fopen (argv[argc-1], "w");
|
||||
if (out == NULL) {
|
||||
fprintf (stderr, "Failed to open output '%s'\n", argv[argc-1]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
for (i = 1; i < argc - 1; i++) {
|
||||
in = fopen (argv[i], "r");
|
||||
if (in == NULL) {
|
||||
fprintf (stderr, "Failed to open input '%s'\n", argv[i]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
status = cairo_script_interpreter_translate_stream (in, write_func, out);
|
||||
fclose (in);
|
||||
|
||||
if (status)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (argc > 1) {
|
||||
if (strcmp (argv[1], "-")) {
|
||||
in = fopen (argv[1], "r");
|
||||
if (in == NULL) {
|
||||
fprintf (stderr, "Failed to open input '%s'\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
status = cairo_script_interpreter_translate_stream (in, write_func, out);
|
||||
|
||||
if (in != stdin)
|
||||
fclose (in);
|
||||
}
|
||||
|
||||
if (out != stdout)
|
||||
fclose (out);
|
||||
|
||||
if (status) {
|
||||
fprintf (stderr, "Translation failed: %s\n",
|
||||
cairo_status_to_string (status));
|
||||
return status;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue