annotate configure.ac @ 198:78336f4b8935

* Add basic build files
author Chris Cannam
date Wed, 22 Sep 2010 11:12:06 +0100
parents
children 799ef3b24c21
rev   line source
Chris@198 1
Chris@198 2 AC_INIT(SVcore, 1.8, cannam@all-day-breakfast.com)
Chris@198 3
Chris@198 4 AC_CONFIG_SRCDIR(base/base.pro)
Chris@198 5
Chris@198 6 # Autoconf will set CXXFLAGS; we don't usually want it to, because we
Chris@198 7 # either define our own flags (at least if GCC is in use) or else use
Chris@198 8 # the user's preferences. We need to ensure CXXFLAGS is only set if
Chris@198 9 # the user has expressly set it. So, save the user's (or empty)
Chris@198 10 # setting now and restore it after Autoconf has done its bit of
Chris@198 11 # piddling about.
Chris@198 12 USER_CXXFLAGS="$CXXFLAGS"
Chris@198 13
Chris@198 14 AC_LANG_CPLUSPLUS
Chris@198 15
Chris@198 16 AC_PROG_CC
Chris@198 17 AC_PROG_CXX
Chris@198 18 AC_PROG_INSTALL
Chris@198 19 AC_PROG_MKDIR_P
Chris@198 20
Chris@198 21 AC_HEADER_STDC
Chris@198 22
Chris@198 23 # These are the flags Autoconf guesses for us; we use them later if
Chris@198 24 # the user has set none and we are not using GCC (so lack our own
Chris@198 25 # preferred flags)
Chris@198 26 AUTOCONF_CXXFLAGS="$CXXFLAGS"
Chris@198 27
Chris@198 28 PKG_PROG_PKG_CONFIG
Chris@198 29
Chris@198 30 SV_CHECK_QT
Chris@198 31
Chris@198 32 SV_DEFINES_DEBUG="-DDEBUG -DBUILD_DEBUG -DWANT_TIMING"
Chris@198 33 SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING"
Chris@198 34 SV_DEFINES_MINIMAL="$SV_DEFINES_RELEASE"
Chris@198 35
Chris@198 36 # Now we have: USER_CXXFLAGS contains any flags the user set
Chris@198 37 # explicitly; AUTOCONF_CXXFLAGS contains flags that Autoconf thought
Chris@198 38 # we should use. If we have GCC, we override the latter but then
Chris@198 39 # allow ourselves to be overridden (later) by the former
Chris@198 40
Chris@198 41 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
Chris@198 42 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
Chris@198 43 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS"
Chris@198 44
Chris@198 45 if test "x$GCC" = "xyes"; then
Chris@198 46 CXXFLAGS_DEBUG="-Wall -Woverloaded-virtual -Wextra -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -g -pipe"
Chris@198 47 CXXFLAGS_RELEASE="-g0 -O2 -Wall -pipe"
Chris@198 48 CXXFLAGS_MINIMAL="-g0 -O0"
Chris@198 49 fi
Chris@198 50
Chris@198 51 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
Chris@198 52 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE"
Chris@198 53
Chris@198 54 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build])
Chris@198 55 CXXFLAGS_BUILD="$CXXFLAGS_DEBUG"
Chris@198 56 SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"])
Chris@198 57
Chris@198 58 if test x"$USER_CXXFLAGS" != x; then
Chris@198 59 AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".])
Chris@198 60 AC_MSG_NOTICE(Overriding default compiler flags with the above user setting.)
Chris@198 61 CXXFLAGS_BUILD="$USER_CXXFLAGS"
Chris@198 62 CXXFLAGS_MINIMAL="$USER_CXXFLAGS"
Chris@198 63 fi
Chris@198 64
Chris@198 65 CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD"
Chris@198 66
Chris@198 67 SV_MODULE_REQUIRED([bz2],[],[bzlib.h],[bz2],[BZ2_bzReadOpen])
Chris@198 68 SV_MODULE_REQUIRED([fftw3],[fftw3 >= 3.0.0],[fftw3.h],[fftw3],[fftw_execute])
Chris@198 69 SV_MODULE_REQUIRED([fftw3f],[fftw3f >= 3.0.0],[fftw3.h],[fftw3f],[fftwf_execute])
Chris@198 70 SV_MODULE_REQUIRED([sndfile],[sndfile >= 1.0.16],[sndfile.h],[sndfile],[sf_open])
Chris@198 71 SV_MODULE_REQUIRED([samplerate],[samplerate >= 0.1.2],[samplerate.h],[samplerate],[src_new])
Chris@198 72 SV_MODULE_REQUIRED([vamp],[vamp >= 2.1],[vamp/vamp.h],[],[])
Chris@198 73 SV_MODULE_REQUIRED([vamphostsdk],[vamp-hostsdk >= 2.0],[vamp-hostsdk/PluginLoader.h],[],[])
Chris@198 74 SV_MODULE_REQUIRED([rubberband],[rubberband],[rubberband/RubberBandStretcher.h],[rubberband],[rubberband_new])
Chris@198 75 SV_MODULE_REQUIRED([raptor],[raptor >= 1.4.20],[raptor.h],[raptor],[raptor_start_parse])
Chris@198 76 SV_MODULE_REQUIRED([rasqal],[rasqal >= 0.9.19],[rasqal/rasqal.h],[rasqal],[rasqal_new_world])
Chris@198 77 SV_MODULE_REQUIRED([redland],[redland >= 1.0.10],[librdf.h],[rdf],[librdf_new_world])
Chris@198 78
Chris@198 79 SV_MODULE_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new])
Chris@198 80 SV_MODULE_OPTIONAL([JACK],[jack >= 0.100],[jack/jack.h],[jack],[jack_client_open])
Chris@198 81 SV_MODULE_OPTIONAL([libpulse],[libpulse >= 0.9],[pulse/pulseaudio.h],[pulse],[pa_stream_new])
Chris@198 82 SV_MODULE_OPTIONAL([lrdf],[lrdf >= 0.2],[lrdf.h],[lrdf],[lrdf_init])
Chris@198 83 SV_MODULE_OPTIONAL([oggz],[oggz >= 1.0.0],[oggz/oggz.h],[oggz],[oggz_run])
Chris@198 84 SV_MODULE_OPTIONAL([fishsound],[fishsound >= 1.0.0],[fishsound/fishsound.h],[fishsound],[fish_sound_new])
Chris@198 85 SV_MODULE_OPTIONAL([mad],[mad >= 0.15.0],[mad.h],[mad],[mad_decoder_init])
Chris@198 86 SV_MODULE_OPTIONAL([id3tag],[id3tag >= 0.15.0],[id3tag.h],[id3tag],[id3_tag_new])
Chris@198 87
Chris@198 88 AC_SUBST(PERL)
Chris@198 89 AC_SUBST(XARGS)
Chris@198 90 AC_SUBST(MAKEDEPEND)
Chris@198 91 AC_SUBST(SHA1SUM)
Chris@198 92 AC_SUBST(CUT)
Chris@198 93
Chris@198 94 AC_SUBST(CFLAGS)
Chris@198 95 AC_SUBST(CXXFLAGS)
Chris@198 96 AC_SUBST(CXXFLAGS_MINIMAL)
Chris@198 97 AC_SUBST(HAVES)
Chris@198 98 AC_SUBST(LIBS)
Chris@198 99
Chris@198 100 AC_SUBST(CC)
Chris@198 101 AC_SUBST(CXX)
Chris@198 102
Chris@198 103 AC_SUBST(CODENAME)
Chris@198 104
Chris@198 105 AC_OUTPUT([config.pri])
Chris@198 106
Chris@198 107 if ! $QMAKE -r; then
Chris@198 108 AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"])
Chris@198 109 fi
Chris@198 110
Chris@198 111 # qmake builds our static libraries, which is fine -- what we'd really
Chris@198 112 # like to do afterwards is bundle them into a single .so with e.g.
Chris@198 113
Chris@198 114 # gcc -Wl,--whole-archive */*.a -Wl,--no-whole-archive -o libsvcore.so
Chris@198 115
Chris@198 116 # but how best to arrange this? if it's not possible, we'll presumably
Chris@198 117 # just have to use a single (q)make(project)file instead.
Chris@198 118
Chris@198 119 AC_MSG_NOTICE([
Chris@198 120
Chris@198 121 Configuration complete.
Chris@198 122 Please check the above messages for any warnings that you
Chris@198 123 might care about, and then run "make".
Chris@198 124
Chris@198 125 The file config.pri contains the configuration settings for
Chris@198 126 qmake. If you want to adjust these by hand, edit config.pri
Chris@198 127 and run "qmake -r" again to regenerate the Makefile.
Chris@198 128 ])