To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / configure.ac

History | View | Annotate | Download (6.71 KB)

1 25:8ddcacd8b5c5 Chris
2 200:c20c22a8ecfa Chris
AC_INIT([Sonic Lineup], [], cannam@all-day-breakfast.com)
3 25:8ddcacd8b5c5 Chris
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 92:f8cf1e8c04fd Chris
# We are daringly making use of C++11 now
29
AX_CXX_COMPILE_STDCXX_11(noext)
30
31 25:8ddcacd8b5c5 Chris
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 110:125520c3dc05 Chris
SV_DEFINES_RELEASE="-DNDEBUG -DBUILD_RELEASE -DNO_TIMING -DNO_HIT_COUNTS"
44 25:8ddcacd8b5c5 Chris
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 110:125520c3dc05 Chris
OPTFLAGS_DEBUG="-O2"
52
LDFLAGS_DEBUG=""
53 25:8ddcacd8b5c5 Chris
CXXFLAGS_RELEASE="$AUTOCONF_CXXFLAGS"
54 110:125520c3dc05 Chris
OPTFLAGS_RELEASE="-O2"
55
LDFLAGS_RELEASE=""
56
CXXSTANDARD=c++14
57 25:8ddcacd8b5c5 Chris
58
if test "x$GCC" = "xyes"; then
59 110:125520c3dc05 Chris
   	CXXFLAGS_ANY="-fpic -Wall -Wextra -Woverloaded-virtual -Wformat-nonliteral -Wformat-security -Winit-self -Wswitch-enum -Wconversion -pipe"
60 98:ba4dd83fb22f Chris
        CXXFLAGS_DEBUG="$CXXFLAGS_ANY -g -Werror"
61 110:125520c3dc05 Chris
        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 25:8ddcacd8b5c5 Chris
fi
68
69 110:125520c3dc05 Chris
CXXFLAGS_BUILD="$CXXFLAGS_RELEASE $OPTFLAGS_RELEASE"
70
LDFLAGS_BUILD="$LDFLAGS_RELEASE $OPTFLAGS_RELEASE"
71 25:8ddcacd8b5c5 Chris
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 110:125520c3dc05 Chris
CXXFLAGS_BUILD="$CXXFLAGS_DEBUG $OPTFLAGS_DEBUG"
78
LDFLAGS_BUILD="$LDFLAGS_DEBUG"
79
SV_DEFINES_BUILD="$SV_DEFINES_DEBUG"
80
LIBS="$LIBS_DEBUG"])
81 25:8ddcacd8b5c5 Chris
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 110:125520c3dc05 Chris
        LDFLAGS_BUILD=""
87 25:8ddcacd8b5c5 Chris
fi
88
89
CXXFLAGS="$CXXFLAGS_BUILD $SV_DEFINES_BUILD"
90 110:125520c3dc05 Chris
LDFLAGS="$LDFLAGS_BUILD"
91 25:8ddcacd8b5c5 Chris
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 26:aa25c1f0cf32 Chris
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 103:519c6649cc68 Chris
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 25:8ddcacd8b5c5 Chris
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 121:1d93ae248358 Chris
123
SV_MODULE_REQUIRED([lrdf],[lrdf >= 0.2],[lrdf.h],[lrdf],[lrdf_init])
124
SV_MODULE_REQUIRED([oggz],[oggz >= 1.0.0],[oggz/oggz.h],[oggz],[oggz_run])
125
SV_MODULE_REQUIRED([fishsound],[fishsound >= 1.0.0],[fishsound/fishsound.h],[fishsound],[fish_sound_new])
126
SV_MODULE_REQUIRED([mad],[mad >= 0.15.0],[mad.h],[mad],[mad_decoder_init])
127
SV_MODULE_REQUIRED([id3tag],[id3tag >= 0.15.0],[id3tag.h],[id3tag],[id3_tag_new])
128
SV_MODULE_REQUIRED([opus],[opusfile],[opus/opusfile.h],[opusfile],[op_read_float])
129 25:8ddcacd8b5c5 Chris
130
# Link in -lX11 if it exists -- this is for the X error handler
131
SV_MODULE_OPTIONAL([X11],[x11 >= 1.0.0],[X11/X.h],[x11],[XGetErrorText])
132
133
AC_SUBST(PERL)
134
AC_SUBST(XARGS)
135
AC_SUBST(MAKEDEPEND)
136
AC_SUBST(SHA1SUM)
137
AC_SUBST(CUT)
138
139
AC_SUBST(CFLAGS)
140
AC_SUBST(CXXFLAGS)
141 110:125520c3dc05 Chris
AC_SUBST(CXXSTANDARD)
142 26:aa25c1f0cf32 Chris
AC_SUBST(LDFLAGS)
143 25:8ddcacd8b5c5 Chris
AC_SUBST(HAVES)
144
AC_SUBST(LIBS)
145
146
AC_SUBST(CC)
147
AC_SUBST(CXX)
148
149
AC_SUBST(QMAKE_CONFIG)
150
151 92:f8cf1e8c04fd Chris
AC_CONFIG_FILES([config.pri])
152 25:8ddcacd8b5c5 Chris
153
AC_OUTPUT
154
155 105:fa09c8e155ec Chris
if test -x repoint ; then
156 103:519c6649cc68 Chris
   if test -d .hg -o -d .git ; then
157 105:fa09c8e155ec Chris
      if ! ./repoint install; then
158
         AC_MSG_ERROR([Repoint failed; please fix any reported errors and try again])
159 103:519c6649cc68 Chris
      fi
160
   else
161 105:fa09c8e155ec Chris
      AC_MSG_NOTICE([Repoint executable found but not in an Hg or Git working-copy: not running it])
162 103:519c6649cc68 Chris
      if ! test -d vamp-plugin-sdk ; then
163
          AC_MSG_WARN([No vamp-plugin-sdk directory present, so external libraries might not have been updated])
164
      fi
165
   fi
166
else
167 332:ec48dd2cde26 Chris
   AC_MSG_NOTICE([No Repoint executable found: assuming external components are already here])
168 103:519c6649cc68 Chris
   if ! test -d vamp-plugin-sdk ; then
169 332:ec48dd2cde26 Chris
      AC_MSG_WARN([No vamp-plugin-sdk directory present, so external components might not have been updated])
170 103:519c6649cc68 Chris
   fi
171
fi
172
173 254:4be73560c2ff Chris
if ! $QMAKE -r sonic-lineup.pro; then
174 25:8ddcacd8b5c5 Chris
   AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"])
175
fi
176
177
AC_MSG_NOTICE([
178
179
Configuration complete.
180
Please check the above messages for any warnings that you
181
might care about, and then run "make".
182
183
The file config.pri contains the configuration settings for
184
qmake.  If you want to adjust these by hand, edit config.pri
185 26:aa25c1f0cf32 Chris
and run "$QMAKE -r" again to regenerate the Makefile.
186 25:8ddcacd8b5c5 Chris
])