comparison m4/acinclude.m4 @ 22286:f394436a4025

build: improve QScintilla detection to work with distro naming schemes (bug #48773) * acinclude.m4 (OCTAVE_CHECK_QT_VERSION): Improve detection of the QScintilla library to work with multiple library naming schemes on different distros. Use correct capitalization of QScintilla in comments and output.
author Mike Miller <mtmiller@octave.org>
date Sat, 13 Aug 2016 17:46:31 -0700
parents 945e7f9c11ff
children bac0d6f07a3e
comparison
equal deleted inserted replaced
22285:5f23465ee406 22286:f394436a4025
349 AC_DEFINE(AS_TR_CPP([[HAVE_COMPLEX_STD_][$1]]), 1, 349 AC_DEFINE(AS_TR_CPP([[HAVE_COMPLEX_STD_][$1]]), 1,
350 [Define to 1 if <complex> provides std::$1(std::complex<T>).]) 350 [Define to 1 if <complex> provides std::$1(std::complex<T>).])
351 fi 351 fi
352 ]) 352 ])
353 dnl 353 dnl
354 dnl Check whether Qscintilla has version 2.6.0 or later 354 dnl Check whether QScintilla has version 2.6.0 or later
355 dnl FIXME: This test uses a version number. It potentially could 355 dnl FIXME: This test uses a version number. It potentially could
356 dnl be re-written to actually call the function, but is it worth it? 356 dnl be re-written to actually call the function, but is it worth it?
357 dnl 357 dnl
358 AC_DEFUN([OCTAVE_CHECK_QSCINTILLA_VERSION], [ 358 AC_DEFUN([OCTAVE_CHECK_QSCINTILLA_VERSION], [
359 AC_CACHE_CHECK([whether Qscintilla has version 2.6.0 or later], 359 AC_CACHE_CHECK([whether QScintilla has version 2.6.0 or later],
360 [octave_cv_version_2_6_0], 360 [octave_cv_version_2_6_0],
361 [AC_LANG_PUSH(C++) 361 [AC_LANG_PUSH(C++)
362 ac_octave_save_CPPFLAGS="$CPPFLAGS" 362 ac_octave_save_CPPFLAGS="$CPPFLAGS"
363 ac_octave_save_CXXFLAGS="$CXXFLAGS" 363 ac_octave_save_CXXFLAGS="$CXXFLAGS"
364 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" 364 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
376 CXXFLAGS="$ac_octave_save_CXXFLAGS" 376 CXXFLAGS="$ac_octave_save_CXXFLAGS"
377 AC_LANG_POP(C++) 377 AC_LANG_POP(C++)
378 ]) 378 ])
379 if test $octave_cv_version_2_6_0 = yes; then 379 if test $octave_cv_version_2_6_0 = yes; then
380 AC_DEFINE(HAVE_QSCI_VERSION_2_6_0, 1, 380 AC_DEFINE(HAVE_QSCI_VERSION_2_6_0, 1,
381 [Define to 1 if Qscintilla is of Version 2.6.0 or later.]) 381 [Define to 1 if QScintilla is of Version 2.6.0 or later.])
382 fi 382 fi
383 ]) 383 ])
384 dnl 384 dnl
385 dnl Check if Fortran compiler has the intrinsic function ISNAN. 385 dnl Check if Fortran compiler has the intrinsic function ISNAN.
386 dnl 386 dnl
484 AC_DEFINE(HAVE_QFONT_FORCE_INTEGER_METRICS, 1, 484 AC_DEFINE(HAVE_QFONT_FORCE_INTEGER_METRICS, 1,
485 [Define to 1 if Qt provides QFont::ForceIntegerMetrics.]) 485 [Define to 1 if Qt provides QFont::ForceIntegerMetrics.])
486 fi 486 fi
487 ]) 487 ])
488 dnl 488 dnl
489 dnl Check whether Qscintilla SetPlaceholderText function exists. 489 dnl Check whether QScintilla SetPlaceholderText function exists.
490 dnl FIXME: This test uses a version number. It potentially could 490 dnl FIXME: This test uses a version number. It potentially could
491 dnl be re-written to actually call the function, but is it worth it? 491 dnl be re-written to actually call the function, but is it worth it?
492 dnl 492 dnl
493 AC_DEFUN([OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT], [ 493 AC_DEFUN([OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT], [
494 AC_CACHE_CHECK([whether Qt has SetPlaceholderText function], 494 AC_CACHE_CHECK([whether Qt has SetPlaceholderText function],
1345 1345
1346 ## Check for Qt libraries 1346 ## Check for Qt libraries
1347 case "$qt_version" in 1347 case "$qt_version" in
1348 4) 1348 4)
1349 QT_MODULES="QtCore QtGui QtNetwork QtOpenGL" 1349 QT_MODULES="QtCore QtGui QtNetwork QtOpenGL"
1350 LIBQSCINTILLA=qscintilla2 1350 octave_qscintilla_libnames=qscintilla2
1351 ;; 1351 ;;
1352 5) 1352 5)
1353 QT_MODULES="Qt5Core Qt5Gui Qt5Network Qt5OpenGL Qt5PrintSupport" 1353 QT_MODULES="Qt5Core Qt5Gui Qt5Network Qt5OpenGL Qt5PrintSupport"
1354 LIBQSCINTILLA=qt5scintilla2 1354 octave_qscintilla_libnames="qscintilla2-qt5 qt5scintilla2"
1355 ;; 1355 ;;
1356 *) 1356 *)
1357 AC_MSG_ERROR([Unrecognized Qt version $qt_version]) 1357 AC_MSG_ERROR([Unrecognized Qt version $qt_version])
1358 ;; 1358 ;;
1359 esac 1359 esac
1491 if test $build_qt_graphics = yes; then 1491 if test $build_qt_graphics = yes; then
1492 AC_DEFINE(HAVE_QT_GRAPHICS, 1, [Define to 1 if Qt works with OpenGL libs (GL and GLU)]) 1492 AC_DEFINE(HAVE_QT_GRAPHICS, 1, [Define to 1 if Qt works with OpenGL libs (GL and GLU)])
1493 fi 1493 fi
1494 fi 1494 fi
1495 1495
1496 ## Check for Qscintilla library which is used in the Qt GUI editor. 1496 ## Check for QScintilla library which is used in the Qt GUI editor.
1497 AC_CACHE_CHECK([whether Qscintilla library is installed], 1497 AC_CACHE_CHECK([for the QScintilla library for Qt $qt_version],
1498 [octave_cv_lib_qscintilla], 1498 [octave_cv_lib_qscintilla],
1499 [save_CPPFLAGS="$CPPFLAGS" 1499 [save_CPPFLAGS="$CPPFLAGS"
1500 save_CXXFLAGS="$CXXFLAGS" 1500 save_CXXFLAGS="$CXXFLAGS"
1501 save_LDFLAGS="$LDFLAGS" 1501 save_LDFLAGS="$LDFLAGS"
1502 save_LIBS="$LIBS" 1502 save_LIBS="$LIBS"
1503 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" 1503 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
1504 CXXFLAGS="$CXXPICFLAG $CXXFLAGS" 1504 CXXFLAGS="$CXXPICFLAG $CXXFLAGS"
1505 LDFLAGS="$QT_LDFLAGS $LDFLAGS" 1505 LDFLAGS="$QT_LDFLAGS $LDFLAGS"
1506 LIBS="$QT_LIBS -l$LIBQSCINTILLA"
1507 AC_LANG_PUSH(C++) 1506 AC_LANG_PUSH(C++)
1508 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 1507 for octave_qscintilla_try in $octave_qscintilla_libnames; do
1509 #include <Qsci/qscilexersql.h> 1508 LIBS="$QT_LIBS -l$octave_qscintilla_try"
1510 ]], [[ 1509 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1511 QsciLexerSQL sqlLexer(0); 1510 #include <Qsci/qscilexersql.h>
1512 ]])], 1511 ]], [[
1513 octave_cv_lib_qscintilla=yes, 1512 QsciLexerSQL sqlLexer(0);
1514 octave_cv_lib_qscintilla=no) 1513 ]])],
1514 octave_cv_lib_qscintilla="-l$octave_qscintilla_try",
1515 octave_cv_lib_qscintilla=no)
1516 if test $octave_cv_lib_qscintilla != no; then
1517 break
1518 fi
1519 done
1515 CPPFLAGS="$save_CPPFLAGS" 1520 CPPFLAGS="$save_CPPFLAGS"
1516 CXXFLAGS="$save_CXXFLAGS" 1521 CXXFLAGS="$save_CXXFLAGS"
1517 LDFLAGS="$save_LDFLAGS" 1522 LDFLAGS="$save_LDFLAGS"
1518 LIBS="$save_LIBS" 1523 LIBS="$save_LIBS"
1519 AC_LANG_POP([C++]) 1524 AC_LANG_POP([C++])
1520 ]) 1525 ])
1521 1526
1522 if test $octave_cv_lib_qscintilla = no; then 1527 if test $octave_cv_lib_qscintilla = no; then
1523 warn_qscintilla="Qscintilla library not found; disabling built-in Qt GUI editor" 1528 warn_qscintilla="QScintilla library not found; disabling built-in Qt GUI editor"
1524 else 1529 else
1525 ## Let's assume Qscintilla library is at the same location as 1530 ## Let's assume QScintilla library is at the same location as
1526 ## other regular Qt libraries. 1531 ## other regular Qt libraries.
1527 QT_LIBS="$QT_LIBS -l$LIBQSCINTILLA" 1532 QT_LIBS="$QT_LIBS $octave_cv_lib_qscintilla"
1528 OCTAVE_CHECK_QSCINTILLA_VERSION 1533 OCTAVE_CHECK_QSCINTILLA_VERSION
1529 AC_DEFINE(HAVE_QSCINTILLA, 1, 1534 AC_DEFINE(HAVE_QSCINTILLA, 1,
1530 [Define to 1 if the QScintilla library and header files are available.]) 1535 [Define to 1 if the QScintilla library and header files are available.])
1531 1536
1532 save_CPPFLAGS="$CPPFLAGS" 1537 save_CPPFLAGS="$CPPFLAGS"