annotate configure.ac @ 636:1a4c76e0f7c5

* Experimental autoconf procedure to produce qmake include file
author Chris Cannam
date Tue, 14 Sep 2010 09:45:30 +0100
parents
children 465f769ccad0
rev   line source
Chris@636 1
Chris@636 2 AC_INIT(SVcore, 1.8, cannam@all-day-breakfast.com)
Chris@636 3
Chris@636 4 AC_CONFIG_SRCDIR(base/AudioLevel.cpp)
Chris@636 5
Chris@636 6 # Autoconf will set CXXFLAGS; we don't usually want it to, because we
Chris@636 7 # either define our own flags (at least if GCC is in use) or else use
Chris@636 8 # the user's preferences. We need to ensure CXXFLAGS is only set if
Chris@636 9 # the user has expressly set it. So, save the user's (or empty)
Chris@636 10 # setting now and restore it after Autoconf has done its bit of
Chris@636 11 # piddling about.
Chris@636 12 USER_CXXFLAGS="$CXXFLAGS"
Chris@636 13
Chris@636 14 AC_LANG_CPLUSPLUS
Chris@636 15
Chris@636 16 AC_PROG_CC
Chris@636 17 AC_PROG_CXX
Chris@636 18 AC_PROG_INSTALL
Chris@636 19 AC_PROG_MKDIR_P
Chris@636 20
Chris@636 21 AC_PATH_X
Chris@636 22 AC_HEADER_STDC
Chris@636 23
Chris@636 24 # These are the flags Autoconf guesses for us; we use them later if
Chris@636 25 # the user has set none and we are not using GCC (so lack our own
Chris@636 26 # preferred flags)
Chris@636 27 AUTOCONF_CXXFLAGS="$CXXFLAGS"
Chris@636 28
Chris@636 29 PKG_PROG_PKG_CONFIG
Chris@636 30
Chris@636 31 SV_CHECK_QT
Chris@636 32
Chris@636 33 AC_CHECK_LIB([bz2],[BZ2_bzReadOpen],[LIBS="$LIBS -lbz2"],[AC_MSG_ERROR(Failed to find required bzip2 library)])
Chris@636 34
Chris@636 35 PKG_CHECK_MODULES([JACK],[jack >= 0.100],[HAVES="$HAVES HAVE_LIBJACK"],[
Chris@636 36 AC_MSG_WARN(No JACK library found)])
Chris@636 37
Chris@636 38 PKG_CHECK_MODULES([libpulse],[libpulse >= 0.9],[HAVES="$HAVES HAVE_LIBPULSE"],[
Chris@636 39 AC_MSG_WARN(No PulseAudio library found)])
Chris@636 40
Chris@636 41 # bit messy this
Chris@636 42 PKG_CHECK_MODULES([fftw3],[fftw3 >= 3.0.0],[HAVES="$HAVES HAVE_FFTW3"],[])
Chris@636 43 PKG_CHECK_MODULES([fftw3f],[fftw3f >= 3.0.0],[HAVES="$HAVES HAVE_FFTW3F"],[])
Chris@636 44 PKG_CHECK_MODULES([sndfile],[sndfile >= 1.0.16],[HAVES="$HAVES HAVE_SNDFILE"],[])
Chris@636 45 PKG_CHECK_MODULES([liblo],[liblo >= 0.7],[HAVES="$HAVES HAVE_LIBLO"],[])
Chris@636 46 PKG_CHECK_MODULES([lrdf],[lrdf >= 0.2],[HAVES="$HAVES HAVE_LRDF"],[])
Chris@636 47 PKG_CHECK_MODULES([samplerate],[samplerate >= 0.1.2],[HAVES="$HAVES HAVE_SAMPLERATE"],[])
Chris@636 48 PKG_CHECK_MODULES([vamp],[vamp >= 2.1],[HAVES="$HAVES HAVE_VAMP"],[])
Chris@636 49 PKG_CHECK_MODULES([vamphostsdk],[vamp-hostsdk >= 2.1],[HAVES="$HAVES HAVE_VAMP_HOSTSDK"],[])
Chris@636 50 PKG_CHECK_MODULES([oggz],[oggz >= 1.0.0],[HAVES="$HAVES HAVE_OGGZ"],[])
Chris@636 51 PKG_CHECK_MODULES([fishsound],[fishsound >= 1.0.0],[HAVES="$HAVES HAVE_FISHSOUND"],[])
Chris@636 52 PKG_CHECK_MODULES([mad],[fishsound >= 0.15.0],[HAVES="$HAVES HAVE_MAD"],[])
Chris@636 53 PKG_CHECK_MODULES([id3tag],[id3tag >= 0.15.0],[HAVES="$HAVES HAVE_ID3TAG"],[])
Chris@636 54 PKG_CHECK_MODULES([raptor],[raptor >= 1.4.20],[HAVES="$HAVES HAVE_RAPTOR"],[])
Chris@636 55 PKG_CHECK_MODULES([rasqal],[rasqal >= 0.9.19],[HAVES="$HAVES HAVE_RASQAL"],[])
Chris@636 56 PKG_CHECK_MODULES([redland],[redland >= 1.0.10],[HAVES="$HAVES HAVE_REDLAND"],[])
Chris@636 57
Chris@636 58 AC_PATH_PROG([PERL],[perl])
Chris@636 59 if test x$PERL = x ; then
Chris@636 60 AC_MSG_ERROR([Failed to find required perl program.])
Chris@636 61 fi
Chris@636 62
Chris@636 63 AC_PATH_PROG([XARGS],[xargs])
Chris@636 64 if test x$XARGS = x ; then
Chris@636 65 AC_MSG_ERROR([Failed to find required xargs program.])
Chris@636 66 fi
Chris@636 67
Chris@636 68 AC_PATH_PROG([MAKEDEPEND],[makedepend])
Chris@636 69 if test x$MAKEDEPEND = x ; then
Chris@636 70 AC_MSG_ERROR([Failed to find required makedepend program.])
Chris@636 71 fi
Chris@636 72
Chris@636 73 AC_PATH_PROG([SHA1SUM],[sha1sum])
Chris@636 74 AC_PATH_PROG([SHA1SUM],[sha1 -q])
Chris@636 75 if test x$SHA1SUM = x ; then
Chris@636 76 AC_MSG_ERROR([Failed to find required sha1sum or sha1 program.])
Chris@636 77 fi
Chris@636 78
Chris@636 79 AC_PATH_PROG([CUT],[cut])
Chris@636 80 if test x$CUT = x ; then
Chris@636 81 AC_MSG_ERROR([Failed to find required cut program.])
Chris@636 82 fi
Chris@636 83
Chris@636 84 SV_DEFINES_DEBUG="-DDEBUG -DBUILD_DEBUG -DWANT_TIMING"
Chris@636 85 SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING"
Chris@636 86 SV_DEFINES_MINIMAL="$SV_DEFINES_RELEASE"
Chris@636 87
Chris@636 88 # Now we have: USER_CXXFLAGS contains any flags the user set
Chris@636 89 # explicitly; AUTOCONF_CXXFLAGS contains flags that Autoconf thought
Chris@636 90 # we should use. If we have GCC, we override the latter but then
Chris@636 91 # allow ourselves to be overridden (later) by the former
Chris@636 92
Chris@636 93 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
Chris@636 94 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
Chris@636 95 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS"
Chris@636 96
Chris@636 97 if test "x$GCC" = "xyes"; then
Chris@636 98 CXXFLAGS_DEBUG="-Wall -Woverloaded-virtual -Wextra -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -g -pipe"
Chris@636 99 CXXFLAGS_RELEASE="-g0 -O2 -Wall -pipe"
Chris@636 100 CXXFLAGS_MINIMAL="-g0 -O0"
Chris@636 101 fi
Chris@636 102
Chris@636 103 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
Chris@636 104 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE"
Chris@636 105
Chris@636 106 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build])
Chris@636 107 CXXFLAGS_BUILD="$CXXFLAGS_DEBUG"
Chris@636 108 SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"])
Chris@636 109
Chris@636 110 if test x"$USER_CXXFLAGS" != x; then
Chris@636 111 AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".])
Chris@636 112 AC_MSG_NOTICE(Overriding default compiler flags with the above user setting.)
Chris@636 113 CXXFLAGS_BUILD="$USER_CXXFLAGS"
Chris@636 114 CXXFLAGS_MINIMAL="$USER_CXXFLAGS"
Chris@636 115 fi
Chris@636 116
Chris@636 117 CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD"
Chris@636 118
Chris@636 119 #if test -z "$JACK_CFLAGS" ; then
Chris@636 120 # AC_MSG_WARN([Required JACK library not found, building with no audio!])
Chris@636 121 #fi
Chris@636 122 #if test -z "$ALSA_CFLAGS" ; then
Chris@636 123 # AC_MSG_WARN([Required ALSA library not found, building with no MIDI!])
Chris@636 124 #fi
Chris@636 125
Chris@636 126 AC_SUBST(PERL)
Chris@636 127 AC_SUBST(XARGS)
Chris@636 128 AC_SUBST(MAKEDEPEND)
Chris@636 129 AC_SUBST(SHA1SUM)
Chris@636 130 AC_SUBST(CUT)
Chris@636 131
Chris@636 132 AC_SUBST(CFLAGS)
Chris@636 133 AC_SUBST(CXXFLAGS)
Chris@636 134 AC_SUBST(CXXFLAGS_MINIMAL)
Chris@636 135 AC_SUBST(HAVES)
Chris@636 136 #AC_SUBST(DSSI_LOCALFLAGS)
Chris@636 137
Chris@636 138 AC_SUBST(CC)
Chris@636 139 AC_SUBST(CXX)
Chris@636 140
Chris@636 141 AC_SUBST(CODENAME)
Chris@636 142
Chris@636 143 AC_OUTPUT([config.pri])
Chris@636 144
Chris@636 145 # qmake builds our static libraries, which is fine -- what we'd really
Chris@636 146 # like to do afterwards is bundle them into a single .so with e.g.
Chris@636 147
Chris@636 148 # gcc -Wl,--whole-archive */*.a -Wl,--no-whole-archive -o libsvcore.so
Chris@636 149
Chris@636 150 # but how best to arrange this? if it's not possible, we'll presumably
Chris@636 151 # just have to use a single (q)make(project)file instead.
Chris@636 152