changeset 15503:dca1f2bcccf3

don't register fltk toolkit if compiling without FLTK (bug #37541) * __init_fltk__.cc (F__have_fltk__): New function. Use it in PKG_ADD line to decide whether to register fltk toolkit.
author John W. Eaton <jwe@octave.org>
date Thu, 11 Oct 2012 14:16:10 -0400
parents 312d544de165
children bd947371c2c9
files libinterp/dldfcn/__init_fltk__.cc
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__init_fltk__.cc	Thu Oct 11 12:59:49 2012 -0400
+++ b/libinterp/dldfcn/__init_fltk__.cc	Thu Oct 11 14:16:10 2012 -0400
@@ -29,7 +29,7 @@
 
 */
 
-// PKG_ADD: register_graphics_toolkit ("fltk");
+// PKG_ADD: if (__have_fltk__ ()) register_graphics_toolkit ("fltk"); endif
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -2029,6 +2029,19 @@
 
 #endif
 
+DEFUN_DLD (__have_fltk__, , , "")
+{
+  octave_value retval;
+
+#if defined (HAVE_FLTK)
+  retval = true;
+#else
+  retval = false;
+#endif
+
+  return retval;
+}
+
 // FIXME -- This function should be abstracted and made potentially
 // available to all graphics toolkits.  This suggests putting it in
 // graphics.cc as is done for drawnow() and having the master
@@ -2126,4 +2139,3 @@
   return octave_value ();
 #endif
 }
-