diff configure.in @ 7834:caab78e7e377

added checks for fltk & freetype in configure script * * * added fltk_backend * * * the fltk_backend now works but that's about it * * * fltk_backend now working * * * updated ChangeLogs with all changes * * * reverted backend::close_figure to using __plot_stream__ moved OpenGL includes into gl-render.h removed check for FL/glu.h * * * configure.in: fix unquoted variable warn_graphics. * * * fixed fltk test in configure.in and also some minor style problems
author Shai Ayal <shaiay@sourceforge.net>
date Sun, 17 Feb 2008 19:20:42 +0200
parents 13871b7de124
children 2a62d45fa21d
line wrap: on
line diff
--- a/configure.in	Wed Feb 20 16:29:37 2008 +0100
+++ b/configure.in	Sun Feb 17 19:20:42 2008 +0200
@@ -636,6 +636,79 @@
 fi
 
 
+# ---------------------------------------------------------------------
+
+## libraries needed for graphics
+
+GRAPHICS_OPENGL=
+OCTAVE_OPENGL
+if test "x$OPENGL_LIBS" != "x"; then
+  GRAPHICS_OPENGL="opengl"
+fi
+
+
+GRAPHICS_LIBS=
+GRAPHICS_CFLAGS=
+
+## fltk (www.fltk.org)
+AC_ARG_WITH(fltk-prefix,
+        [  --with-fltk-prefix=PFX   Prefix where FLTK is installed (optional)],
+        fltk_prefix="$withval",
+        fltk_prefix="")
+AC_ARG_WITH(fltk-exec-prefix,
+        [  --with-fltk-exec-prefix=PFX Exec prefix where FLTK is installed (optional)],
+        fltk_exec_prefix="$withval", 
+        fltk_exec_prefix="")
+
+if test "x$fltk_exec_prefix" != x ; then
+  fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix"
+  if test "x${FLTK_CONFIG+set}" != xset ; then
+    FLTK_CONFIG="$fltk_exec_prefix/bin/fltk-config"
+  fi
+fi
+
+if test "x$fltk_prefix" != x ; then
+  fltk_args="$fltk_args --prefix=$fltk_prefix"
+  if test x${FLTK_CONFIG+set} != xset ; then
+    FLTK_CONFIG="$fltk_prefix/bin/fltk-config"
+  fi
+fi
+
+AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
+
+warn_graphics=""
+if test "$FLTK_CONFIG" = "no" ; then
+  warn_graphics="fltk library (www.fltk.org) not found.  Native graphics will be disabled."
+else
+  FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`"
+  FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`"
+  
+  AC_MSG_CHECKING(for OpenGL support in fltk)
+  cat > conftest.cc <<EOF
+  #include <FL/gl.h>
+  int nothing=0;
+EOF
+  $CXX $CXXFLAGS $FLTK_CFLAGS -c conftest.cc || \
+    warn_graphics="fltk does not have OpenGL support.  Native graphics will be disabled."
+
+  if test "x$warn_graphics" = "x" ; then
+    AC_MSG_RESULT(yes)
+    ## FTGL flags
+    AC_CHECK_FT2([9.0.3],[],
+             [warn_graphics="FreeType library not found. Native graphics will be disabled."])
+
+    GRAPHICS_CFLAGS="$FLTK_CFLAGS $FT2_CFLAGS"
+    GRAPHICS_LIBS="$FLTK_LDFLAGS $FT2_LIBS"
+    GRAPHICS_OPENGL="$GRAPHICS_OPENGL fltk_backend" 
+  else
+    AC_MSG_RESULT(no)
+  fi
+fi
+
+AC_SUBST(GRAPHICS_CFLAGS)
+AC_SUBST(GRAPHICS_LIBS)
+AC_SUBST(GRAPHICS_OPENGL)
+
 OCTAVE_IEEE754_DATA_FORMAT
 
 # ----------------------------------------------------------------------
@@ -1613,15 +1686,6 @@
   ;;
 esac
 
-## Graphics related stuffs
-
-GRAPHICS_OPENGL=
-OCTAVE_OPENGL
-if test "x$OPENGL_LIBS" != "x"; then
-  GRAPHICS_OPENGL="opengl"
-fi
-AC_SUBST(GRAPHICS_OPENGL)
-
 ### Checks for other programs used for building, testing, installing,
 ### and running Octave.
 
@@ -1878,7 +1942,7 @@
   libcruft/slatec-err/Makefile libcruft/villad/Makefile
   libcruft/blas-xtra/Makefile libcruft/lapack-xtra/Makefile
   src/graphics/Makefile src/graphics/Makerules
-  src/graphics/opengl/Makefile])
+  src/graphics/opengl/Makefile src/graphics/fltk_backend/Makefile])
 AC_OUTPUT
 
 AC_CONFIG_COMMANDS([default-1],[[chmod +x install-octave]],[[]])
@@ -1915,6 +1979,7 @@
   CURL libraries:       $CURL_LIBS
   REGEX libraries:      $REGEX_LIBS
   QHULL libraries:	$QHULL_LIBS
+  GRAPHICS libraries    $GRAPHICS_LIBS
   LIBS:                 $LIBS
   Default pager:        $DEFAULT_PAGER
   gnuplot:              $GNUPLOT
@@ -2117,6 +2182,17 @@
   warn_msg_printed=true
 fi
 
+if test -n "$warn_graphics"; then
+  AC_MSG_WARN($warn_graphics)
+  AC_MSG_WARN([])
+  AC_MSG_WARN([I didn't find the necessary libraries to compile native])
+  AC_MSG_WARN([graphics. It isn't necessary to have native graphics])
+  AC_MSG_WARN([but you will have to use gnuplot or you won't be able])
+  AC_MSG_WARN([to use any of Octave's plotting commands])
+  AC_MSG_WARN([])
+  warn_msg_printed=true
+fi
+
 if $warn_msg_printed; then
   AC_MSG_NOTICE([