# HG changeset patch # User Sebastian Schoeps # Date 1421375194 18000 # Node ID 27c5f42a7a64117a589b8172054c9d43b5c9d40e # Parent 2058d87174c8b7db72fb77d09a88bdf1489a364d configure.ac: Add a --without-fltk build option (bug #37773) * configure.ac: Add a --without-fltk option to avoid building against FLTK. This was done previously with --without-opengl, but OpenGL is now also required for Qt plotting. diff -r 2058d87174c8 -r 27c5f42a7a64 configure.ac --- a/configure.ac Thu Jan 15 12:38:13 2015 -0800 +++ b/configure.ac Thu Jan 15 21:26:34 2015 -0500 @@ -1256,76 +1256,91 @@ ## Check for FLTK (www.fltk.org) library - AC_ARG_WITH([fltk-prefix], [ - AS_HELP_STRING([--with-fltk-prefix=PFX], - [prefix where FLTK is installed (optional)])], - [fltk_prefix="$withval"], - [fltk_prefix=""]) - - AC_ARG_WITH([fltk-exec-prefix], [ - AS_HELP_STRING([--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" + check_fltk=no + AC_ARG_WITH([fltk], + [AS_HELP_STRING([--without-fltk], + [don't use FLTK libraries, disable native graphics])], + [if test x"$withval" = x"no"; then + native_graphics=no + warn_fltk="--without-fltk specified. Native graphics will be disabled." + OCTAVE_CONFIGURE_WARNING([warn_fltk]) + else + check_fltk=yes + fi], + [check_fltk=yes]) + + if test $check_fltk = yes; then + AC_ARG_WITH([fltk-prefix], + [AS_HELP_STRING([--with-fltk-prefix=PFX], + [prefix where FLTK is installed (optional)])], + [fltk_prefix="$withval"], + [fltk_prefix=""]) + + AC_ARG_WITH([fltk-exec-prefix], + [AS_HELP_STRING([--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 - 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" + + 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 - fi - - AC_PATH_PROG([FLTK_CONFIG], [fltk-config], [no]) - - warn_fltk_config="" - warn_fltk_opengl="" - - if test "$FLTK_CONFIG" = no; then - native_graphics=no - warn_fltk_config="FLTK config script not found. Native graphics will be disabled." - OCTAVE_CONFIGURE_WARNING([warn_fltk_config]) - else - FLTK_CFLAGS=`$FLTK_CONFIG $fltkconf_args --use-gl --cflags` - FLTK_LDFLAGS=`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags` - - case $host_os in - mingw*) - FLTK_LDFLAGS=`echo $FLTK_LDFLAGS | $SED -e 's/-mwindows//g'` - ;; - esac - - AC_CACHE_CHECK([for OpenGL support in FLTK], - [octave_cv_fltk_opengl_support], - [save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $FLTK_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - ]], [[ - int nothing = 0; - ]])], - octave_cv_fltk_opengl_support=no, - octave_cv_fltk_opengl_support=yes) - CFLAGS="$save_CFLAGS" - ]) - if test $octave_cv_fltk_opengl_support = no; then - warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled." + + AC_PATH_PROG([FLTK_CONFIG], [fltk-config], [no]) + + warn_fltk_config="" + warn_fltk_opengl="" + + if test "$FLTK_CONFIG" = no; then + native_graphics=no + warn_fltk_config="FLTK config script not found. Native graphics will be disabled." + OCTAVE_CONFIGURE_WARNING([warn_fltk_config]) else - AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.]) - fi - - if test -z "$warn_fltk_opengl"; then - GRAPHICS_CFLAGS="$FLTK_CFLAGS" - GRAPHICS_LIBS="$FLTK_LDFLAGS" - else - native_graphics=no - OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl]) + FLTK_CFLAGS=`$FLTK_CONFIG $fltkconf_args --use-gl --cflags` + FLTK_LDFLAGS=`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags` + + case $host_os in + mingw*) + FLTK_LDFLAGS=`echo $FLTK_LDFLAGS | $SED -e 's/-mwindows//g'` + ;; + esac + + AC_CACHE_CHECK([for OpenGL support in FLTK], + [octave_cv_fltk_opengl_support], + [save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $FLTK_CFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + int nothing = 0; + ]])], + octave_cv_fltk_opengl_support=no, + octave_cv_fltk_opengl_support=yes) + CFLAGS="$save_CFLAGS" + ]) + if test $octave_cv_fltk_opengl_support = no; then + warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled." + else + AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.]) + fi + + if test -z "$warn_fltk_opengl"; then + GRAPHICS_CFLAGS="$FLTK_CFLAGS" + GRAPHICS_LIBS="$FLTK_LDFLAGS" + else + native_graphics=no + OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl]) + fi fi fi fi