annotate acinclude.m4 @ 571:94924cab11c8

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