Skip to content
Snippets Groups Projects
Commit dc9e5988 authored by Luigi Scarso's avatar Luigi Scarso
Browse files

cairo and pixman outside mp core.

parent 207fa316
No related branches found
No related tags found
No related merge requests found
......@@ -62,3 +62,32 @@ void mp_svg_backend_free (void *mp) {return;} /*
int mp_svg_ship_out (void *hh, int prologues) {mplibstuff_message(svg);return 1;}
int mp_svg_gr_ship_out (void *hh, int qprologues, int standalone) {mplibstuff_message(svg);return 1;}
@ @c
const char*
cairo_version_string (void);
const char*
pixman_version_string (void);
#define CAIRO_VERSION_STRING "CAIRO NOT AVAILABLE"
const char *COMPILED_CAIRO_VERSION_STRING = CAIRO_VERSION_STRING;
#define PIXMAN_VERSION_STRING "PIXMAN NOT AVAILABLE"
const char *COMPILED_PIXMAN_VERSION_STRING = PIXMAN_VERSION_STRING;
const char*
cairo_version_string (void)
{
return CAIRO_VERSION_STRING;
}
const char*
pixman_version_string (void)
{
return PIXMAN_VERSION_STRING;
}
@ @c
char png_libpng_ver[] = "PNG NOT AVAILABLE";
......@@ -10,8 +10,9 @@ EXTRA_LIBRARIES += libmplibcore.a libmplibbackends.a
libmplib_a_CPPFLAGS = $(MPFR_INCLUDES) $(GMP_INCLUDES) $(CAIRO_INCLUDES) $(PIXMAN_INCLUDES) \
$(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(AM_CPPFLAGS) -I$(srcdir)/mplibdir
libmplibcore_a_CPPFLAGS = $(libmplib_a_CPPFLAGS)
libmplibbackends_a_CPPFLAGS = $(libmplib_a_CPPFLAGS)
libmplibcore_a_CPPFLAGS = $(MPFR_INCLUDES) $(GMP_INCLUDES) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(AM_CPPFLAGS) -I$(srcdir)/mplibdir
libmplibbackends_a_CPPFLAGS = $(MPFR_INCLUDES) $(GMP_INCLUDES) $(CAIRO_INCLUDES) $(PIXMAN_INCLUDES) \
$(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(AM_CPPFLAGS) -I$(srcdir)/mplibdir
## libmplib C sources core + backends
nodist_libmplibcore_a_SOURCES = tfmin.c $(mp_c_h) $(mpmath_c_h) $(mpmathbinary_c_h) $(mpmathdecimal_c_h) \
......@@ -88,7 +89,7 @@ libmplib_web += mplibdir/mpmathdouble.w mplibdir/mpstrings.w mplibdir/tfmin.w
## core need headers backends
$(nodist_libmplibcore_a_SOURCES): $(svgout_c_h) $(pngout_c_h)
$(libmplibcore_a_OBJECTS): $(nodist_libmplibcore_a_SOURCES) $(KPATHSEA_DEPEND) $(CAIRO_DEPEND) $(MPFR_DEPEND)
$(libmplibcore_a_OBJECTS): $(nodist_libmplibcore_a_SOURCES) $(KPATHSEA_DEPEND) $(MPFR_DEPEND)
$(libmplibbackends_a_OBJECTS): $(nodist_libmplibbackends_a_SOURCES) $(KPATHSEA_DEPEND) $(CAIRO_DEPEND) $(MPFR_DEPEND)
......
% $Id: mp.w 2115 2017-02-01 13:56:12Z luigi $
% $Id: mp.w 2124 2017-03-08 13:15:13Z luigi $
%
% This file is part of MetaPost;
% the MetaPost program is in the public domain.
......@@ -176,18 +176,18 @@ static int DEBUGENVELOPECOUNTER=0;
#include <time.h> /* for struct tm \& co */
#include <zlib.h> /* for |ZLIB_VERSION|, zlibVersion() */
#include <png.h> /* for |PNG_LIBPNG_VER_STRING|, |png_libpng_ver| */
#include <pixman.h> /* for |PIXMAN_VERSION_STRING|, |pixman_version_string()| */
#include <cairo.h> /* for |CAIRO_VERSION_STRING|, |cairo_version_string()| */
/*\#include <pixman.h>*/ /* for |PIXMAN_VERSION_STRING|, |pixman_version_string()| */
/*\#include <cairo.h>*/ /* for |CAIRO_VERSION_STRING|, |cairo_version_string()| */
#include <gmp.h> /* for |gmp_version| */
#include <mpfr.h> /* for |MPFR_VERSION_STRING|, |mpfr_get_version()| */
#include "mplib.h"
#include "mplibps.h" /* external header */
#include "mplibsvg.h" /* external header */
#include "mplibpng.h" /* external header */
/*\#include "mplibsvg.h" */ /* external header */
/*\#include "mplibpng.h" */ /* external header */
#include "mpmp.h" /* internal header */
#include "mppsout.h" /* internal header */
#include "mpsvgout.h" /* internal header */
#include "mppngout.h" /* internal header */
/*\#include "mpsvgout.h"*/ /* internal header */
/*\#include "mppngout.h"*/ /* internal header */
#include "mpmath.h" /* internal header */
#include "mpmathdouble.h" /* internal header */
#include "mpmathdecimal.h" /* internal header */
......@@ -202,7 +202,24 @@ mp_number ueps_ap; /* epsilon for above approximations */
boolean is_dxdy, is_dxindyin;
/* END PATCH */
 
@ We move the {\tt cairo} and {\tt pixman} libraries outside {\tt mp.w},
to minimize dependencies.
 
@c
extern const char *COMPILED_CAIRO_VERSION_STRING;
extern const char* cairo_version_string (void);
extern const char *COMPILED_PIXMAN_VERSION_STRING;
extern const char* pixman_version_string (void);
extern void mp_png_backend_initialize (MP mp);
extern void mp_png_backend_free (MP mp);
extern int mp_png_gr_ship_out (void *hh, const char *options, int standalone);
extern int mp_png_ship_out (void *hh, const char *options);
extern void mp_svg_backend_initialize (MP mp);
extern void mp_svg_backend_free (MP mp);
extern int mp_svg_ship_out (mp_edge_object *hh, int prologues);
extern int mp_svg_gr_ship_out (mp_edge_object *hh, int prologues, int standalone);
@ @c
extern font_number mp_read_font_info (MP mp, char *fname); /* tfmin.w */
@h @<Declarations@>;
@<Basic printing procedures@>;
......@@ -30652,8 +30669,8 @@ char *mp_metapost_version (void) {
return mp_strdup (metapost_version);
}
void mp_show_library_versions (void) {
fprintf(stdout, "Compiled with cairo %s; using %s\n", CAIRO_VERSION_STRING, cairo_version_string());
fprintf(stdout, "Compiled with pixman %s; using %s\n", PIXMAN_VERSION_STRING, pixman_version_string());
fprintf(stdout, "Compiled with cairo %s; using %s\n", COMPILED_CAIRO_VERSION_STRING, cairo_version_string());
fprintf(stdout, "Compiled with pixman %s; using %s\n",COMPILED_PIXMAN_VERSION_STRING, pixman_version_string());
fprintf(stdout, "Compiled with libpng %s; using %s\n", PNG_LIBPNG_VER_STRING, png_libpng_ver);
fprintf(stdout, "Compiled with zlib %s; using %s\n", ZLIB_VERSION, zlibVersion());
fprintf(stdout, "Compiled with mpfr %s; using %s\n", MPFR_VERSION_STRING, mpfr_get_version());
......@@ -79,6 +79,9 @@ properly. That is |typedef struct pngout_data_struct * pngout_data|.
#ifndef MPPNGOUT_H
#define MPPNGOUT_H 1
#include "cairo.h"
const char *COMPILED_CAIRO_VERSION_STRING = CAIRO_VERSION_STRING;
#include "pixman.h"
const char *COMPILED_PIXMAN_VERSION_STRING = PIXMAN_VERSION_STRING;
#define PNG_SKIP_SETJMP_CHECK 1
#include "png.h"
#include "mplib.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment