comparison configure.ac @ 17836:b1610bf6d9a8

configure.ac: add warnings about disabling GUI to the final summary.
author Carnë Draug <carandraug@octave.org>
date Sun, 03 Nov 2013 04:31:24 +0000
parents 82c94987abc6
children e88a8fa25125
comparison
equal deleted inserted replaced
17835:efbed19b8e04 17836:b1610bf6d9a8
2620 AC_ARG_ENABLE([gui], 2620 AC_ARG_ENABLE([gui],
2621 [AS_HELP_STRING([--disable-gui], [don't build the GUI])], 2621 [AS_HELP_STRING([--disable-gui], [don't build the GUI])],
2622 [if test "$enableval" = no; then build_gui=no; fi], []) 2622 [if test "$enableval" = no; then build_gui=no; fi], [])
2623 2623
2624 if test $build_gui = yes; then 2624 if test $build_gui = yes; then
2625
2626 warn_gui=""
2625 ## Check for Qt libraries 2627 ## Check for Qt libraries
2626 PKG_CHECK_MODULES(QT, [QtCore, QtGui, QtNetwork], 2628 PKG_CHECK_MODULES(QT, [QtCore, QtGui, QtNetwork],
2627 [], 2629 [],
2628 [AC_MSG_WARN([Qt libraries not found -- disabling GUI]) 2630 [warn_gui="Qt libraries not found -- disabling GUI"
2629 build_gui=no]) 2631 build_gui=no])
2630 2632
2631 if test $build_gui = yes; then 2633 if test $build_gui = yes; then
2632 ## Retrieve Qt compilation and linker flags 2634 ## Retrieve Qt compilation and linker flags
2633 QT_CPPFLAGS="`$PKG_CONFIG --cflags-only-I QtCore QtGui QtNetwork`" 2635 QT_CPPFLAGS="`$PKG_CONFIG --cflags-only-I QtCore QtGui QtNetwork`"
2634 QT_LDFLAGS="`$PKG_CONFIG --libs-only-L QtCore QtGui QtNetwork`" 2636 QT_LDFLAGS="`$PKG_CONFIG --libs-only-L QtCore QtGui QtNetwork`"
2635 QT_LIBS="`$PKG_CONFIG --libs-only-l QtCore QtGui QtNetwork`" 2637 QT_LIBS="`$PKG_CONFIG --libs-only-l QtCore QtGui QtNetwork`"
2636 2638
2637 ## Check for Qt4 2639 ## Check for Qt4
2638 if ! `$PKG_CONFIG --atleast-version=4.0.0 QtCore`; then 2640 if ! `$PKG_CONFIG --atleast-version=4.0.0 QtCore`; then
2639 AC_MSG_WARN([Qt >= 4.0.0 not found -- disabling GUI]) 2641 warn_gui="Qt >= 4.0.0 not found -- disabling GUI"
2640 build_gui=no 2642 build_gui=no
2641 fi 2643 fi
2642 fi 2644 fi
2643 2645
2644 if test $build_gui = yes; then 2646 if test $build_gui = yes; then
2648 AC_CHECK_TOOLS(LRELEASE, [lrelease-qt5 lrelease-qt4 lrelease]) 2650 AC_CHECK_TOOLS(LRELEASE, [lrelease-qt5 lrelease-qt4 lrelease])
2649 if test -n "$MOC" && test -n "$UIC" && test -n "$RCC" && test -n "$LRELEASE"; then 2651 if test -n "$MOC" && test -n "$UIC" && test -n "$RCC" && test -n "$LRELEASE"; then
2650 AC_DEFINE(HAVE_QT, 1, 2652 AC_DEFINE(HAVE_QT, 1,
2651 [Define to 1 if Qt is available (libraries, developer header files, utility programs (moc, uic, rcc, and lrelease))]) 2653 [Define to 1 if Qt is available (libraries, developer header files, utility programs (moc, uic, rcc, and lrelease))])
2652 else 2654 else
2653 AC_MSG_WARN([Qt utility programs moc, uic, rcc, and lrelease not found -- disabling GUI]) 2655 warn_gui="Qt utility programs moc, uic, rcc, and lrelease not found -- disabling GUI"
2654 build_gui=no 2656 build_gui=no
2655 fi 2657 fi
2656 fi 2658 fi
2657 2659
2658 if test $build_gui = yes; then 2660 if test $build_gui = yes; then
2659 OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL 2661 OCTAVE_CHECK_FUNC_QABSTRACTITEMMODEL_BEGINRESETMODEL
2660 if test $octave_cv_func_qabstractitemmodel_beginresetmodel = no; then 2662 if test $octave_cv_func_qabstractitemmodel_beginresetmodel = no; then
2661 AC_MSG_WARN([QAbstractItemModel::beginResetModel() not found -- disabling GUI]) 2663 warn_gui="QAbstractItemModel::beginResetModel() not found -- disabling GUI"
2662 build_gui=no 2664 build_gui=no
2663 fi 2665 fi
2664 fi 2666 fi
2665 2667
2666 if test $build_gui = yes; then 2668 if test $build_gui = yes; then
2689 LDFLAGS="$save_LDFLAGS" 2691 LDFLAGS="$save_LDFLAGS"
2690 LIBS="$save_LIBS" 2692 LIBS="$save_LIBS"
2691 AC_LANG_POP([C++]) 2693 AC_LANG_POP([C++])
2692 ]) 2694 ])
2693 if test $octave_cv_lib_qscintilla = no; then 2695 if test $octave_cv_lib_qscintilla = no; then
2694 AC_MSG_WARN([Qscintilla library not found -- disabling built-in GUI editor]) 2696 warn_gui_editor="Qscintilla library not found -- disabling built-in GUI editor"
2697 OCTAVE_CONFIGURE_WARNING([warn_gui_editor])
2695 else 2698 else
2696 ## Let's assume Qscintilla library is at the same location as 2699 ## Let's assume Qscintilla library is at the same location as
2697 ## other regular Qt libraries. 2700 ## other regular Qt libraries.
2698 QT_LIBS="$QT_LIBS -lqscintilla2" 2701 QT_LIBS="$QT_LIBS -lqscintilla2"
2699 OCTAVE_CHECK_VERSION_2_6_0 2702 OCTAVE_CHECK_VERSION_2_6_0
2707 AC_LANG_POP(C++) 2710 AC_LANG_POP(C++)
2708 CPPFLAGS="$save_CPPFLAGS" 2711 CPPFLAGS="$save_CPPFLAGS"
2709 fi 2712 fi
2710 2713
2711 AC_CHECK_FUNCS([setlocale], [], 2714 AC_CHECK_FUNCS([setlocale], [],
2712 [AC_MSG_WARN([setlocale not found -- disabling GUI]) 2715 [warn_gui="setlocale not found -- disabling GUI"
2713 build_gui=no]) 2716 build_gui=no])
2714 2717
2715 if test $build_gui = yes; then 2718 if test $build_gui = yes; then
2716 case $host_os in 2719 case $host_os in
2717 mingw* | msdosmsvc*) 2720 mingw* | msdosmsvc*)
2718 AC_CHECK_FUNCS([setvbuf], [win32_terminal=yes], 2721 AC_CHECK_FUNCS([setvbuf], [win32_terminal=yes],
2719 [AC_MSG_WARN([setvbuf not found -- disabling GUI]) 2722 [warn_gui="setvbuf not found -- disabling GUI"
2720 build_gui=no]) 2723 build_gui=no])
2721 ;; 2724 ;;
2722 *) 2725 *)
2723 AC_CHECK_HEADERS([pty.h libutil.h util.h]) 2726 AC_CHECK_HEADERS([pty.h libutil.h util.h])
2724 AC_SEARCH_LIBS([openpty], [util], 2727 AC_SEARCH_LIBS([openpty], [util],
2727 [AC_MSG_ERROR([At least one of chmod, chown, ftruncate, mmap, and munmap not found -- disabling GUI]) 2730 [AC_MSG_ERROR([At least one of chmod, chown, ftruncate, mmap, and munmap not found -- disabling GUI])
2728 build_gui=no]) 2731 build_gui=no])
2729 ;; 2732 ;;
2730 esac 2733 esac
2731 fi 2734 fi
2735 fi
2736
2737 if test -n "$warn_gui"; then
2738 OCTAVE_CONFIGURE_WARNING([warn_gui])
2732 fi 2739 fi
2733 fi 2740 fi
2734 2741
2735 AM_CONDITIONAL([AMCOND_BUILD_GUI], [test $build_gui = yes]) 2742 AM_CONDITIONAL([AMCOND_BUILD_GUI], [test $build_gui = yes])
2736 AM_CONDITIONAL([AMCOND_HAVE_QSCINTILLA], [test "$octave_cv_lib_qscintilla" = yes]) 2743 AM_CONDITIONAL([AMCOND_HAVE_QSCINTILLA], [test "$octave_cv_lib_qscintilla" = yes])