changeset 20131:bb59bdbdb8ac

Fix compilation error when building with OSMesa but without gl2ps (bug #44870) * __osmesa_print__.cc (F__osmesa_print__): Add #ifdef HAVE_GL2PS_H block around section that requires gl2ps. Add HAVE_GL2PS_H to %!tests.
author Andreas Weber <andy.weber.aw@gmail.com>
date Sun, 19 Apr 2015 10:13:04 -0400
parents c164cfc24bdd
children 1f9ed81bd173
files libinterp/dldfcn/__osmesa_print__.cc
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__osmesa_print__.cc	Sun Apr 19 09:54:54 2015 -0400
+++ b/libinterp/dldfcn/__osmesa_print__.cc	Sun Apr 19 10:13:04 2015 -0400
@@ -176,6 +176,9 @@
   if (nargin == 3)
     {
       // use gl2ps
+#ifndef HAVE_GL2PS_H
+      gripe_disabled_feature ("__osmesa_print__", "gl2ps");
+#else
       std::string file = args(1).string_value ();
       std::string term = args(2).string_value ();
 
@@ -215,6 +218,7 @@
                 error ("__osmesa_print__: Couldn't create file \"%s\"", file.c_str ());
             }
         }
+#endif
     }
   else
     {
@@ -261,7 +265,7 @@
 ##        This is not critical, since this facility will mostly be used in
 ##        the future for generating the images in Octave's own documentation.
 ##        For the moment, disable these tests on PC's and Macs.
-%!testif HAVE_OSMESA
+%!testif HAVE_OSMESA, HAVE_GL2PS_H
 %! if (isunix ())
 %!   h = figure ("visible", "off");
 %!   fn = tempname ();
@@ -276,7 +280,7 @@
 %!   assert (img_fp, [52942515; 54167797; 56158178], -0.05);
 %! endif
 
-%!testif HAVE_OSMESA
+%!testif HAVE_OSMESA, HAVE_GL2PS_H
 %! if (isunix ())
 %!   h = figure ("visible", "off");
 %!   fn = tempname ();