Chris@0: Chris@208: AC_INIT([Tony], 0.3, cannam@all-day-breakfast.com) Chris@0: Chris@0: AC_CONFIG_SRCDIR(src/main.cpp) Chris@0: Chris@0: # Autoconf will set CXXFLAGS; we don't usually want it to, because we Chris@0: # either define our own flags (at least if GCC is in use) or else use Chris@0: # the user's preferences. We need to ensure CXXFLAGS is only set if Chris@0: # the user has expressly set it. So, save the user's (or empty) Chris@0: # setting now and restore it after Autoconf has done its bit of Chris@0: # piddling about. Chris@0: USER_CXXFLAGS="$CXXFLAGS" Chris@0: Chris@0: # If the user supplied CFLAGS but not CXXFLAGS, use CFLAGS instead Chris@0: if test x"$USER_CXXFLAGS" = x; then Chris@0: if test x"$CFLAGS" != x; then Chris@0: USER_CXXFLAGS="$CFLAGS" Chris@0: fi Chris@0: fi Chris@0: Chris@0: AC_LANG_CPLUSPLUS Chris@0: Chris@0: AC_PROG_CC Chris@0: AC_PROG_CXX Chris@0: AC_PROG_INSTALL Chris@0: AC_PROG_MKDIR_P Chris@0: Chris@0: AC_HEADER_STDC Chris@0: Chris@0: # These are the flags Autoconf guesses for us; we use them later if Chris@0: # the user has set none and we are not using GCC (so lack our own Chris@0: # preferred flags) Chris@0: AUTOCONF_CXXFLAGS="$CXXFLAGS" Chris@0: Chris@0: PKG_PROG_PKG_CONFIG Chris@0: Chris@0: SV_CHECK_QT Chris@0: Chris@0: SV_DEFINES_DEBUG="-DDEBUG -DBUILD_DEBUG -DWANT_TIMING" Chris@0: SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING" Chris@0: SV_DEFINES_MINIMAL="$SV_DEFINES_RELEASE" Chris@0: Chris@0: # Now we have: USER_CXXFLAGS contains any flags the user set Chris@0: # explicitly; AUTOCONF_CXXFLAGS contains flags that Autoconf thought Chris@0: # we should use. If we have GCC, we override the latter but then Chris@0: # allow ourselves to be overridden (later) by the former Chris@0: Chris@0: CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS" Chris@0: CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS" Chris@0: CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS" Chris@0: Chris@0: if test "x$GCC" = "xyes"; then Chris@0: CXXFLAGS_DEBUG="-Wall -Woverloaded-virtual -Wextra -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -g -pipe" Chris@0: CXXFLAGS_RELEASE="-g0 -O2 -Wall -pipe" Chris@0: CXXFLAGS_MINIMAL="-g0 -O0" Chris@0: fi Chris@0: Chris@0: CXXFLAGS_BUILD="$CXXFLAGS_RELEASE" Chris@0: SV_DEFINES_BUILD="$SV_DEFINES_RELEASE" Chris@0: Chris@0: QMAKE_CONFIG="release" Chris@0: Chris@0: AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build]) Chris@0: QMAKE_CONFIG="debug" Chris@0: CXXFLAGS_BUILD="$CXXFLAGS_DEBUG" Chris@0: SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"]) Chris@0: Chris@0: if test x"$USER_CXXFLAGS" != x; then Chris@0: AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".]) Chris@0: AC_MSG_NOTICE(Overriding default compiler flags with the above user setting.) Chris@0: CXXFLAGS_BUILD="$USER_CXXFLAGS" Chris@0: CXXFLAGS_MINIMAL="$USER_CXXFLAGS" Chris@0: fi Chris@0: Chris@0: CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD" Chris@0: Chris@0: SV_MODULE_REQUIRED([bz2],[],[bzlib.h],[bz2],[BZ2_bzReadOpen]) Chris@0: SV_MODULE_REQUIRED([fftw3],[fftw3 >= 3.0.0],[fftw3.h],[fftw3],[fftw_execute]) Chris@0: SV_MODULE_REQUIRED([fftw3f],[fftw3f >= 3.0.0],[fftw3.h],[fftw3f],[fftwf_execute]) Chris@0: SV_MODULE_REQUIRED([sndfile],[sndfile >= 1.0.16],[sndfile.h],[sndfile],[sf_open]) Chris@0: SV_MODULE_REQUIRED([samplerate],[samplerate >= 0.1.2],[samplerate.h],[samplerate],[src_new]) Chris@0: SV_MODULE_REQUIRED([vamp],[vamp >= 2.1],[vamp/vamp.h],[],[]) Chris@50: SV_MODULE_REQUIRED([vamphostsdk],[vamp-hostsdk >= 2.5],[vamp-hostsdk/PluginLoader.h],[vamp-hostsdk],[libvamphostsdk_v_2_5_present]) Chris@0: SV_MODULE_REQUIRED([rubberband],[rubberband],[rubberband/RubberBandStretcher.h],[rubberband],[rubberband_new]) Chris@50: SV_MODULE_REQUIRED([sord],[sord-0 >= 0.5],[sord/sord.h],[sord-0],[sord_world_new]) Chris@50: SV_MODULE_REQUIRED([serd],[serd-0 >= 0.5],[serd/serd.h],[serd-0],[serd_reader_read_file]) Chris@0: Chris@0: SV_MODULE_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new]) Chris@0: SV_MODULE_OPTIONAL([portaudio_2_0],[portaudio-2.0 >= 19],[portaudio.h],[portaudio],[Pa_IsFormatSupported]) Chris@0: SV_MODULE_OPTIONAL([JACK],[jack >= 0.100],[jack/jack.h],[jack],[jack_client_open]) Chris@0: SV_MODULE_OPTIONAL([libpulse],[libpulse >= 0.9],[pulse/pulseaudio.h],[pulse],[pa_stream_new]) Chris@0: SV_MODULE_OPTIONAL([lrdf],[lrdf >= 0.2],[lrdf.h],[lrdf],[lrdf_init]) Chris@0: SV_MODULE_OPTIONAL([oggz],[oggz >= 1.0.0],[oggz/oggz.h],[oggz],[oggz_run]) Chris@0: SV_MODULE_OPTIONAL([fishsound],[fishsound >= 1.0.0],[fishsound/fishsound.h],[fishsound],[fish_sound_new]) Chris@0: SV_MODULE_OPTIONAL([mad],[mad >= 0.15.0],[mad.h],[mad],[mad_decoder_init]) Chris@0: SV_MODULE_OPTIONAL([id3tag],[id3tag >= 0.15.0],[id3tag.h],[id3tag],[id3_tag_new]) Chris@0: Chris@0: # Link in -lX11 if it exists -- this is for the X error handler Chris@0: SV_MODULE_OPTIONAL([X11],[x11 >= 1.0.0],[X11/X.h],[x11],[XGetErrorText]) Chris@0: Chris@0: AC_SUBST(PERL) Chris@0: AC_SUBST(XARGS) Chris@0: AC_SUBST(MAKEDEPEND) Chris@0: AC_SUBST(SHA1SUM) Chris@0: AC_SUBST(CUT) Chris@0: Chris@0: AC_SUBST(CFLAGS) Chris@0: AC_SUBST(CXXFLAGS) Chris@0: AC_SUBST(CXXFLAGS_MINIMAL) Chris@50: AC_SUBST(LDFLAGS) Chris@0: AC_SUBST(HAVES) Chris@0: AC_SUBST(LIBS) Chris@0: Chris@0: AC_SUBST(CC) Chris@0: AC_SUBST(CXX) Chris@0: Chris@0: AC_SUBST(QMAKE_CONFIG) Chris@0: Chris@0: AC_CONFIG_SUBDIRS([svcore svgui svapp]) Chris@0: AC_CONFIG_FILES([config.pri version.h]) Chris@0: Chris@0: AC_OUTPUT Chris@0: Chris@108: if ! $QMAKE -r tony.pro; then Chris@0: AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"]) Chris@0: fi Chris@0: Chris@0: AC_MSG_NOTICE([ Chris@0: Chris@0: Configuration complete. Chris@0: Please check the above messages for any warnings that you Chris@0: might care about, and then run "make". Chris@0: Chris@0: The file config.pri contains the configuration settings for Chris@0: qmake. If you want to adjust these by hand, edit config.pri Chris@50: and run "$QMAKE -r" again to regenerate the Makefile. Chris@0: ])