annotate configure.ac @ 884:93a770ecfc98 cxx11

CXX11 (-std=c++11) branch, to test build environments before making any code adaptations
author Chris Cannam
date Mon, 17 Nov 2014 15:31:08 +0000
parents 5462ac97d28f
children b40f29144e80 a16456ca5e71
rev   line source
Chris@350 1
Chris@884 2 AC_INIT([Sonic Visualiser], [2.4.1], cannam@all-day-breakfast.com)
Chris@350 3
Chris@351 4 AC_CONFIG_SRCDIR(main/main.cpp)
Chris@350 5
Chris@350 6 # Autoconf will set CXXFLAGS; we don't usually want it to, because we
Chris@350 7 # either define our own flags (at least if GCC is in use) or else use
Chris@350 8 # the user's preferences. We need to ensure CXXFLAGS is only set if
Chris@350 9 # the user has expressly set it. So, save the user's (or empty)
Chris@350 10 # setting now and restore it after Autoconf has done its bit of
Chris@350 11 # piddling about.
Chris@350 12 USER_CXXFLAGS="$CXXFLAGS"
Chris@350 13
Chris@405 14 # If the user supplied CFLAGS but not CXXFLAGS, use CFLAGS instead
Chris@405 15 if test x"$USER_CXXFLAGS" = x; then
Chris@405 16 if test x"$CFLAGS" != x; then
Chris@405 17 USER_CXXFLAGS="$CFLAGS"
Chris@405 18 fi
Chris@405 19 fi
Chris@405 20
Chris@350 21 AC_LANG_CPLUSPLUS
Chris@350 22
Chris@350 23 AC_PROG_CC
Chris@350 24 AC_PROG_CXX
Chris@350 25 AC_PROG_INSTALL
Chris@350 26 AC_PROG_MKDIR_P
Chris@350 27
Chris@884 28 # We are daringly making use of C++11 now
Chris@884 29 AX_CXX_COMPILE_STDCXX_11(noext)
Chris@884 30
Chris@350 31 AC_HEADER_STDC
Chris@350 32
Chris@350 33 # These are the flags Autoconf guesses for us; we use them later if
Chris@350 34 # the user has set none and we are not using GCC (so lack our own
Chris@350 35 # preferred flags)
Chris@350 36 AUTOCONF_CXXFLAGS="$CXXFLAGS"
Chris@350 37
Chris@350 38 PKG_PROG_PKG_CONFIG
Chris@350 39
Chris@350 40 SV_CHECK_QT
Chris@350 41
Chris@350 42 SV_DEFINES_DEBUG="-DDEBUG -DBUILD_DEBUG -DWANT_TIMING"
Chris@350 43 SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING"
Chris@350 44 SV_DEFINES_MINIMAL="$SV_DEFINES_RELEASE"
Chris@350 45
Chris@350 46 # Now we have: USER_CXXFLAGS contains any flags the user set
Chris@350 47 # explicitly; AUTOCONF_CXXFLAGS contains flags that Autoconf thought
Chris@350 48 # we should use. If we have GCC, we override the latter but then
Chris@350 49 # allow ourselves to be overridden (later) by the former
Chris@350 50
Chris@350 51 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
Chris@350 52 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
Chris@350 53 CXXFLAGS_MINIMAL="$AUTOCONF_CXXFLAGS"
Chris@350 54
Chris@350 55 if test "x$GCC" = "xyes"; then
Chris@884 56 CXXFLAGS_DEBUG="-std=c++11 -Wall -Wextra -Werror -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -g -pipe"
Chris@884 57 CXXFLAGS_RELEASE="-std=c++11 -g0 -O2 -Wall -pipe"
Chris@884 58 CXXFLAGS_MINIMAL="-std=c++11 -g0 -O0"
Chris@350 59 fi
Chris@350 60
Chris@350 61 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE"
Chris@350 62 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE"
Chris@350 63
Chris@361 64 QMAKE_CONFIG="release"
Chris@361 65
Chris@350 66 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build])
Chris@361 67 QMAKE_CONFIG="debug"
Chris@350 68 CXXFLAGS_BUILD="$CXXFLAGS_DEBUG"
Chris@350 69 SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"])
Chris@350 70
Chris@350 71 if test x"$USER_CXXFLAGS" != x; then
Chris@350 72 AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".])
Chris@350 73 AC_MSG_NOTICE(Overriding default compiler flags with the above user setting.)
Chris@350 74 CXXFLAGS_BUILD="$USER_CXXFLAGS"
Chris@350 75 CXXFLAGS_MINIMAL="$USER_CXXFLAGS"
Chris@350 76 fi
Chris@350 77
Chris@350 78 CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD"
Chris@350 79
Chris@350 80 SV_MODULE_REQUIRED([bz2],[],[bzlib.h],[bz2],[BZ2_bzReadOpen])
Chris@350 81 SV_MODULE_REQUIRED([fftw3],[fftw3 >= 3.0.0],[fftw3.h],[fftw3],[fftw_execute])
Chris@350 82 SV_MODULE_REQUIRED([fftw3f],[fftw3f >= 3.0.0],[fftw3.h],[fftw3f],[fftwf_execute])
Chris@350 83 SV_MODULE_REQUIRED([sndfile],[sndfile >= 1.0.16],[sndfile.h],[sndfile],[sf_open])
Chris@350 84 SV_MODULE_REQUIRED([samplerate],[samplerate >= 0.1.2],[samplerate.h],[samplerate],[src_new])
Chris@350 85 SV_MODULE_REQUIRED([vamp],[vamp >= 2.1],[vamp/vamp.h],[],[])
Chris@560 86 SV_MODULE_REQUIRED([vamphostsdk],[vamp-hostsdk >= 2.5],[vamp-hostsdk/PluginLoader.h],[vamp-hostsdk],[libvamphostsdk_v_2_5_present])
Chris@350 87 SV_MODULE_REQUIRED([rubberband],[rubberband],[rubberband/RubberBandStretcher.h],[rubberband],[rubberband_new])
Chris@572 88 SV_MODULE_REQUIRED([sord],[sord-0 >= 0.5],[sord/sord.h],[sord-0],[sord_world_new])
Chris@572 89 SV_MODULE_REQUIRED([serd],[serd-0 >= 0.5],[serd/serd.h],[serd-0],[serd_reader_read_file])
Chris@350 90
Chris@350 91 SV_MODULE_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new])
Chris@358 92 SV_MODULE_OPTIONAL([portaudio_2_0],[portaudio-2.0 >= 19],[portaudio.h],[portaudio],[Pa_IsFormatSupported])
Chris@350 93 SV_MODULE_OPTIONAL([JACK],[jack >= 0.100],[jack/jack.h],[jack],[jack_client_open])
Chris@350 94 SV_MODULE_OPTIONAL([libpulse],[libpulse >= 0.9],[pulse/pulseaudio.h],[pulse],[pa_stream_new])
Chris@350 95 SV_MODULE_OPTIONAL([lrdf],[lrdf >= 0.2],[lrdf.h],[lrdf],[lrdf_init])
Chris@350 96 SV_MODULE_OPTIONAL([oggz],[oggz >= 1.0.0],[oggz/oggz.h],[oggz],[oggz_run])
Chris@350 97 SV_MODULE_OPTIONAL([fishsound],[fishsound >= 1.0.0],[fishsound/fishsound.h],[fishsound],[fish_sound_new])
Chris@350 98 SV_MODULE_OPTIONAL([mad],[mad >= 0.15.0],[mad.h],[mad],[mad_decoder_init])
Chris@350 99 SV_MODULE_OPTIONAL([id3tag],[id3tag >= 0.15.0],[id3tag.h],[id3tag],[id3_tag_new])
Chris@350 100
Chris@488 101 # Link in -lX11 if it exists -- this is for the X error handler
Chris@488 102 SV_MODULE_OPTIONAL([X11],[x11 >= 1.0.0],[X11/X.h],[x11],[XGetErrorText])
Chris@488 103
Chris@350 104 AC_SUBST(PERL)
Chris@350 105 AC_SUBST(XARGS)
Chris@350 106 AC_SUBST(MAKEDEPEND)
Chris@350 107 AC_SUBST(SHA1SUM)
Chris@350 108 AC_SUBST(CUT)
Chris@350 109
Chris@350 110 AC_SUBST(CFLAGS)
Chris@350 111 AC_SUBST(CXXFLAGS)
Chris@350 112 AC_SUBST(CXXFLAGS_MINIMAL)
Chris@560 113 AC_SUBST(LDFLAGS)
Chris@350 114 AC_SUBST(HAVES)
Chris@350 115 AC_SUBST(LIBS)
Chris@350 116
Chris@350 117 AC_SUBST(CC)
Chris@350 118 AC_SUBST(CXX)
Chris@350 119
Chris@361 120 AC_SUBST(QMAKE_CONFIG)
Chris@361 121
Chris@517 122 AC_CONFIG_SUBDIRS([svcore svgui svapp])
Chris@517 123 AC_CONFIG_FILES([config.pri version.h])
Chris@350 124
Chris@517 125 AC_OUTPUT
Chris@350 126
Chris@521 127 if ! $QMAKE -r sonic-visualiser.pro; then
Chris@350 128 AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"])
Chris@350 129 fi
Chris@350 130
Chris@350 131 AC_MSG_NOTICE([
Chris@350 132
Chris@350 133 Configuration complete.
Chris@350 134 Please check the above messages for any warnings that you
Chris@350 135 might care about, and then run "make".
Chris@350 136
Chris@350 137 The file config.pri contains the configuration settings for
Chris@350 138 qmake. If you want to adjust these by hand, edit config.pri
Chris@548 139 and run "$QMAKE -r" again to regenerate the Makefile.
Chris@350 140 ])