1 dnl Process this file with autoconf to produce a configure script
6 dnl Package name and version
9 AUBIO_VERSION=${AUBIO_MAJOR_VERSION}.${AUBIO_MINOR_VERSION}.${AUBIO_PATCH_VERSION}${AUBIO_VERSION_STATUS}
10 VERSION=${AUBIO_VERSION}
12 dnl Shared library version
13 SHARED_VERSION_INFO=${LIBAUBIO_LT_CUR}:${LIBAUBIO_LT_REV}:${LIBAUBIO_LT_AGE}
14 AC_SUBST(SHARED_VERSION_INFO)
17 AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
25 dnl Check for programs
27 if test "$ac_cv_prog_cc" = "no" ; then
28 AC_MSG_ERROR([*** No C compiler found !])
32 dnl Enable debugging (no)
34 [ --enable-debug[[=value]] compile with debug [[default=no]]],
37 if test "$with_debug" = "yes"
39 AC_DEFINE(DEBUG,1,[Define to enable debug])
43 dnl Enable full warnings (yes)
45 [ --enable-warnme[[=value]] compile with all -W [[default=yes]]],
48 if test "$with_warnme" = "yes"
50 dnl Check for -Wextra support to allow compilation on gcc <= 3.4
51 AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra,
53 CFLAGS="$CFLAGS -Wextra"
54 AC_COMPILE_IFELSE([void foo (void) {}],
55 ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
57 if test "$ac_cv_cc_wextra" = "yes"
59 CFLAGS="$old_CFLAGS -Wall -Wextra"
61 CFLAGS="$old_CFLAGS -Wall"
65 AC_ARG_ENABLE(failonerror,
66 [ --enable-fwarn[[=value]] fail on compilation warnings [[default=yes]]],
68 CFLAGS="$CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter")
75 AC_CONFIG_HEADERS(src/config.h)
76 AC_CONFIG_FILES(aubio.pc)
81 AC_CHECK_HEADER(windows.h)
84 dnl on macosx, cosf went to -lmx
85 LDFLAGS="$LDFLAGS -lmx"
86 dnl as long double doesn't sit well with -Wall -Werror
87 CFLAGS="$CFLAGS -Wno-long-double"
95 dnl Check for required libraries
96 AC_CHECK_LIB(pthread, pthread_create)
98 dnl Check for header files
100 AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h errno.h stdarg.h unistd.h signal.h],,)
101 AC_CHECK_HEADERS(complex.h,,AC_MSG_ERROR([Ouch! missing complex.h header]))
102 AC_CHECK_HEADERS(fftw3.h ,,AC_MSG_ERROR([Ouch! missing fftw3.h header]))
104 dnl Check for __VAR_ARGS__ support
105 AC_CACHE_CHECK(for C99 __VA_ARGS__ macro,
106 ac_cv_varargs_macros,
109 #define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__)
112 AUBIO_ERR("%s\n", "ERR");
114 ac_cv_varargs_macros=yes,
115 ac_cv_varargs_macros=no)
117 if test "$ac_cv_varargs_macros" = "yes"; then
118 AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
119 [Defined when c99 style varargs macros are supported])
122 dnl Check for pkg-config
123 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
125 PKG_CHECK_MODULES(SNDLIB, sndfile >= 1.0.4, SNDLIB_SUPPORT=1)
126 PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15, SAMPLERATE_SUPPORT=1)
128 if test "${SNDLIB_SUPPORT}" = "1"; then
129 AC_DEFINE(SNDLIB_SUPPORT,1,[Define to enable libsndfile support])
132 dnl Check for fftw3 (required)
133 AC_ARG_ENABLE(fftw3f,
134 AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
135 [with_fftw3f=$enableval],
137 if test "$with_fftw3f" = "yes"; then
138 PKG_CHECK_MODULES(FFTWLIB, fftw3f >= 3.0.0, FFTW3F_SUPPORT=1, FFTW3F_SUPPORT=0)
140 PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, FFTW3_SUPPORT=1)
142 if test "${FFTW3F_SUPPORT}" = "0"; then
143 PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, FFTW3_SUPPORT=1)
145 if test "${FFTW3_SUPPORT}" = "1"; then
146 AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support])
148 if test "${FFTW3F_SUPPORT}" = "1"; then
149 AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support])
152 dnl Enable jack support (auto)
154 AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]),
155 [with_jack=$enableval],
157 if test "$with_jack" = "yes"
159 PKG_CHECK_MODULES(JACK, jack >= 0.15.0, JACK_SUPPORT=1, JACK_SUPPORT=0)
160 if test "${JACK_SUPPORT}" = "1"; then
161 AC_DEFINE(JACK_SUPPORT,1,[Define to enable jack support])
165 dnl Enable alsa support (auto)
167 AC_HELP_STRING([--enable-alsa],[compile with alsa [[default=auto]]]),
168 [with_alsa=$enableval],
170 if test "$with_alsa" = "yes"
172 if test "$with_jack" = "yes"
174 PKG_CHECK_MODULES(ALSA, alsa >= 0.0.9, ALSA_SUPPORT=1, ALSA_SUPPORT=0)
175 if test "${ALSA_SUPPORT}" = "1"; then
176 AC_DEFINE(ALSA_SUPPORT,1,[Define to enable alsa support])
179 AC_MSG_WARN([Disabling alsa as jack was not found])
183 dnl Enable lash support
185 AC_HELP_STRING([--enable-lash],[compile with lash [[default=auto]]]),
186 [with_lash=$enableval],
188 if test "$with_lash" = "yes"
190 PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.5.0, LASH_SUPPORT=1, LASH_SUPPORT=0)
191 if test "${LASH_SUPPORT}" = "1"; then
192 LASH_CFLAGS+="-DLASH_SUPPORT"
196 dnl Enable unit tests
197 AC_ARG_ENABLE(testprogs,
198 AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=no]]]),
199 [with_testprogs=$enableval],
201 AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
203 dnl Check for swig and python
204 dnl should check for swig version and python headers
205 AC_PATH_PROG(SWIG,swig,no)
206 AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no")
208 AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no")
213 SWCFLAGS="-Wno-long-double"
214 SWLDFLAGS="-bundle -framework python -L${prefix}/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
224 dnl Check for docbook-to-man
225 AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
226 AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
228 dnl Check for Puredata
229 AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
230 AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
238 examples/tests/Makefile
242 python/aubio/Makefile
244 plugins/audacity/Makefile
245 plugins/audacity/plug-ins/Makefile
246 plugins/wavesurfer/Makefile
247 plugins/puredata/Makefile
253 echo "**************************************************************"
255 if test "${FFTW3F_SUPPORT}" = "1"; then
256 echo "Fftw3: yes (using fftw3f)"
258 if test "${FFTW3_SUPPORT}" = "1"; then
259 echo "Fftw3: yes (not using fftw3f)"
261 echo "Fftw3: no (that should not happen)"
264 if test "${SNDLIB_SUPPORT}" = "1"; then
265 echo "Libsndfile: yes"
267 echo "Libsndfile: no"
269 if test "${SAMPLERATE_SUPPORT}" = "1"; then
270 echo "Libsamplerate: yes"
272 echo "Libsamplerate: no"
274 if test "${JACK_SUPPORT}" = "1"; then
279 if test "${ALSA_SUPPORT}" = "1"; then
280 echo "ALSA midi: yes"
284 if test "${LASH_SUPPORT}" = "1"; then
289 if test "${PUREDATA}" = "y"; then
294 echo "**************************************************************"
295 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}