changeset 7944:c2449e91f50a

configure.in: fix FTGL test to handle either FTGL/ftgl.h or ftgl.h
author John W. Eaton <jwe@octave.org>
date Fri, 18 Jul 2008 14:08:44 -0400
parents 7b8aca1cdf0a
children 456578a22388
files ChangeLog configure.in
diffstat 2 files changed, 58 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jul 18 13:00:52 2008 -0400
+++ b/ChangeLog	Fri Jul 18 14:08:44 2008 -0400
@@ -1,3 +1,9 @@
+2008-07-18  John W. Eaton  <jwe@octave.org>
+
+	* configure.in: Fix FTGL test to handle either FTGL/ftgl.h or ftgl.h.
+	(warn_freetype, warn_ftgl, warn_fltk_config, warn_fltk_opengl):
+	New variables.  Use these instead of overloading warn_graphics.
+
 2008-07-17  David Bateman  <dbateman@free.fr>
 
 	* configure.in (HAVE_MAGICK): New define for presence of
--- a/configure.in	Fri Jul 18 13:00:52 2008 -0400
+++ b/configure.in	Fri Jul 18 14:08:44 2008 -0400
@@ -649,21 +649,24 @@
 
 ## libraries needed for graphics
 
-warn_graphics=""
+warn_freetype=""
+warn_ftgl=""
 
 GL_RENDER_SRC=
 GRAPHICS_OPENGL=
 OCTAVE_OPENGL
-if test "x$OPENGL_LIBS" != "x"; then
+if test -n "$OPENGL_LIBS"; then
   GRAPHICS_OPENGL="opengl"
   GL_RENDER_SRC="gl-render.cc"
 
 ## ftgl (needs freetype 2)
   AC_CHECK_FT2([9.0.3],[],
-    [warn_graphics="FreeType library not found. Native renderer will not have on-screen text"])
-  if test "x$warn_graphics" = "x" ; then
+    [warn_freetype="FreeType library not found. Native renderer will not have on-screen text"])
+  if test -z "$warn_freetype"; then
     AC_LANG_PUSH(C++)
-      AC_CHECK_HEADERS([FTGL/ftgl.h ftgl.h], [
+      AC_CHECK_HEADERS([FTGL/ftgl.h ftgl.h])
+      if test "$ac_cv_header_FTGL_ftgl_h" = yes \
+        || test "$ac_cv_header_ftgl_h" = yes; then
 	AC_MSG_CHECKING([for FTGLTextureFont in -lftgl])
         save_LIBS="$LIBS"
 	save_CXXFLAGS="$CXXFLAGS"
@@ -681,11 +684,14 @@
           AC_DEFINE(HAVE_FTGL, 1, [Define to 1 if FTGL is present])
 	  AC_MSG_RESULT(yes)
 	  XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"],[
-	  AC_MSG_RESULT(no)])
+	  AC_MSG_RESULT(no)
+          warn_ftgl="FTGL library not found. Native renderer will not have on-screen text"
+        ])
 	LIBS="$save_LIBS"
 	CXXFLAGS="$save_CXXFLAGS"
-	],[
-          warn_graphics="FTGL library not found. Native renderer will not have on-screen text"])
+      else
+        warn_ftgl="FTGL headers not found. Native renderer will not have on-screen text"
+      fi
     AC_LANG_POP(C++)
   fi
 fi
@@ -704,14 +710,14 @@
         fltk_exec_prefix="$withval", 
         fltk_exec_prefix="")
 
-if test "x$fltk_exec_prefix" != x ; then
+if test -n "$fltk_exec_prefix"; 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
+if test -n "$fltk_prefix"; then
   fltk_args="$fltk_args --prefix=$fltk_prefix"
   if test x${FLTK_CONFIG+set} != xset ; then
     FLTK_CONFIG="$fltk_prefix/bin/fltk-config"
@@ -720,21 +726,24 @@
 
 AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
 
+warn_fltk_config=""
+warn_fltk_opengl=""
+
 if test "$FLTK_CONFIG" = "no" ; then
-  warn_graphics="fltk library (www.fltk.org) not found.  Native graphics will be disabled."
+  warn_fltk_config="FLTK config script 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)
+  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."
+    warn_fltk_opengl="FLTK does not have OpenGL support.  Native graphics will be disabled."
 
-  if test "x$warn_graphics" = "x" ; then
+  if test -z "$warn_fltk_opengl"; then
     AC_MSG_RESULT(yes)
     GRAPHICS_CFLAGS="$FLTK_CFLAGS"
     GRAPHICS_LIBS="$FLTK_LDFLAGS"
@@ -2024,7 +2033,7 @@
   Default pager:        $DEFAULT_PAGER
   gnuplot:              $GNUPLOT
   OPENGL libraries:     $OPENGL_LIBS
-  fltk backend libs:    $GRAPHICS_LIBS
+  FLTK backend libs:    $GRAPHICS_LIBS
   Magick config:        $MAGICK_CONFIG
 
   Do internal array bounds checking:  $BOUNDS_CHECKING
@@ -2230,8 +2239,34 @@
   warn_msg_printed=true
 fi
 
-if test -n "$warn_graphics"; then
-  AC_MSG_WARN($warn_graphics)
+native_graphics=true
+if test -n "$warn_freetype"; then
+  AC_MSG_WARN("$warn_freetype")
+  native_graphics=false
+  warn_msg_printed=true
+fi
+
+if test -n "$warn_ftgl"; then
+  AC_MSG_WARN("$warn_ftgl")
+  native_graphics=false
+  warn_msg_printed=true
+fi
+
+if test -n "$warn_fltk_config"; then
+  AC_MSG_WARN("$warn_fltk_config")
+  native_graphics=false
+  warn_msg_printed=true
+fi
+
+if test -n "$warn_fltk_opengl"; then
+  AC_MSG_WARN("$warn_fltk_opengl")
+  native_graphics=false
+  warn_msg_printed=true
+fi
+
+if $native_graphics; then
+  true;
+else
   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])