annotate acinclude.m4 @ 55:43d788236ed1

Add unit test for multiple outputs in one run
author Chris Cannam
date Fri, 06 Jan 2012 14:53:46 +0000
parents f0e3651ad3b0
children d78c80be335f
rev   line source
Chris@42 1
Chris@42 2 AC_DEFUN([SV_MODULE_REQUIRED],
Chris@42 3 [
Chris@42 4 SV_MODULE_MODULE=$1
Chris@42 5 SV_MODULE_VERSION_TEST="$2"
Chris@42 6 SV_MODULE_HEADER=$3
Chris@42 7 SV_MODULE_LIB=$4
Chris@42 8 SV_MODULE_FUNC=$5
Chris@42 9 SV_MODULE_HAVE=HAVE_$(echo $1 | tr '[a-z]' '[A-Z]')
Chris@42 10 SV_MODULE_FAILED=1
Chris@48 11 if test -n "$$1_LIBS" ; then
Chris@48 12 AC_MSG_NOTICE([User set ${SV_MODULE_MODULE}_LIBS explicitly, skipping test for $SV_MODULE_MODULE])
Chris@48 13 CXXFLAGS="$CXXFLAGS $$1_CFLAGS"
Chris@48 14 LIBS="$LIBS $$1_LIBS"
Chris@48 15 SV_MODULE_FAILED=""
Chris@48 16 fi
Chris@42 17 if test -z "$SV_MODULE_VERSION_TEST" ; then
Chris@42 18 SV_MODULE_VERSION_TEST=$SV_MODULE_MODULE
Chris@42 19 fi
Chris@48 20 if test -n "$SV_MODULE_FAILED" && test -n "$PKG_CONFIG"; then
Chris@42 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@42 22 fi
Chris@42 23 if test -n "$SV_MODULE_FAILED"; then
Chris@42 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@42 25 if test -n "$SV_MODULE_LIB"; then
Chris@42 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@42 27 fi
Chris@42 28 fi
Chris@42 29 ])
Chris@42 30
Chris@42 31 AC_DEFUN([SV_MODULE_OPTIONAL],
Chris@42 32 [
Chris@42 33 SV_MODULE_MODULE=$1
Chris@42 34 SV_MODULE_VERSION_TEST="$2"
Chris@42 35 SV_MODULE_HEADER=$3
Chris@42 36 SV_MODULE_LIB=$4
Chris@42 37 SV_MODULE_FUNC=$5
Chris@42 38 SV_MODULE_HAVE=HAVE_$(echo $1 | tr '[a-z]' '[A-Z]')
Chris@42 39 SV_MODULE_FAILED=1
Chris@48 40 if test -n "$$1_LIBS" ; then
Chris@48 41 AC_MSG_NOTICE([User set ${SV_MODULE_MODULE}_LIBS explicitly, skipping test for $SV_MODULE_MODULE])
Chris@48 42 CXXFLAGS="$CXXFLAGS $$1_CFLAGS"
Chris@48 43 LIBS="$LIBS $$1_LIBS"
Chris@48 44 SV_MODULE_FAILED=""
Chris@48 45 fi
Chris@42 46 if test -z "$SV_MODULE_VERSION_TEST" ; then
Chris@42 47 SV_MODULE_VERSION_TEST=$SV_MODULE_MODULE
Chris@42 48 fi
Chris@48 49 if test -n "$SV_MODULE_FAILED" && test -n "$PKG_CONFIG"; then
Chris@42 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@42 51 fi
Chris@42 52 if test -n "$SV_MODULE_FAILED"; then
Chris@42 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@42 54 if test -z "$SV_MODULE_FAILED"; then
Chris@42 55 if test -n "$SV_MODULE_LIB"; then
Chris@42 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@42 57 fi
Chris@42 58 fi
Chris@42 59 fi
Chris@42 60 ])
Chris@42 61
Chris@42 62 # Check for Qt. The only part of Qt we use directly is qmake.
Chris@42 63
Chris@42 64 AC_DEFUN([SV_CHECK_QT],
Chris@42 65 [
Chris@42 66 AC_REQUIRE([AC_PROG_CXX])
Chris@42 67
Chris@42 68 if test x$QMAKE = x ; then
Chris@42 69 AC_CHECK_PROG(QMAKE, qmake-qt4, $QTDIR/bin/qmake-qt4,,$QTDIR/bin/)
Chris@42 70 fi
Chris@42 71 if test x$QMAKE = x ; then
Chris@42 72 AC_CHECK_PROG(QMAKE, qmake, $QTDIR/bin/qmake,,$QTDIR/bin/)
Chris@42 73 fi
Chris@42 74 if test x$QMAKE = x ; then
Chris@42 75 AC_CHECK_PROG(QMAKE, qmake.exe, $QTDIR/bin/qmake.exe,,$QTDIR/bin/)
Chris@42 76 fi
Chris@42 77 if test x$QMAKE = x ; then
Chris@42 78 AC_CHECK_PROG(QMAKE, qmake-qt4, qmake-qt4,,$PATH)
Chris@42 79 fi
Chris@42 80 if test x$QMAKE = x ; then
Chris@42 81 AC_CHECK_PROG(QMAKE, qmake, qmake,,$PATH)
Chris@42 82 fi
Chris@42 83 if test x$QMAKE = x ; then
Chris@42 84 AC_MSG_ERROR([
Chris@42 85 Failed to find the required qmake-qt4 or qmake program. Please
Chris@42 86 ensure you have the necessary Qt4 development files installed, and
Chris@42 87 if necessary set QTDIR to the location of your Qt4 installation.
Chris@42 88 ])
Chris@42 89 fi
Chris@42 90
Chris@42 91 # Suitable versions of qmake should print out something like:
Chris@42 92 #
Chris@42 93 # QMake version 2.01a
Chris@42 94 # Using Qt version 4.6.3 in /usr/lib
Chris@42 95 #
Chris@42 96 # This may be translated, so we check only for the numbers (2.x and 4.x
Chris@42 97 # in that order).
Chris@42 98 #
Chris@42 99 QMAKE_VERSION_OUTPUT=`$QMAKE -v`
Chris@42 100 case "$QMAKE_VERSION_OUTPUT" in
Chris@42 101 *2.*4.*) ;;
Chris@42 102 *) AC_MSG_WARN([
Chris@42 103 *** The version of qmake found in "$QMAKE" looks like it might be
Chris@42 104 from the wrong version of Qt (Qt4 is required). Please check
Chris@42 105 that this is the correct version of qmake for Qt4 builds.
Chris@42 106 ])
Chris@42 107 esac
Chris@42 108
Chris@42 109 case "`uname`" in
Chris@42 110 *Darwin*) QMAKE="$QMAKE -spec macx-g++";;
Chris@42 111 esac
Chris@42 112
Chris@42 113 ])
Chris@42 114