annotate configure.ac @ 684:1f1824a93c7d v2.1.1

Merge
author Chris Cannam
date Tue, 10 Dec 2019 09:42:21 +0000
parents 08859cbcd879
children
rev   line source
Chris@0 1
Chris@474 2 AC_INIT([Tony], [], cannam@all-day-breakfast.com)
Chris@0 3
Chris@580 4 AC_CONFIG_SRCDIR(main/main.cpp)
Chris@0 5
Chris@0 6 # Autoconf will set CXXFLAGS; we don't usually want it to, because we
Chris@0 7 # either define our own flags (at least if GCC is in use) or else use
Chris@0 8 # the user's preferences. We need to ensure CXXFLAGS is only set if
Chris@0 9 # the user has expressly set it. So, save the user's (or empty)
Chris@0 10 # setting now and restore it after Autoconf has done its bit of
Chris@0 11 # piddling about.
Chris@0 12 USER_CXXFLAGS="$CXXFLAGS"
Chris@0 13
Chris@0 14 # If the user supplied CFLAGS but not CXXFLAGS, use CFLAGS instead
Chris@0 15 if test x"$USER_CXXFLAGS" = x; then
Chris@0 16 if test x"$CFLAGS" != x; then
Chris@0 17 USER_CXXFLAGS="$CFLAGS"
Chris@0 18 fi
Chris@0 19 fi
Chris@0 20
Chris@0 21 AC_LANG_CPLUSPLUS
Chris@0 22
Chris@0 23 AC_PROG_CC
Chris@0 24 AC_PROG_CXX
Chris@0 25 AC_PROG_INSTALL
Chris@0 26 AC_PROG_MKDIR_P
Chris@0 27
Chris@400 28 # We are daringly making use of C++11 now
Chris@400 29 AX_CXX_COMPILE_STDCXX_11(noext)
Chris@400 30
Chris@0 31 AC_HEADER_STDC
Chris@0 32
Chris@0 33 # These are the flags Autoconf guesses for us; we use them later if
Chris@0 34 # the user has set none and we are not using GCC (so lack our own
Chris@0 35 # preferred flags)
Chris@0 36 AUTOCONF_CXXFLAGS="$CXXFLAGS"
Chris@0 37
Chris@0 38 PKG_PROG_PKG_CONFIG
Chris@0 39
Chris@0 40 SV_CHECK_QT
Chris@0 41
Chris@0 42 SV_DEFINES_DEBUG="-DDEBUG -DBUILD_DEBUG -DWANT_TIMING"
Chris@521 43 SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING -DNO_HIT_COUNTS"
Chris@0 44
Chris@0 45 # Now we have: USER_CXXFLAGS contains any flags the user set
Chris@0 46 # explicitly; AUTOCONF_CXXFLAGS contains flags that Autoconf thought
Chris@0 47 # we should use. If we have GCC, we override the latter but then
Chris@0 48 # allow ourselves to be overridden (later) by the former
Chris@0 49
Chris@0 50 CXXFLAGS_DEBUG="$AUTOCONF_CXXFLAGS"
Chris@557 51 OPTFLAGS_DEBUG="-O2"
Chris@557 52 LDFLAGS_DEBUG=""
Chris@0 53 CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
Chris@557 54 OPTFLAGS_RELEASE="-O2"
Chris@557 55 LDFLAGS_RELEASE=""
Chris@557 56 CXXSTANDARD=c++14
Chris@0 57
Chris@0 58 if test "x$GCC" = "xyes"; then
Chris@557 59 CXXFLAGS_ANY="-fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe"
Chris@557 60 CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -Werror"
Chris@557 61 OPTFLAGS_DEBUG="-O2"
Chris@557 62 CXXFLAGS_RELEASE="$CXXFLAGS_ANY -g0"
Chris@557 63 OPTFLAGS_RELEASE="-O3 -ffast-math"
Chris@557 64 LIBS_DEBUG="$LIBS"
Chris@557 65 AX_CHECK_COMPILE_FLAG(--std=$CXXSTANDARD, [], [AC_MSG_NOTICE([Compiler does not appear to support $CXXSTANDARD, falling back to c++11])
Chris@557 66 CXXSTANDARD=c++11])
Chris@0 67 fi
Chris@0 68
Chris@557 69 CXXFLAGS_BUILD="$CXXFLAGS_RELEASE $OPTFLAGS_RELEASE"
Chris@557 70 LDFLAGS_BUILD="$LDFLAGS_RELEASE $OPTFLAGS_RELEASE"
Chris@0 71 SV_DEFINES_BUILD="$SV_DEFINES_RELEASE"
Chris@0 72
Chris@0 73 QMAKE_CONFIG="release"
Chris@0 74
Chris@0 75 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug support [default=no]])],[AC_MSG_NOTICE([enabling debug build])
Chris@0 76 QMAKE_CONFIG="debug"
Chris@557 77 CXXFLAGS_BUILD="$CXXFLAGS_DEBUG $OPTFLAGS_DEBUG"
Chris@557 78 LDFLAGS_BUILD="$LDFLAGS_DEBUG"
Chris@557 79 SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"
Chris@557 80 LIBS="$LIBS_DEBUG"])
Chris@0 81
Chris@0 82 if test x"$USER_CXXFLAGS" != x; then
Chris@0 83 AC_MSG_NOTICE([The CXXFLAGS environment variable is set to "$USER_CXXFLAGS".])
Chris@0 84 AC_MSG_NOTICE(Overriding default compiler flags with the above user setting.)
Chris@0 85 CXXFLAGS_BUILD="$USER_CXXFLAGS"
Chris@0 86 CXXFLAGS_MINIMAL="$USER_CXXFLAGS"
Chris@0 87 fi
Chris@0 88
Chris@0 89 CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD"
Chris@0 90
Chris@0 91 SV_MODULE_REQUIRED([bz2],[],[bzlib.h],[bz2],[BZ2_bzReadOpen])
Chris@0 92 SV_MODULE_REQUIRED([fftw3],[fftw3 >= 3.0.0],[fftw3.h],[fftw3],[fftw_execute])
Chris@0 93 SV_MODULE_REQUIRED([fftw3f],[fftw3f >= 3.0.0],[fftw3.h],[fftw3f],[fftwf_execute])
Chris@0 94 SV_MODULE_REQUIRED([sndfile],[sndfile >= 1.0.16],[sndfile.h],[sndfile],[sf_open])
Chris@474 95 SV_MODULE_REQUIRED([libsamplerate],[samplerate >= 0.1.2],[samplerate.h],[samplerate],[src_new])
Chris@0 96 SV_MODULE_REQUIRED([rubberband],[rubberband],[rubberband/RubberBandStretcher.h],[rubberband],[rubberband_new])
Chris@50 97 SV_MODULE_REQUIRED([sord],[sord-0 >= 0.5],[sord/sord.h],[sord-0],[sord_world_new])
Chris@50 98 SV_MODULE_REQUIRED([serd],[serd-0 >= 0.5],[serd/serd.h],[serd-0],[serd_reader_read_file])
Chris@0 99
Chris@0 100 SV_MODULE_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new])
Chris@474 101 SV_MODULE_OPTIONAL([portaudio],[portaudio-2.0 >= 19],[portaudio.h],[portaudio],[Pa_IsFormatSupported])
Chris@0 102 SV_MODULE_OPTIONAL([JACK],[jack >= 0.100],[jack/jack.h],[jack],[jack_client_open])
Chris@0 103 SV_MODULE_OPTIONAL([libpulse],[libpulse >= 0.9],[pulse/pulseaudio.h],[pulse],[pa_stream_new])
Chris@568 104
Chris@568 105 SV_MODULE_REQUIRED([lrdf],[lrdf >= 0.2],[lrdf.h],[lrdf],[lrdf_init])
Chris@568 106 SV_MODULE_REQUIRED([oggz],[oggz >= 1.0.0],[oggz/oggz.h],[oggz],[oggz_run])
Chris@568 107 SV_MODULE_REQUIRED([fishsound],[fishsound >= 1.0.0],[fishsound/fishsound.h],[fishsound],[fish_sound_new])
Chris@568 108 SV_MODULE_REQUIRED([mad],[mad >= 0.15.0],[mad.h],[mad],[mad_decoder_init])
Chris@568 109 SV_MODULE_REQUIRED([id3tag],[id3tag >= 0.15.0],[id3tag.h],[id3tag],[id3_tag_new])
Chris@568 110 SV_MODULE_REQUIRED([opus],[opusfile],[opus/opusfile.h],[opusfile],[op_read_float])
Chris@0 111
Chris@0 112 # Link in -lX11 if it exists -- this is for the X error handler
Chris@0 113 SV_MODULE_OPTIONAL([X11],[x11 >= 1.0.0],[X11/X.h],[x11],[XGetErrorText])
Chris@0 114
Chris@0 115 AC_SUBST(PERL)
Chris@0 116 AC_SUBST(XARGS)
Chris@0 117 AC_SUBST(MAKEDEPEND)
Chris@0 118 AC_SUBST(SHA1SUM)
Chris@0 119 AC_SUBST(CUT)
Chris@0 120
Chris@0 121 AC_SUBST(CFLAGS)
Chris@0 122 AC_SUBST(CXXFLAGS)
Chris@557 123 AC_SUBST(CXXSTANDARD)
Chris@50 124 AC_SUBST(LDFLAGS)
Chris@0 125 AC_SUBST(HAVES)
Chris@0 126 AC_SUBST(LIBS)
Chris@0 127
Chris@0 128 AC_SUBST(CC)
Chris@0 129 AC_SUBST(CXX)
Chris@0 130
Chris@557 131 AC_SUBST(prefix)
Chris@557 132
Chris@0 133 AC_SUBST(QMAKE_CONFIG)
Chris@0 134
Chris@474 135 AC_CONFIG_FILES([config.pri])
Chris@0 136
Chris@0 137 AC_OUTPUT
Chris@0 138
Chris@531 139 if test -x repoint ; then
Chris@523 140 if test -d .hg -o -d .git ; then
Chris@531 141 if ! ./repoint install; then
Chris@531 142 AC_MSG_ERROR([Repoint failed; please fix any reported errors and try again])
Chris@523 143 fi
Chris@523 144 else
Chris@531 145 AC_MSG_NOTICE([Repoint executable found but not in an Hg or Git working-copy: not running it])
Chris@523 146 if ! test -d vamp-plugin-sdk ; then
Chris@523 147 AC_MSG_WARN([No vamp-plugin-sdk directory present, so external libraries might not have been updated])
Chris@523 148 fi
Chris@523 149 fi
Chris@523 150 else
Chris@611 151 AC_MSG_NOTICE([No Repoint executable found: assuming external components are already here])
Chris@523 152 if ! test -d vamp-plugin-sdk ; then
Chris@611 153 AC_MSG_WARN([No vamp-plugin-sdk directory present, so external components might not have been updated])
Chris@523 154 fi
Chris@523 155 fi
Chris@523 156
Chris@108 157 if ! $QMAKE -r tony.pro; then
Chris@0 158 AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"])
Chris@0 159 fi
Chris@0 160
Chris@0 161 AC_MSG_NOTICE([
Chris@0 162
Chris@0 163 Configuration complete.
Chris@0 164 Please check the above messages for any warnings that you
Chris@0 165 might care about, and then run "make".
Chris@0 166
Chris@0 167 The file config.pri contains the configuration settings for
Chris@0 168 qmake. If you want to adjust these by hand, edit config.pri
Chris@50 169 and run "$QMAKE -r" again to regenerate the Makefile.
Chris@0 170 ])