annotate acinclude.m4 @ 382:a5e63c0af39a tonioni_experiment_july2014 v0.7_experiment_july2014

Fix to settings reset -- needs to happen before the MainWindow ctor to avoid breaking behaviour within the current run!
author Chris Cannam
date Mon, 21 Jul 2014 15:23:10 +0100
parents 8b7383948381
children 4b9b7ff3f19c
rev   line source
Chris@0 1
Chris@0 2 AC_DEFUN([SV_MODULE_REQUIRED],
Chris@0 3 [
Chris@0 4 SV_MODULE_MODULE=$1
Chris@0 5 SV_MODULE_VERSION_TEST="$2"
Chris@0 6 SV_MODULE_HEADER=$3
Chris@0 7 SV_MODULE_LIB=$4
Chris@0 8 SV_MODULE_FUNC=$5
Chris@0 9 SV_MODULE_HAVE=HAVE_$(echo $1 | tr '[a-z]' '[A-Z]')
Chris@0 10 SV_MODULE_FAILED=1
Chris@0 11 if test -n "$$1_LIBS" ; then
Chris@0 12 AC_MSG_NOTICE([User set ${SV_MODULE_MODULE}_LIBS explicitly, skipping test for $SV_MODULE_MODULE])
Chris@0 13 CXXFLAGS="$CXXFLAGS $$1_CFLAGS"
Chris@0 14 LIBS="$LIBS $$1_LIBS"
Chris@0 15 SV_MODULE_FAILED=""
Chris@0 16 fi
Chris@0 17 if test -z "$SV_MODULE_VERSION_TEST" ; then
Chris@0 18 SV_MODULE_VERSION_TEST=$SV_MODULE_MODULE
Chris@0 19 fi
Chris@0 20 if test -n "$SV_MODULE_FAILED" && test -n "$PKG_CONFIG"; then
Chris@0 21 PKG_CHECK_MODULES($1,[$SV_MODULE_VERSION_TEST],[HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $$1_CFLAGS";LIBS="$LIBS $$1_LIBS";SV_MODULE_FAILED=""],[AC_MSG_NOTICE([Failed to find required module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means])])
Chris@0 22 fi
Chris@0 23 if test -n "$SV_MODULE_FAILED"; then
Chris@0 24 AC_CHECK_HEADER([$SV_MODULE_HEADER],[HAVES="$HAVES $SV_MODULE_HAVE"],[AC_MSG_ERROR([Failed to find header $SV_MODULE_HEADER for required module $SV_MODULE_MODULE])])
Chris@0 25 if test -n "$SV_MODULE_LIB"; then
Chris@0 26 AC_CHECK_LIB([$SV_MODULE_LIB],[$SV_MODULE_FUNC],[LIBS="$LIBS -l$SV_MODULE_LIB"],[AC_MSG_ERROR([Failed to find library $SV_MODULE_LIB for required module $SV_MODULE_MODULE])])
Chris@0 27 fi
Chris@0 28 fi
Chris@0 29 ])
Chris@0 30
Chris@0 31 AC_DEFUN([SV_MODULE_OPTIONAL],
Chris@0 32 [
Chris@0 33 SV_MODULE_MODULE=$1
Chris@0 34 SV_MODULE_VERSION_TEST="$2"
Chris@0 35 SV_MODULE_HEADER=$3
Chris@0 36 SV_MODULE_LIB=$4
Chris@0 37 SV_MODULE_FUNC=$5
Chris@0 38 SV_MODULE_HAVE=HAVE_$(echo $1 | tr '[a-z]' '[A-Z]')
Chris@0 39 SV_MODULE_FAILED=1
Chris@0 40 if test -n "$$1_LIBS" ; then
Chris@0 41 AC_MSG_NOTICE([User set ${SV_MODULE_MODULE}_LIBS explicitly, skipping test for $SV_MODULE_MODULE])
Chris@0 42 CXXFLAGS="$CXXFLAGS $$1_CFLAGS"
Chris@0 43 LIBS="$LIBS $$1_LIBS"
Chris@0 44 SV_MODULE_FAILED=""
Chris@0 45 fi
Chris@0 46 if test -z "$SV_MODULE_VERSION_TEST" ; then
Chris@0 47 SV_MODULE_VERSION_TEST=$SV_MODULE_MODULE
Chris@0 48 fi
Chris@0 49 if test -n "$SV_MODULE_FAILED" && test -n "$PKG_CONFIG"; then
Chris@0 50 PKG_CHECK_MODULES($1,[$SV_MODULE_VERSION_TEST],[HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $$1_CFLAGS";LIBS="$LIBS $$1_LIBS";SV_MODULE_FAILED=""],[AC_MSG_NOTICE([Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means])])
Chris@0 51 fi
Chris@0 52 if test -n "$SV_MODULE_FAILED"; then
Chris@0 53 AC_CHECK_HEADER([$SV_MODULE_HEADER],[HAVES="$HAVES $SV_MODULE_HAVE";SV_MODULE_FAILED=""],[AC_MSG_NOTICE([Failed to find header $SV_MODULE_HEADER for optional module $SV_MODULE_MODULE])])
Chris@0 54 if test -z "$SV_MODULE_FAILED"; then
Chris@0 55 if test -n "$SV_MODULE_LIB"; then
Chris@0 56 AC_CHECK_LIB([$SV_MODULE_LIB],[$SV_MODULE_FUNC],[LIBS="$LIBS -l$SV_MODULE_LIB"],[AC_MSG_NOTICE([Failed to find library $SV_MODULE_LIB for optional module $SV_MODULE_MODULE])])
Chris@0 57 fi
Chris@0 58 fi
Chris@0 59 fi
Chris@0 60 ])
Chris@0 61
Chris@0 62 # Check for Qt. The only part of Qt we use directly is qmake.
Chris@0 63
Chris@0 64 AC_DEFUN([SV_CHECK_QT],
Chris@0 65 [
Chris@0 66 AC_REQUIRE([AC_PROG_CXX])
Chris@0 67
Chris@0 68 if test x$QMAKE = x ; then
Chris@50 69 AC_CHECK_PROG(QMAKE, qmake-qt5, $QTDIR/bin/qmake-qt5,,$QTDIR/bin/)
Chris@0 70 fi
Chris@0 71 if test x$QMAKE = x ; then
Chris@0 72 AC_CHECK_PROG(QMAKE, qmake, $QTDIR/bin/qmake,,$QTDIR/bin/)
Chris@0 73 fi
Chris@0 74 if test x$QMAKE = x ; then
Chris@0 75 AC_CHECK_PROG(QMAKE, qmake.exe, $QTDIR/bin/qmake.exe,,$QTDIR/bin/)
Chris@0 76 fi
Chris@0 77 if test x$QMAKE = x ; then
Chris@50 78 AC_CHECK_PROG(QMAKE, qmake-qt5, qmake-qt5,,$PATH)
Chris@0 79 fi
Chris@0 80 if test x$QMAKE = x ; then
Chris@0 81 AC_CHECK_PROG(QMAKE, qmake, qmake,,$PATH)
Chris@0 82 fi
Chris@0 83 if test x$QMAKE = x ; then
Chris@0 84 AC_MSG_ERROR([
Chris@50 85 Failed to find the required qmake-qt5 or qmake program. Please
Chris@50 86 ensure you have the necessary Qt5 development files installed, and
Chris@50 87 if necessary set QTDIR to the location of your Qt5 installation.
Chris@0 88 ])
Chris@0 89 fi
Chris@0 90
Chris@0 91 # Suitable versions of qmake should print out something like:
Chris@0 92 #
Chris@0 93 # QMake version 2.01a
Chris@0 94 # Using Qt version 4.6.3 in /usr/lib
Chris@0 95 #
Chris@0 96 # This may be translated, so we check only for the numbers (2.x and 4.x
Chris@0 97 # in that order).
Chris@0 98 #
Chris@0 99 QMAKE_VERSION_OUTPUT=`$QMAKE -v`
Chris@0 100 case "$QMAKE_VERSION_OUTPUT" in
Chris@50 101 *5.*) ;;
Chris@0 102 *) AC_MSG_WARN([
Chris@0 103 *** The version of qmake found in "$QMAKE" looks like it might be
Chris@50 104 from the wrong version of Qt (Qt5 is required). Please check
Chris@50 105 that this is the correct version of qmake for Qt5 builds.
Chris@0 106 ])
Chris@0 107 esac
Chris@0 108
Chris@0 109 case "`uname`" in
Chris@0 110 *Darwin*) QMAKE="$QMAKE -spec macx-g++";;
Chris@0 111 esac
Chris@0 112
Chris@0 113 ])
Chris@0 114