[m-rev.] diff: add makefiles etc for the cairo binding

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Sep 8 01:15:28 AEST 2010


Add makefiles and Mercury.options files for the cairo binding and examples.

extras/graphics/mercury_cairo/Cairo.options:
 	System specific build variables for the cairo binding.
 	(The current values are for the MacPorts port of cairo.)

extras/graphics/mercury_cairo/Mercury.options:
 	Options for building and installing libmercury_cairo.

extras/graphics/mercury_cairo/samples/Makefile:
extras/graphics/mercury_cairo/samples/Mercury.options:
extras/graphics/mercury_cairo/tutorial/Makefile:
extras/graphics/mercury_cairo/tutorial/Mercury.options:
 	Stuff for building the tutorial examples and the samples.

extras/graphics/mercury_cairo/*/.cvsignore:
 	Ignore generated files.

Julien.

Index: .cvsignore
===================================================================
RCS file: .cvsignore
diff -N .cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .cvsignore	7 Sep 2010 15:07:49 -0000
@@ -0,0 +1,3 @@
+Mercury
+*.mh
+*.err
Index: Cairo.options
===================================================================
RCS file: Cairo.options
diff -N Cairo.options
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Cairo.options	7 Sep 2010 15:07:49 -0000
@@ -0,0 +1,25 @@
+# This file contains system-specific information about where to install the
+# Mercury cairo binding and how to compile and link it against the cairo
+# itself.  If your system has the pkg-config tool then you can use that as
+# shown below to find the necessary information.
+
+# NOTE: the current values of CAIRO_CFLAGS and CAIRO_LDFLAGS are for the
+# MacPorts (<http://www.macports.org/> port of cairo on Mac OS X.
+# They will probably not work on other systems.
+
+# Where are we going to install the Mercury cairo binding?
+#
+INSTALL_PREFIX=.
+
+# What flags do we need to pass to the C compiler in order to compile
+# against cairo? 
+# Use "pkg-config --cflags cairo" to work this and substitute the result
+# as the value of CAIRO_CFLAGS.
+#
+CAIRO_CFLAGS="-I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng12"
+
+# What flags do we need to pass to the linker in order to link against cairo?
+# Use "pkg-config --libs cairo" here and substitute the result as the value
+# of CAIRO_LDFLAGS.
+#
+CAIRO_LDFLAGS="-L/opt/local/lib -lcairo -lpixman-1 -lfontconfig -lexpat -liconv -lfreetype -lpng12 -lz -lXrender -lX11 -lxcb -lXau -lXdmcp"
Index: Mercury.options
===================================================================
RCS file: Mercury.options
diff -N Mercury.options
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Mercury.options	7 Sep 2010 15:07:49 -0000
@@ -0,0 +1,14 @@
+include Cairo.options
+
+# The cairo binding only works in C grades.
+# It does not work with single-precision floats.
+#
+MCFLAGS = \
+	--libgrades-exclude java 					\
+	--libgrades-exclude erlang 					\
+	--libgrades-exclude spf						\
+	--install-prefix $(INSTALL_PREFIX)				\
+	--cflags $(CAIRO_CFLAGS)					\
+	--ld-flags $(CAIRO_LDFLAGS)
+
+MCFLAGS-mercury_cairo = --no-warn-nothing-exported --no-warn-interface-imports
Index: samples/Makefile
===================================================================
RCS file: samples/Makefile
diff -N samples/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ samples/Makefile	7 Sep 2010 15:07:49 -0000
@@ -0,0 +1,34 @@
+include ../Cairo.options
+
+MMC=mmc
+
+PROGS=\
+	arc			\
+	arc_negative		\
+	clip			\
+	clip_image		\
+	curve_to		\
+	dash			\
+	fill_and_stroke2	\
+	fill_style		\
+	gradient		\
+	hello			\
+	image			\
+	imagepattern		\
+	multi_segment_caps	\
+	set_line_cap		\
+	set_line_join		\
+	text			\
+	text_align_center	\
+	text_extents
+
+.PHONY: all
+all:
+	$(MMC) --make $(PROGS)
+
+.PHONY: realclean
+realclean:
+	for prog in $(PROGS); do \
+		$(MMC) --make $$prog.realclean; \
+	done
+	/bin/rm -rf Mercury
Index: samples/Mercury.options
===================================================================
RCS file: samples/Mercury.options
diff -N samples/Mercury.options
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ samples/Mercury.options	7 Sep 2010 15:07:49 -0000
@@ -0,0 +1,13 @@
+include ../Cairo.options
+
+# Where is the mercury_cairo library installed?
+# The current value works when it is installed in the parent directory.
+# You will need to modify it if that is not the case.
+#
+MERCURY_CAIRO_DIR=../lib/mercury
+
+MCFLAGS = \
+	--ml mercury_cairo			\
+	--mld $(MERCURY_CAIRO_DIR)		\
+	--cflags $(CAIRO_CFLAGS)		\
+	--ld-flags $(CAIRO_LDFLAGS)
Index: tutorial/.cvsignore
===================================================================
RCS file: tutorial/.cvsignore
diff -N tutorial/.cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tutorial/.cvsignore	7 Sep 2010 15:07:49 -0000
@@ -0,0 +1,14 @@
+Mercury
+*.err
+*.mh
+fill
+mask
+paint
+path_close
+setsourcegradient
+setsourcergba
+showtext
+stroke
+textextents
+tips_ellipse
+tips_letter
Index: tutorial/Makefile
===================================================================
RCS file: tutorial/Makefile
diff -N tutorial/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tutorial/Makefile	7 Sep 2010 15:07:49 -0000
@@ -0,0 +1,27 @@
+include ../Cairo.options
+
+MMC=mmc
+
+PROGS=\
+	fill			\
+	mask			\
+	paint			\
+	path_close		\
+	setsourcegradient	\
+	setsourcergba		\
+	showtext		\
+	stroke			\
+	textextents		\
+	tips_ellipse		\
+	tips_letter
+
+.PHONY: all
+all:
+	$(MMC) --make $(PROGS)
+
+.PHONY: realclean
+realclean:
+	for prog in $(PROGS); do \
+		$(MMC) --make $$prog.realclean; \
+	done
+	/bin/rm -rf Mercury
Index: tutorial/Mercury.options
===================================================================
RCS file: tutorial/Mercury.options
diff -N tutorial/Mercury.options
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tutorial/Mercury.options	7 Sep 2010 15:07:49 -0000
@@ -0,0 +1,13 @@
+include ../Cairo.options
+
+# Where is the mercury_cairo library installed?
+# The current value works when it is installed in the parent directory.
+# You will need to modify it if that is not the case.
+#
+MERCURY_CAIRO_DIR=../lib/mercury
+
+MCFLAGS = \
+	--ml mercury_cairo			\
+	--mld $(MERCURY_CAIRO_DIR)		\
+	--cflags $(CAIRO_CFLAGS)		\
+	--ld-flags $(CAIRO_LDFLAGS)

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list