Mercurial > hg > octave-nkf
changeset 12450:47612d3e7077
use AC_COMPILE_IFELSE to check for OpenGL support in FLTK
author | Benjamin Lindner <lindnerb@users.sourceforge.net> |
---|---|
date | Tue, 15 Feb 2011 12:53:17 -0500 |
parents | 2f0d1e12806d |
children | c6c3fdbfede2 |
files | ChangeLog configure.ac |
diffstat | 2 files changed, 18 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-02-15 Benjamin Lindner <lindnerb@users.sourceforge.net> + + * configure.ac: Use AC_COMPILE_IFELSE to check for OpenGL + support in FLTK. + 2011-02-09 John W. Eaton <jwe@octave.org> * NEWS: Update.
--- a/configure.ac +++ b/configure.ac @@ -914,21 +914,23 @@ esac 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_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled." - + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $FLTK_CFLAGS" + AC_COMPILE_IFELSE( + AC_LANG_PROGRAM([[#include <FL/gl.h>]], [[int nothing = 0;]]), + [ + AC_MSG_RESULT([no]) + warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled." + ],[ + AC_DEFINE(HAVE_FLTK, 1, [Define if FLTK is available]) + AC_MSG_RESULT([yes]) + ]) + if test -z "$warn_fltk_opengl"; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FLTK, 1, [Define if FLTK is available]) GRAPHICS_CFLAGS="$FLTK_CFLAGS" GRAPHICS_LIBS="$FLTK_LDFLAGS" - else - AC_MSG_RESULT(no) fi + CFLAGS="$save_CFLAGS" fi fi