comparison configure.ac @ 19616:27c5f42a7a64

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.
author Sebastian Schoeps <sebastian@schoeps.org>
date Thu, 15 Jan 2015 21:26:34 -0500
parents bf27e21f0bfb
children 37d37297acf8
comparison
equal deleted inserted replaced
19615:2058d87174c8 19616:27c5f42a7a64
1254 OCTAVE_CONFIGURE_WARNING([warn_xft]) 1254 OCTAVE_CONFIGURE_WARNING([warn_xft])
1255 fi 1255 fi
1256 1256
1257 ## Check for FLTK (www.fltk.org) library 1257 ## Check for FLTK (www.fltk.org) library
1258 1258
1259 AC_ARG_WITH([fltk-prefix], [ 1259 check_fltk=no
1260 AS_HELP_STRING([--with-fltk-prefix=PFX], 1260 AC_ARG_WITH([fltk],
1261 [prefix where FLTK is installed (optional)])], 1261 [AS_HELP_STRING([--without-fltk],
1262 [fltk_prefix="$withval"], 1262 [don't use FLTK libraries, disable native graphics])],
1263 [fltk_prefix=""]) 1263 [if test x"$withval" = x"no"; then
1264 1264 native_graphics=no
1265 AC_ARG_WITH([fltk-exec-prefix], [ 1265 warn_fltk="--without-fltk specified. Native graphics will be disabled."
1266 AS_HELP_STRING([--with-fltk-exec-prefix=PFX], 1266 OCTAVE_CONFIGURE_WARNING([warn_fltk])
1267 [exec prefix where FLTK is installed (optional)])], 1267 else
1268 [fltk_exec_prefix="$withval"], 1268 check_fltk=yes
1269 [fltk_exec_prefix=""]) 1269 fi],
1270 1270 [check_fltk=yes])
1271 if test x"$fltk_exec_prefix" != x""; then 1271
1272 fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix" 1272 if test $check_fltk = yes; then
1273 if test "x${FLTK_CONFIG+set}" != xset ; then 1273 AC_ARG_WITH([fltk-prefix],
1274 FLTK_CONFIG="$fltk_exec_prefix/bin/fltk-config" 1274 [AS_HELP_STRING([--with-fltk-prefix=PFX],
1275 [prefix where FLTK is installed (optional)])],
1276 [fltk_prefix="$withval"],
1277 [fltk_prefix=""])
1278
1279 AC_ARG_WITH([fltk-exec-prefix],
1280 [AS_HELP_STRING([--with-fltk-exec-prefix=PFX],
1281 [exec prefix where FLTK is installed (optional)])],
1282 [fltk_exec_prefix="$withval"],
1283 [fltk_exec_prefix=""])
1284
1285 if test x"$fltk_exec_prefix" != x""; then
1286 fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix"
1287 if test "x${FLTK_CONFIG+set}" != xset ; then
1288 FLTK_CONFIG="$fltk_exec_prefix/bin/fltk-config"
1289 fi
1275 fi 1290 fi
1276 fi 1291
1277 1292 if test x"$fltk_prefix" != x""; then
1278 if test x"$fltk_prefix" != x""; then 1293 fltk_args="$fltk_args --prefix=$fltk_prefix"
1279 fltk_args="$fltk_args --prefix=$fltk_prefix" 1294 if test x${FLTK_CONFIG+set} != xset ; then
1280 if test x${FLTK_CONFIG+set} != xset ; then 1295 FLTK_CONFIG="$fltk_prefix/bin/fltk-config"
1281 FLTK_CONFIG="$fltk_prefix/bin/fltk-config" 1296 fi
1282 fi 1297 fi
1283 fi 1298
1284 1299 AC_PATH_PROG([FLTK_CONFIG], [fltk-config], [no])
1285 AC_PATH_PROG([FLTK_CONFIG], [fltk-config], [no]) 1300
1286 1301 warn_fltk_config=""
1287 warn_fltk_config="" 1302 warn_fltk_opengl=""
1288 warn_fltk_opengl="" 1303
1289 1304 if test "$FLTK_CONFIG" = no; then
1290 if test "$FLTK_CONFIG" = no; then 1305 native_graphics=no
1291 native_graphics=no 1306 warn_fltk_config="FLTK config script not found. Native graphics will be disabled."
1292 warn_fltk_config="FLTK config script not found. Native graphics will be disabled." 1307 OCTAVE_CONFIGURE_WARNING([warn_fltk_config])
1293 OCTAVE_CONFIGURE_WARNING([warn_fltk_config])
1294 else
1295 FLTK_CFLAGS=`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`
1296 FLTK_LDFLAGS=`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`
1297
1298 case $host_os in
1299 mingw*)
1300 FLTK_LDFLAGS=`echo $FLTK_LDFLAGS | $SED -e 's/-mwindows//g'`
1301 ;;
1302 esac
1303
1304 AC_CACHE_CHECK([for OpenGL support in FLTK],
1305 [octave_cv_fltk_opengl_support],
1306 [save_CFLAGS="$CFLAGS"
1307 CFLAGS="$CFLAGS $FLTK_CFLAGS"
1308 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1309 #include <FL/gl.h>
1310 ]], [[
1311 int nothing = 0;
1312 ]])],
1313 octave_cv_fltk_opengl_support=no,
1314 octave_cv_fltk_opengl_support=yes)
1315 CFLAGS="$save_CFLAGS"
1316 ])
1317 if test $octave_cv_fltk_opengl_support = no; then
1318 warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled."
1319 else 1308 else
1320 AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.]) 1309 FLTK_CFLAGS=`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`
1321 fi 1310 FLTK_LDFLAGS=`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`
1322 1311
1323 if test -z "$warn_fltk_opengl"; then 1312 case $host_os in
1324 GRAPHICS_CFLAGS="$FLTK_CFLAGS" 1313 mingw*)
1325 GRAPHICS_LIBS="$FLTK_LDFLAGS" 1314 FLTK_LDFLAGS=`echo $FLTK_LDFLAGS | $SED -e 's/-mwindows//g'`
1326 else 1315 ;;
1327 native_graphics=no 1316 esac
1328 OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl]) 1317
1318 AC_CACHE_CHECK([for OpenGL support in FLTK],
1319 [octave_cv_fltk_opengl_support],
1320 [save_CFLAGS="$CFLAGS"
1321 CFLAGS="$CFLAGS $FLTK_CFLAGS"
1322 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1323 #include <FL/gl.h>
1324 ]], [[
1325 int nothing = 0;
1326 ]])],
1327 octave_cv_fltk_opengl_support=no,
1328 octave_cv_fltk_opengl_support=yes)
1329 CFLAGS="$save_CFLAGS"
1330 ])
1331 if test $octave_cv_fltk_opengl_support = no; then
1332 warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled."
1333 else
1334 AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.])
1335 fi
1336
1337 if test -z "$warn_fltk_opengl"; then
1338 GRAPHICS_CFLAGS="$FLTK_CFLAGS"
1339 GRAPHICS_LIBS="$FLTK_LDFLAGS"
1340 else
1341 native_graphics=no
1342 OCTAVE_CONFIGURE_WARNING([warn_fltk_opengl])
1343 fi
1329 fi 1344 fi
1330 fi 1345 fi
1331 fi 1346 fi
1332 1347
1333 AC_SUBST(GRAPHICS_CFLAGS) 1348 AC_SUBST(GRAPHICS_CFLAGS)