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