changeset 7937:6661387827d6

Allow build without GraphicsMagick installed
author David Bateman <dbateman@free.fr>
date Thu, 17 Jul 2008 11:43:26 +0200
parents 78400fde223e
children bf4a04ebff21
files ChangeLog configure.in src/ChangeLog src/DLD-FUNCTIONS/__magick_read__.cc
diffstat 4 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jul 17 07:58:50 2008 -0400
+++ b/ChangeLog	Thu Jul 17 11:43:26 2008 +0200
@@ -1,3 +1,8 @@
+2008-07-17  David Bateman  <dbateman@free.fr>
+
+	* configure.in (HAVE_MAGICK): New define for presence of
+	GraphicsMagick.
+
 2008-07-16  Michael Goffioul  <michael.goffioul@gmail.com>
 
 	* configure.in: Add check for pthread.h.
--- a/configure.in	Thu Jul 17 07:58:50 2008 -0400
+++ b/configure.in	Thu Jul 17 11:43:26 2008 +0200
@@ -641,6 +641,8 @@
 AC_CHECK_PROGS(MAGICK_CONFIG, [GraphicsMagick++-config GraphicsMagick-config])
 if test -z "$MAGICK_CONFIG"; then
   warn_magick="GraphicsMagick++ config script not found.  Assuming GraphicsMagic++ library and header files are missing, so imread will not be fully functional"
+else
+  AC_DEFINE(HAVE_MAGICK, 1, [Define if GraphicsMagick++ is available.])
 fi
 
 # ---------------------------------------------------------------------
--- a/src/ChangeLog	Thu Jul 17 07:58:50 2008 -0400
+++ b/src/ChangeLog	Thu Jul 17 11:43:26 2008 +0200
@@ -48,6 +48,11 @@
 	(GO_BODY): Likewise.
 	(Fdrawnow): Support single "expose" argument.
 
+2008-07-17  David Bateman  <dbateman@free.fr>
+
+	* DLD-FUNCTION/__magick_read__.cc (F__magick_read__): Allow build
+	without GraphicsMagick++ installed.
+
 2008-07-15  John W. Eaton  <jwe@octave.org>
 
 	* DLD-FUNCTIONS/__convn__.cc (convn): Cast second arg to
--- a/src/DLD-FUNCTIONS/__magick_read__.cc	Thu Jul 17 07:58:50 2008 -0400
+++ b/src/DLD-FUNCTIONS/__magick_read__.cc	Thu Jul 17 11:43:26 2008 +0200
@@ -28,6 +28,8 @@
 #include "defun-dld.h"
 #include "error.h"
 
+#ifdef HAVE_MAGICK
+
 #include <GraphicsMagick/Magick++.h>
 
 unsigned int
@@ -303,6 +305,7 @@
 
   return retval;
 }
+#endif // HAVE_MAGICK
 
 DEFUN_DLD (__magick_read__, args, nargout,
   "-*- texinfo -*-\n\
@@ -316,6 +319,7 @@
 {
   octave_value_list output;
 
+#ifdef HAVE_MAGICK
   if (args.length () > 2 || args.length () < 1 || ! args(0).is_string ()
       || nargout > 3)
     {
@@ -401,6 +405,11 @@
 	  error ("__magick_read__: image depths bigger than 16-bit not supported");
 	}
     }
+#else
+
+  error ("__magick_read__: not available in this version of Octave");
+
+#endif
 
   return output;
 }