Browse Source

Add cairo option to libraster

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32596 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 16 years ago
parent
commit
d4d51ba2bb
4 changed files with 19 additions and 26 deletions
  1. 1 4
      lib/Makefile
  2. 5 22
      lib/cairodriver/Makefile
  3. 7 0
      lib/raster/Makefile
  4. 6 0
      lib/raster/raster.c

+ 1 - 4
lib/Makefile

@@ -10,6 +10,7 @@ SUBDIRS = \
 	pngdriver \
 	psdriver \
 	htmldriver \
+	cairodriver \
 	raster \
 	bitmap \
 	btree \
@@ -48,10 +49,6 @@ ifneq ($(strip $(OPENGLLIB)),)
     SUBDIRS += $(OPENGLBASED)
 endif
 
-ifneq ($(USE_CAIRO),)
-    SUBDIRS += cairodriver
-endif
-
 #compile if C++ compiler present:
 ifneq ($(strip $(CXX)),)
     SUBDIRS += iostream

+ 5 - 22
lib/cairodriver/Makefile

@@ -11,28 +11,11 @@ EXTRA_LIBS=$(DRIVERLIB) $(GISLIB) $(CAIROLIB)
 # added constant to /include/Make/Grass.make.in
 LIB_NAME = $(CAIRODRIVER_LIBNAME)
 
-LIB_OBJS = \
-	Driver.o	\
-	Client.o	\
-	Box.o		\
-	Graph.o		\
-	Erase.o		\
-	Set_window.o	\
-	Line_width.o	\
-	Draw_line.o	\
-	Draw_bitmap.o	\
-	Draw_point.o	\
-	Poly.o		\
-	Raster.o	\
-	Respond.o	\
-	Color.o		\
-	read.o		\
-	read_bmp.o	\
-	read_ppm.o	\
-	write.o		\
-	write_bmp.o	\
-	write_ppm.o
-
 include $(MODULE_TOPDIR)/include/Make/Lib.make
 
+ifneq ($(USE_CAIRO),)
 default: lib
+else
+default:
+endif
+

+ 7 - 0
lib/raster/Makefile

@@ -1,5 +1,7 @@
 MODULE_TOPDIR = ../..
 
+include $(MODULE_TOPDIR)/include/Make/Platform.make
+
 PACKAGE ="libraster"
 DEFS=-DPACKAGE=\"$(PACKAGE)\"
 EXTRA_CFLAGS=$(GETHOSTNAME) $(FTINC) -I../driver $(PICFLAGS) $(DEFS)
@@ -7,6 +9,11 @@ EXTRA_CFLAGS=$(GETHOSTNAME) $(FTINC) -I../driver $(PICFLAGS) $(DEFS)
 EXTRA_LIBS=$(DRIVERLIB) $(GISLIB) $(PNGDRIVERLIB) $(PSDRIVERLIB) $(HTMLDRIVERLIB)
 LIB_NAME = $(RASTER_LIBNAME)
 
+ifneq ($(USE_CAIRO),)
+EXTRA_LIBS +=  $(CAIRODRIVERLIB)
+EXTRA_CFLAGS += -DUSE_CAIRO
+endif
+
 include $(MODULE_TOPDIR)/include/Make/Lib.make
 include $(MODULE_TOPDIR)/include/Make/Doxygen.make
 

+ 6 - 0
lib/raster/raster.c

@@ -18,6 +18,9 @@
 extern const struct driver *PNG_Driver(void);
 extern const struct driver *PS_Driver(void);
 extern const struct driver *HTML_Driver(void);
+#ifdef USE_CAIRO
+extern const struct driver *Cairo_Driver(void);
+#endif
 
 static void init(void)
 {
@@ -42,6 +45,9 @@ int R_open_driver(void)
     const struct driver *drv =
 	(p && G_strcasecmp(p, "PS") == 0) ? PS_Driver() :
 	(p && G_strcasecmp(p, "HTML") == 0) ? HTML_Driver() :
+#ifdef USE_CAIRO
+	(p && G_strcasecmp(p, "cairo") == 0) ? Cairo_Driver() :
+#endif
 	PNG_Driver();
 
     LIB_init(drv, 0, NULL);