annotate acinclude.m4 @ 571:ce7b8b790020

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