Chris@636: Chris@636: AC_INIT(SVcore, 1.8, cannam@all-day-breakfast.com) Chris@636: Chris@636: AC_CONFIG_SRCDIR(base/AudioLevel.cpp) Chris@636: Chris@636: # Autoconf will set CXXFLAGS; we don't usually want it to, because we Chris@636: # either define our own flags (at least if GCC is in use) or else use Chris@636: # the user's preferences. We need to ensure CXXFLAGS is only set if Chris@636: # the user has expressly set it. So, save the user's (or empty) Chris@636: # setting now and restore it after Autoconf has done its bit of Chris@636: # piddling about. Chris@636: USER_CXXFLAGS="$CXXFLAGS" Chris@636: Chris@636: AC_LANG_CPLUSPLUS Chris@636: Chris@636: AC_PROG_CC Chris@636: AC_PROG_CXX Chris@636: AC_PROG_INSTALL Chris@636: AC_PROG_MKDIR_P Chris@636: Chris@636: AC_PATH_X Chris@636: AC_HEADER_STDC Chris@636: Chris@636: # These are the flags Autoconf guesses for us; we use them later if Chris@636: # the user has set none and we are not using GCC (so lack our own Chris@636: # preferred flags) Chris@636: AUTOCONF_CXXFLAGS="$CXXFLAGS" Chris@636: Chris@636: PKG_PROG_PKG_CONFIG Chris@636: Chris@636: SV_CHECK_QT Chris@636: Chris@636: AC_CHECK_LIB([bz2],[BZ2_bzReadOpen],[LIBS="$LIBS -lbz2"],[AC_MSG_ERROR(Failed to find required bzip2 library)]) Chris@636: Chris@636: PKG_CHECK_MODULES([JACK],[jack >= 0.100],[HAVES="$HAVES HAVE_LIBJACK"],[ Chris@636: AC_MSG_WARN(No JACK library found)]) Chris@636: Chris@636: PKG_CHECK_MODULES([libpulse],[libpulse >= 0.9],[HAVES="$HAVES HAVE_LIBPULSE"],[ Chris@636: AC_MSG_WARN(No PulseAudio library found)]) Chris@636: Chris@636: # bit messy this Chris@636: PKG_CHECK_MODULES([fftw3],[fftw3 >= 3.0.0],[HAVES="$HAVES HAVE_FFTW3"],[]) Chris@636: PKG_CHECK_MODULES([fftw3f],[fftw3f >= 3.0.0],[HAVES="$HAVES HAVE_FFTW3F"],[]) Chris@636: PKG_CHECK_MODULES([sndfile],[sndfile >= 1.0.16],[HAVES="$HAVES HAVE_SNDFILE"],[]) Chris@636: PKG_CHECK_MODULES([liblo],[liblo >= 0.7],[HAVES="$HAVES HAVE_LIBLO"],[]) Chris@636: PKG_CHECK_MODULES([lrdf],[lrdf >= 0.2],[HAVES="$HAVES HAVE_LRDF"],[]) Chris@636: PKG_CHECK_MODULES([samplerate],[samplerate >= 0.1.2],[HAVES="$HAVES HAVE_SAMPLERATE"],[]) Chris@636: PKG_CHECK_MODULES([vamp],[vamp >= 2.1],[HAVES="$HAVES HAVE_VAMP"],[]) Chris@636: PKG_CHECK_MODULES([vamphostsdk],[vamp-hostsdk >= 2.1],[HAVES="$HAVES HAVE_VAMP_HOSTSDK"],[]) Chris@636: PKG_CHECK_MODULES([oggz],[oggz >= 1.0.0],[HAVES="$HAVES HAVE_OGGZ"],[]) Chris@636: PKG_CHECK_MODULES([fishsound],[fishsound >= 1.0.0],[HAVES="$HAVES HAVE_FISHSOUND"],[]) Chris@636: PKG_CHECK_MODULES([mad],[fishsound >= 0.15.0],[HAVES="$HAVES HAVE_MAD"],[]) Chris@636: PKG_CHECK_MODULES([id3tag],[id3tag >= 0.15.0],[HAVES="$HAVES HAVE_ID3TAG"],[]) Chris@636: PKG_CHECK_MODULES([raptor],[raptor >= 1.4.20],[HAVES="$HAVES HAVE_RAPTOR"],[]) Chris@636: PKG_CHECK_MODULES([rasqal],[rasqal >= 0.9.19],[HAVES="$HAVES HAVE_RASQAL"],[]) Chris@636: PKG_CHECK_MODULES([redland],[redland >= 1.0.10],[HAVES="$HAVES HAVE_REDLAND"],[]) Chris@636: Chris@636: AC_PATH_PROG([PERL],[perl]) Chris@636: if test x$PERL = x ; then Chris@636: AC_MSG_ERROR([Failed to find required perl program.]) Chris@636: fi Chris@636: Chris@636: AC_PATH_PROG([XARGS],[xargs]) Chris@636: if test x$XARGS = x ; then Chris@636: AC_MSG_ERROR([Failed to find required xargs program.]) Chris@636: fi Chris@636: Chris@636: AC_PATH_PROG([MAKEDEPEND],[makedepend]) Chris@636: if test x$MAKEDEPEND = x ; then Chris@636: AC_MSG_ERROR([Failed to find required makedepend program.]) Chris@636: fi Chris@636: Chris@636: AC_PATH_PROG([SHA1SUM],[sha1sum]) Chris@636: AC_PATH_PROG([SHA1SUM],[sha1 -q]) Chris@636: if test x$SHA1SUM = x ; then Chris@636: AC_MSG_ERROR([Failed to find required sha1sum or sha1 program.]) Chris@636: fi Chris@636: Chris@636: AC_PATH_PROG([CUT],[cut]) Chris@636: if test x$CUT = x ; then Chris@636: AC_MSG_ERROR([Failed to find required cut program.]) Chris@636: fi Chris@636: Chris@636: SV_DEFINES_DEBUG="-DDEBUG -DBUILD_DEBUG -DWANT_TIMING" Chris@636: SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING" Chris@636: SV_DEFINES_MINIMAL="$SV_DEFINES_RELEASE" Chris@636: Chris@636: # Now we have: USER_CXXFLAGS contains any flags the user set Chris@636: # explicitly; AUTOCONF_CXXFLAGS contains flags that Autoconf thought Chris@636: # we should use. If we have GCC, we override the latter but then Chris@636: # allow ourselves to be overridden (later) by the former Chris@636: Chris@636: CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS" Chris@636: CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS" Chris@636: CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS" Chris@636: Chris@636: if test "x$GCC" = "xyes"; then Chris@636: CXXFLAGS_DEBUG="-Wall -Woverloaded-virtual -Wextra -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -g -pipe" Chris@636: CXXFLAGS_RELEASE="-g0 -O2 -Wall -pipe" Chris@636: CXXFLAGS_MINIMAL="-g0 -O0" Chris@636: fi Chris@636: Chris@636: CXXFLAGS_BUILD="$CXXFLAGS_RELEASE" Chris@636: SV_DEFINES_BUILD="$SV_DEFINES_RELEASE" Chris@636: Chris@636: AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build]) Chris@636: CXXFLAGS_BUILD="$CXXFLAGS_DEBUG" Chris@636: SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"]) Chris@636: Chris@636: if test x"$USER_CXXFLAGS" != x; then Chris@636: AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".]) Chris@636: AC_MSG_NOTICE(Overriding default compiler flags with the above user setting.) Chris@636: CXXFLAGS_BUILD="$USER_CXXFLAGS" Chris@636: CXXFLAGS_MINIMAL="$USER_CXXFLAGS" Chris@636: fi Chris@636: Chris@636: CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD" Chris@636: Chris@636: #if test -z "$JACK_CFLAGS" ; then Chris@636: # AC_MSG_WARN([Required JACK library not found, building with no audio!]) Chris@636: #fi Chris@636: #if test -z "$ALSA_CFLAGS" ; then Chris@636: # AC_MSG_WARN([Required ALSA library not found, building with no MIDI!]) Chris@636: #fi Chris@636: Chris@636: AC_SUBST(PERL) Chris@636: AC_SUBST(XARGS) Chris@636: AC_SUBST(MAKEDEPEND) Chris@636: AC_SUBST(SHA1SUM) Chris@636: AC_SUBST(CUT) Chris@636: Chris@636: AC_SUBST(CFLAGS) Chris@636: AC_SUBST(CXXFLAGS) Chris@636: AC_SUBST(CXXFLAGS_MINIMAL) Chris@636: AC_SUBST(HAVES) Chris@636: #AC_SUBST(DSSI_LOCALFLAGS) Chris@636: Chris@636: AC_SUBST(CC) Chris@636: AC_SUBST(CXX) Chris@636: Chris@636: AC_SUBST(CODENAME) Chris@636: Chris@636: AC_OUTPUT([config.pri]) Chris@636: Chris@636: # qmake builds our static libraries, which is fine -- what we'd really Chris@636: # like to do afterwards is bundle them into a single .so with e.g. Chris@636: Chris@636: # gcc -Wl,--whole-archive */*.a -Wl,--no-whole-archive -o libsvcore.so Chris@636: Chris@636: # but how best to arrange this? if it's not possible, we'll presumably Chris@636: # just have to use a single (q)make(project)file instead. Chris@636: