comparison m4/acinclude.m4 @ 24093:7d9ba57201b4

configure: improve Qt feature tests for functionality and consistency * m4/acinclude.m4 (OCTAVE_CHECK_FUNC_QLINEEDIT_SETPLACEHOLDERTEXT): Rewrite as an actual feature test, rename and reword for consistency. (OCTAVE_CHECK_MEMBER_QFONT_FORCE_INTEGER_METRICS): Rename and reword messages and documentation. (OCTAVE_CHECK_MEMBER_QFONT_MONOSPACE): Likewise. (OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL): Reword messages and documentation. (OCTAVE_CHECK_FUNC_QSCI_FINDSELECTION): Likewise. (OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE): Likewise. (OCTAVE_CHECK_QSCINTILLA): Delete call to OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT. (OCTAVE_CHECK_QT_VERSION): Insert call to OCTAVE_CHECK_FUNC_QLINEEDIT_SETPLACEHOLDERTEXT. * webinfo.cc (webinfo::webinfo): Update to renamed macro HAVE_QLINEEDIT_SETPLACEHOLDERTEXT.
author Mike Miller <mtmiller@octave.org>
date Sat, 23 Sep 2017 13:50:53 -0700
parents e483dcb5777d
children 9182a640afbe
comparison
equal deleted inserted replaced
24092:80906ac05e7d 24093:7d9ba57201b4
293 AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1, 293 AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1,
294 [Define to 1 if gluTessCallback is called with (...).]) 294 [Define to 1 if gluTessCallback is called with (...).])
295 fi 295 fi
296 ]) 296 ])
297 dnl 297 dnl
298 dnl Check whether the Qt QAbstractItemModel::beginResetModel function exists. 298 dnl Check whether the Qt class QAbstractItemModel exists and has the
299 dnl Also checks for QAbstractItemModel::endResetModel. These are two of the 299 dnl beginResetModel and endResetModel member functions. These member
300 dnl newest Qt functions that the Octave GUI depends on, added in Qt 4.6. 300 dnl functions were introduced in Qt 4.6.
301 dnl
302 dnl FIXME: Delete this entirely when we can safely assume that Qt 4.6 or later
303 dnl is in use everywhere, or when we drop support for Qt 4.
301 dnl 304 dnl
302 AC_DEFUN([OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL], [ 305 AC_DEFUN([OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL], [
303 AC_CACHE_CHECK([whether Qt has the QAbstractItemModel::beginResetModel function], 306 AC_CACHE_CHECK([for QAbstractItemModel::beginResetModel in <QAbstractItemModel>],
304 [octave_cv_func_qabstractitemmodel_beginresetmodel], 307 [octave_cv_func_qabstractitemmodel_beginresetmodel],
305 [AC_LANG_PUSH(C++) 308 [AC_LANG_PUSH(C++)
306 ac_octave_save_CPPFLAGS="$CPPFLAGS" 309 ac_octave_save_CPPFLAGS="$CPPFLAGS"
307 ac_octave_save_CXXFLAGS="$CXXFLAGS" 310 ac_octave_save_CXXFLAGS="$CXXFLAGS"
308 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" 311 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
335 CXXFLAGS="$ac_octave_save_CXXFLAGS" 338 CXXFLAGS="$ac_octave_save_CXXFLAGS"
336 AC_LANG_POP(C++) 339 AC_LANG_POP(C++)
337 ]) 340 ])
338 if test $octave_cv_func_qabstractitemmodel_beginresetmodel = yes; then 341 if test $octave_cv_func_qabstractitemmodel_beginresetmodel = yes; then
339 AC_DEFINE(HAVE_QABSTRACTITEMMODEL_BEGINRESETMODEL, 1, 342 AC_DEFINE(HAVE_QABSTRACTITEMMODEL_BEGINRESETMODEL, 1,
340 [Define to 1 if Qt has the QAbstractItemModel::beginResetModel() function.]) 343 [Define to 1 if you have the `QAbstractItemModel::beginResetModel' member function.])
341 fi 344 fi
342 ]) 345 ])
343 dnl 346 dnl
344 dnl Check whether the QsciScintilla::findFirstInSelection function exists. 347 dnl Check whether the Qt class QLineEdit has the setPlaceholderText member
345 dnl This function was added in QScintilla 2.7. 348 dnl function. This member function was introduced in Qt 4.7.
349 dnl
350 dnl FIXME: Delete this entirely when we can safely assume that Qt 4.7 or later
351 dnl is in use everywhere, or when we drop support for Qt 4.
352 dnl
353 AC_DEFUN([OCTAVE_CHECK_FUNC_QLINEEDIT_SETPLACEHOLDERTEXT], [
354 AC_CACHE_CHECK([for QLineEdit::setPlaceholderText in <QLinedEdit>],
355 [octave_cv_func_qlineedit_setplaceholdertext],
356 [AC_LANG_PUSH(C++)
357 ac_octave_save_CPPFLAGS="$CPPFLAGS"
358 ac_octave_save_CXXFLAGS="$CXXFLAGS"
359 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
360 CXXFLAGS="$CXXPICFLAG $CPPFLAGS"
361 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
362 #include <QLineEdit>
363 ]], [[
364 QLineEdit line_edit;
365 line_edit.setPlaceholderText ("placeholder text");
366 ]])],
367 octave_cv_func_qlineedit_setplaceholdertext=yes,
368 octave_cv_func_qlineedit_setplaceholdertext=no)
369 CPPFLAGS="$ac_octave_save_CPPFLAGS"
370 CXXFLAGS="$ac_octave_save_CXXFLAGS"
371 AC_LANG_POP(C++)
372 ])
373 if test $octave_cv_func_qlineedit_setplaceholdertext = yes; then
374 AC_DEFINE(HAVE_QLINEEDIT_SETPLACEHOLDERTEXT, 1,
375 [Define to 1 if you have the `QLineEdit::setPlaceholderText' member function.])
376 fi
377 ])
378 dnl
379 dnl Check whether the QScintilla class QsciScintilla has the
380 dnl findFirstInSelection member function. This member function was introduced
381 dnl in QScintilla 2.7.
382 dnl
383 dnl FIXME: Delete this entirely when we can safely assume that QScintilla 2.7
384 dnl or later is in use everywhere, or when we drop support for Qt 4 (Qt 5 only
385 dnl works with QScintilla 2.7.1 or later).
346 dnl 386 dnl
347 AC_DEFUN([OCTAVE_CHECK_FUNC_QSCI_FINDSELECTION], [ 387 AC_DEFUN([OCTAVE_CHECK_FUNC_QSCI_FINDSELECTION], [
348 AC_CACHE_CHECK([whether QSci has the QsciScintilla::findFirstInSelection function], 388 AC_CACHE_CHECK([for QsciScintilla::findFirstInSelection in <Qsci/qsciscintilla.h>],
349 [octave_cv_func_qsci_findfirstinselection], 389 [octave_cv_func_qsci_findfirstinselection],
350 [AC_LANG_PUSH(C++) 390 [AC_LANG_PUSH(C++)
351 ac_octave_save_CPPFLAGS="$CPPFLAGS" 391 ac_octave_save_CPPFLAGS="$CPPFLAGS"
352 ac_octave_save_CXXFLAGS="$CXXFLAGS" 392 ac_octave_save_CXXFLAGS="$CXXFLAGS"
353 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" 393 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
370 CXXFLAGS="$ac_octave_save_CXXFLAGS" 410 CXXFLAGS="$ac_octave_save_CXXFLAGS"
371 AC_LANG_POP(C++) 411 AC_LANG_POP(C++)
372 ]) 412 ])
373 if test $octave_cv_func_qsci_findfirstinselection = yes; then 413 if test $octave_cv_func_qsci_findfirstinselection = yes; then
374 AC_DEFINE(HAVE_QSCI_FINDSELECTION, 1, 414 AC_DEFINE(HAVE_QSCI_FINDSELECTION, 1,
375 [Define to 1 if Qsci has the QsciScintilla::findFirstInSelection function.]) 415 [Define to 1 if you have the `QsciScintilla::findFirstInSelection' member function.])
376 fi 416 fi
377 ]) 417 ])
378 dnl 418 dnl
379 dnl Check whether the Qt QTabWidget::setMovable function exists. 419 dnl Check whether the Qt class QTabWidget has the setMovable member function.
380 dnl This function was added in Qt 4.5. 420 dnl This member function was introduced in Qt 4.5.
421 dnl
422 dnl FIXME: Delete this entirely when we can safely assume that Qt 4.5 or later
423 dnl is in use everywhere, or when we drop support for Qt 4.
381 dnl 424 dnl
382 AC_DEFUN([OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE], [ 425 AC_DEFUN([OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE], [
383 AC_CACHE_CHECK([whether Qt has the QTabWidget::setMovable function], 426 AC_CACHE_CHECK([for QTabWidget::setMovable in <QTabWidget>],
384 [octave_cv_func_qtabwidget_setmovable], 427 [octave_cv_func_qtabwidget_setmovable],
385 [AC_LANG_PUSH(C++) 428 [AC_LANG_PUSH(C++)
386 ac_octave_save_CPPFLAGS="$CPPFLAGS" 429 ac_octave_save_CPPFLAGS="$CPPFLAGS"
387 ac_octave_save_CXXFLAGS="$CXXFLAGS" 430 ac_octave_save_CXXFLAGS="$CXXFLAGS"
388 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" 431 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
404 CXXFLAGS="$ac_octave_save_CXXFLAGS" 447 CXXFLAGS="$ac_octave_save_CXXFLAGS"
405 AC_LANG_POP(C++) 448 AC_LANG_POP(C++)
406 ]) 449 ])
407 if test $octave_cv_func_qtabwidget_setmovable = yes; then 450 if test $octave_cv_func_qtabwidget_setmovable = yes; then
408 AC_DEFINE(HAVE_QTABWIDGET_SETMOVABLE, 1, 451 AC_DEFINE(HAVE_QTABWIDGET_SETMOVABLE, 1,
409 [Define to 1 if Qt has the QTabWidget::setMovable function.]) 452 [Define to 1 if you have the `QTabWidget::setMovable' member function.])
410 fi
411 ])
412 dnl
413 dnl Check whether QScintilla SetPlaceholderText function exists.
414 dnl FIXME: This test uses a version number. It potentially could
415 dnl be re-written to actually call the function, but is it worth it?
416 dnl
417 AC_DEFUN([OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT], [
418 AC_CACHE_CHECK([whether Qt has SetPlaceholderText function],
419 [octave_cv_func_setplaceholdertext],
420 [AC_LANG_PUSH(C++)
421 ac_octave_save_CPPFLAGS="$CPPFLAGS"
422 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
423 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
424 #include <qglobal.h>
425 ]], [[
426 #if QT_VERSION < 0x040700
427 #error No SetPlacholderText function available.
428 #endif
429 ]])],
430 octave_cv_func_setplaceholdertext=yes,
431 octave_cv_func_setplaceholdertext=no)
432 CPPFLAGS="$ac_octave_save_CPPFLAGS"
433 AC_LANG_POP(C++)
434 ])
435 if test $octave_cv_func_setplaceholdertext = yes; then
436 AC_DEFINE(HAVE_SETPLACEHOLDERTEXT, 1,
437 [Define to 1 if you have the Qt SetPlaceholderText function.])
438 fi 453 fi
439 ]) 454 ])
440 dnl 455 dnl
441 dnl Check whether HDF5 library has version 1.6 API functions. 456 dnl Check whether HDF5 library has version 1.6 API functions.
442 dnl 457 dnl
1037 dnl done 1052 dnl done
1038 1053
1039 AC_SUBST(TERM_LIBS) 1054 AC_SUBST(TERM_LIBS)
1040 ]) 1055 ])
1041 dnl 1056 dnl
1042 dnl Check whether Qt provides QFont::ForceIntegerMetrics 1057 dnl Check whether the Qt class QFont has the ForceIntegerMetrics enumerated
1043 dnl 1058 dnl type member. This property was introduced in Qt 4.7.
1044 AC_DEFUN([OCTAVE_CHECK_QFONT_FORCE_INTEGER_METRICS], [ 1059 dnl
1045 AC_CACHE_CHECK([whether Qt provides QFont::ForceIntegerMetrics], 1060 dnl FIXME: Delete this entirely when we can safely assume that Qt 4.7 or later
1061 dnl is in use everywhere, or when we drop support for Qt 4.
1062 dnl
1063 AC_DEFUN([OCTAVE_CHECK_MEMBER_QFONT_FORCE_INTEGER_METRICS], [
1064 AC_CACHE_CHECK([for QFont::ForceIntegerMetrics in <QFont>],
1046 [octave_cv_decl_qfont_force_integer_metrics], 1065 [octave_cv_decl_qfont_force_integer_metrics],
1047 [AC_LANG_PUSH(C++) 1066 [AC_LANG_PUSH(C++)
1048 ac_octave_save_CPPFLAGS="$CPPFLAGS" 1067 ac_octave_save_CPPFLAGS="$CPPFLAGS"
1049 ac_octave_save_CXXFLAGS="$CXXFLAGS" 1068 ac_octave_save_CXXFLAGS="$CXXFLAGS"
1050 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" 1069 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
1060 CXXFLAGS="$ac_octave_save_CXXFLAGS" 1079 CXXFLAGS="$ac_octave_save_CXXFLAGS"
1061 AC_LANG_POP(C++) 1080 AC_LANG_POP(C++)
1062 ]) 1081 ])
1063 if test $octave_cv_decl_qfont_force_integer_metrics = yes; then 1082 if test $octave_cv_decl_qfont_force_integer_metrics = yes; then
1064 AC_DEFINE(HAVE_QFONT_FORCE_INTEGER_METRICS, 1, 1083 AC_DEFINE(HAVE_QFONT_FORCE_INTEGER_METRICS, 1,
1065 [Define to 1 if Qt provides QFont::ForceIntegerMetrics.]) 1084 [Define to 1 if `ForceIntegerMetrics' is a member of `QFont'.])
1066 fi 1085 fi
1067 ]) 1086 ])
1068 dnl 1087 dnl
1069 dnl Check whether Qt provides QFont::Monospace 1088 dnl Check whether the Qt class QFont has the Monospace enumerated type member.
1070 dnl 1089 dnl This property was introduced in Qt 4.7.
1071 AC_DEFUN([OCTAVE_CHECK_QFONT_MONOSPACE], [ 1090 dnl
1072 AC_CACHE_CHECK([whether Qt provides QFont::Monospace], 1091 dnl FIXME: Delete this entirely when we can safely assume that Qt 4.7 or later
1092 dnl is in use everywhere, or when we drop support for Qt 4.
1093 dnl
1094 AC_DEFUN([OCTAVE_CHECK_MEMBER_QFONT_MONOSPACE], [
1095 AC_CACHE_CHECK([for QFont::Monospace in <QFont>],
1073 [octave_cv_decl_qfont_monospace], 1096 [octave_cv_decl_qfont_monospace],
1074 [AC_LANG_PUSH(C++) 1097 [AC_LANG_PUSH(C++)
1075 ac_octave_save_CPPFLAGS="$CPPFLAGS" 1098 ac_octave_save_CPPFLAGS="$CPPFLAGS"
1076 ac_octave_save_CXXFLAGS="$CXXFLAGS" 1099 ac_octave_save_CXXFLAGS="$CXXFLAGS"
1077 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" 1100 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
1087 CXXFLAGS="$ac_octave_save_CXXFLAGS" 1110 CXXFLAGS="$ac_octave_save_CXXFLAGS"
1088 AC_LANG_POP(C++) 1111 AC_LANG_POP(C++)
1089 ]) 1112 ])
1090 if test $octave_cv_decl_qfont_monospace = yes; then 1113 if test $octave_cv_decl_qfont_monospace = yes; then
1091 AC_DEFINE(HAVE_QFONT_MONOSPACE, 1, 1114 AC_DEFINE(HAVE_QFONT_MONOSPACE, 1,
1092 [Define to 1 if Qt provides QFont::Monospace.]) 1115 [Define to 1 if `Monospace' is a member of `QFont'.])
1093 fi 1116 fi
1094 ]) 1117 ])
1095 dnl 1118 dnl
1096 dnl Check for the Qhull version. 1119 dnl Check for the Qhull version.
1097 dnl 1120 dnl
1211 AC_CHECK_HEADERS([Qsci/qscilexeroctave.h Qsci/qscilexermatlab.h]) 1234 AC_CHECK_HEADERS([Qsci/qscilexeroctave.h Qsci/qscilexermatlab.h])
1212 AC_LANG_POP(C++) 1235 AC_LANG_POP(C++)
1213 CPPFLAGS="$save_CPPFLAGS" 1236 CPPFLAGS="$save_CPPFLAGS"
1214 CXXFLAGS="$save_CXXFLAGS" 1237 CXXFLAGS="$save_CXXFLAGS"
1215 1238
1216 OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT
1217 OCTAVE_CHECK_FUNC_QSCI_FINDSELECTION 1239 OCTAVE_CHECK_FUNC_QSCI_FINDSELECTION
1218 1240
1219 use_qscintilla=yes 1241 use_qscintilla=yes
1220 fi 1242 fi
1221 fi 1243 fi
1541 1563
1542 ## We don't need to unset cache variables for any of the remaining 1564 ## We don't need to unset cache variables for any of the remaining
1543 ## tests if they fail because we have already decided that the Qt 1565 ## tests if they fail because we have already decided that the Qt
1544 ## version that we are testing now will be the one used. 1566 ## version that we are testing now will be the one used.
1545 1567
1546 OCTAVE_CHECK_QFONT_MONOSPACE 1568 OCTAVE_CHECK_FUNC_QLINEEDIT_SETPLACEHOLDERTEXT
1547 OCTAVE_CHECK_QFONT_FORCE_INTEGER_METRICS
1548 OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE 1569 OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE
1570 OCTAVE_CHECK_MEMBER_QFONT_FORCE_INTEGER_METRICS
1571 OCTAVE_CHECK_MEMBER_QFONT_MONOSPACE
1549 1572
1550 if test -n "$OPENGL_LIBS"; then 1573 if test -n "$OPENGL_LIBS"; then
1551 OCTAVE_CHECK_QT_OPENGL_OK([build_qt_graphics=yes], 1574 OCTAVE_CHECK_QT_OPENGL_OK([build_qt_graphics=yes],
1552 [warn_qt_opengl="Qt does not work with the OpenGL libs (GL and GLU); disabling OpenGL graphics with Qt GUI"]) 1575 [warn_qt_opengl="Qt does not work with the OpenGL libs (GL and GLU); disabling OpenGL graphics with Qt GUI"])
1553 1576