[Tux4kids-commits] r1033 - tuxmath/trunk tuxmath/trunk/src tuxtype/trunk

Bolesław Kulbabiński bolekk-guest at alioth.debian.org
Thu Jun 11 23:41:08 UTC 2009


Author: bolekk-guest
Date: 2009-06-11 23:41:08 +0000 (Thu, 11 Jun 2009)
New Revision: 1033

Modified:
   tuxmath/trunk/CMakeLists.txt
   tuxmath/trunk/configure.ac
   tuxmath/trunk/src/CMakeLists.txt
   tuxmath/trunk/src/globals.h
   tuxtype/trunk/configure.ac
Log:
Changed autotools and cmake configuration to allow building with earlier versions of librsvg and cairo

Modified: tuxmath/trunk/CMakeLists.txt
===================================================================
--- tuxmath/trunk/CMakeLists.txt	2009-06-11 21:13:31 UTC (rev 1032)
+++ tuxmath/trunk/CMakeLists.txt	2009-06-11 23:41:08 UTC (rev 1033)
@@ -112,7 +112,10 @@
   include(FindPkgConfig)
   PKG_CHECK_MODULES(RSVG librsvg-2.0)
   if(RSVG_FOUND)
-    set(HAVE_RSVG 1)  # For the config.h file
+    PKG_CHECK_MODULES(CAIRO cairo)
+    if(CAIRO_FOUND)
+      set(HAVE_RSVG 1)  # For the config.h file
+    endif(CAIRO_FOUND)
   endif(RSVG_FOUND)
 endif(PKG_CONFIG_FOUND)
 

Modified: tuxmath/trunk/configure.ac
===================================================================
--- tuxmath/trunk/configure.ac	2009-06-11 21:13:31 UTC (rev 1032)
+++ tuxmath/trunk/configure.ac	2009-06-11 23:41:08 UTC (rev 1033)
@@ -113,7 +113,7 @@
              [AC_MSG_ERROR([SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf])])
 fi
 
-dnl Check for libRSVG. SVG support is enabled by default
+dnl Check for libRSVG and cairo. SVG support is enabled by default
 
 AC_ARG_WITH([rsvg],
             [AS_HELP_STRING([--without-rsvg],[don't use libRSVG even if available])],
@@ -124,25 +124,32 @@
   RSVG_CFLAGS=""
   RSVG_LIBS=""
   PKG_CHECK_MODULES([RSVG],
-                    [librsvg-2.0 >= 2.22],
+                    [librsvg-2.0 >= 2.18],
                     ,
                     [AC_MSG_FAILURE([libRSVG test failed (--without-rsvg to disable svg support)])])
   CFLAGS="$CFLAGS $RSVG_CFLAGS"
   LIBS="$LIBS $RSVG_LIBS"
+fi
+
+if test "x$with_rsvg" = xyes; then
+  CAIRO_CFLAGS=""
+  CAIRO_LIBS=""
+  PKG_CHECK_MODULES([CAIRO],
+                    [cairo >= 1.4.10],
+                    ,
+                    [AC_MSG_FAILURE([cairo test failed (--without-rsvg to disable svg support)])])
+  CFLAGS="$CFLAGS $CAIRO_CFLAGS"
+  LIBS="$LIBS $CAIRO_LIBS"
   AC_DEFINE([HAVE_RSVG],[1],[Define to 1 if you have the `libRSVG` library])
 fi
 
-
-
 dnl Check for (somewhat) higher-level math functions - needed for SDL_extras
-AC_CHECK_LIB([m],
-             [csin],
-             ,
-             [AC_MSG_ERROR([Math library not found - functions in <math.h> may not be available.])])
+dnl AC_CHECK_LIB([m],
+dnl              [csin],
+dnl              ,
+dnl              [AC_MSG_ERROR([Math library not found - functions in <math.h> may not be available.])])
 
 
-
-
 # --------------------------------------------------------------------------------------
 # Checks for header files.
 # --------------------------------------------------------------------------------------

Modified: tuxmath/trunk/src/CMakeLists.txt
===================================================================
--- tuxmath/trunk/src/CMakeLists.txt	2009-06-11 21:13:31 UTC (rev 1032)
+++ tuxmath/trunk/src/CMakeLists.txt	2009-06-11 23:41:08 UTC (rev 1033)
@@ -98,16 +98,26 @@
   set(_rsvg_cflags "${_rsvg_cflags} ${f}")
 endforeach(f)
 
+set(_cairo_cflags "")
+foreach(f ${CAIRO_CFLAGS})
+  set(_cairo_cflags "${_cairo_cflags} ${f}")
+endforeach(f)
+
 set(_rsvg_ldflags "")
 foreach(f ${RSVG_LDFLAGS})
   set(_rsvg_ldflags "${_rsvg_ldflags} ${f}")
 endforeach(f)
 
+set(_cairo_ldflags "")
+foreach(f ${CAIRO_LDFLAGS})
+  set(_cairo_ldflags "${_cairo_ldflags} ${f}")
+endforeach(f)
+
 set_target_properties (
   tuxmath
   PROPERTIES COMPILE_FLAGS
-  "-DDATA_PREFIX=\\\"${TUXMATH_DATA_PREFIX}\\\" -DVERSION=\\\"${TUXMATH_VERSION}\\\" -DLOCALEDIR=\\\"${LOCALE_DIR}\\\" -DPACKAGE=\\\"tuxmath\\\" ${_rsvg_cflags}"
-  LINK_FLAGS "${_rsvg_ldflags}"
+  "-DDATA_PREFIX=\\\"${TUXMATH_DATA_PREFIX}\\\" -DVERSION=\\\"${TUXMATH_VERSION}\\\" -DLOCALEDIR=\\\"${LOCALE_DIR}\\\" -DPACKAGE=\\\"tuxmath\\\" ${_rsvg_cflags} ${_cairo_cflags}"
+  LINK_FLAGS "${_rsvg_ldflags} ${_cairo_ldflags}"
   )
 
 target_link_libraries (tuxmath

Modified: tuxmath/trunk/src/globals.h
===================================================================
--- tuxmath/trunk/src/globals.h	2009-06-11 21:13:31 UTC (rev 1032)
+++ tuxmath/trunk/src/globals.h	2009-06-11 23:41:08 UTC (rev 1033)
@@ -61,8 +61,8 @@
 extern const int debug_all;
 
 /* debug macros */
-#define DEBUGCODE(mask) if(mask & debug_status)
-#define DEBUGMSG(mask, ...) if(mask & debug_status){ fprintf(stderr, __VA_ARGS__); fflush(stderr); }
+#define DEBUGCODE(mask) if((mask) & debug_status)
+#define DEBUGMSG(mask, ...) if((mask) & debug_status){ fprintf(stderr, __VA_ARGS__); fflush(stderr); }
 
 /* Maximum length of file path: */
 #define PATH_MAX 4096

Modified: tuxtype/trunk/configure.ac
===================================================================
--- tuxtype/trunk/configure.ac	2009-06-11 21:13:31 UTC (rev 1032)
+++ tuxtype/trunk/configure.ac	2009-06-11 23:41:08 UTC (rev 1033)
@@ -120,7 +120,7 @@
              [AC_MSG_ERROR([SDL_ttf not found! http://www.libsdl.org/projects/SDL_ttf])])
 fi
 
-dnl Check for libRSVG. SVG support is enabled by default
+dnl Check for libRSVG and cairo. SVG support is enabled by default
 
 AC_ARG_WITH([rsvg],
             [AS_HELP_STRING([--without-rsvg],[don't use libRSVG even if available])],
@@ -131,19 +131,30 @@
   RSVG_CFLAGS=""
   RSVG_LIBS=""
   PKG_CHECK_MODULES([RSVG],
-                    [librsvg-2.0 >= 2.22],
+                    [librsvg-2.0 >= 2.18],
                     ,
                     [AC_MSG_FAILURE([libRSVG test failed (--without-rsvg to disable svg support)])])
   CFLAGS="$CFLAGS $RSVG_CFLAGS"
   LIBS="$LIBS $RSVG_LIBS"
+fi
+
+if test "x$with_rsvg" = xyes; then
+  CAIRO_CFLAGS=""
+  CAIRO_LIBS=""
+  PKG_CHECK_MODULES([CAIRO],
+                    [cairo >= 1.4.10],
+                    ,
+                    [AC_MSG_FAILURE([cairo test failed (--without-rsvg to disable svg support)])])
+  CFLAGS="$CFLAGS $CAIRO_CFLAGS"
+  LIBS="$LIBS $CAIRO_LIBS"
   AC_DEFINE([HAVE_RSVG],[1],[Define to 1 if you have the `libRSVG` library])
 fi
 
 dnl Check for (somewhat) higher-level math functions - needed for SDL_extras
-AC_CHECK_LIB([m],
-             [csin],
-             ,
-             [AC_MSG_ERROR([Math library not found - functions in <math.h> may not be available.])])
+dnl AC_CHECK_LIB([m],
+dnl              [csin],
+dnl              ,
+dnl              [AC_MSG_ERROR([Math library not found - functions in <math.h> may not be available.])])
 
 
 # --------------------------------------------------------------------------------------




More information about the Tux4kids-commits mailing list