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
14 LIBAUBIO_LT_REVISION=0
16 SHARED_VERSION_INFO="$LIBAUBIO_LT_CURRENT:$LIBAUBIO_LT_REVISION:$LIBAUBIO_LT_AGE"
17 AC_SUBST(SHARED_VERSION_INFO)
20 AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
28 dnl Default optimization
31 dnl Enable debugging (no)
33 [ --enable-debug[[=value]] compile with debug [[default=no]]],
36 if test "$with_debug" = "yes"
38 AC_DEFINE(DEBUG,1,[Define to enable debug])
42 dnl Enable full warnings (yes)
44 [ --enable-warnme[[=value]] compile with all -W [[default=yes]]],
47 if test "$with_warnme" = "yes"
49 CFLAGS="$CFLAGS -Wall -Wextra -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter"
52 dnl Check for programs
54 if test "$ac_cv_prog_cc" = "no" ; then
55 AC_MSG_ERROR([*** No C compiler found !])
64 AC_CONFIG_HEADERS(src/config.h)
65 AC_CONFIG_FILES(aubio.pc)
70 AC_CHECK_HEADER(windows.h)
73 dnl on macosx, cosf went to -lmx
74 LDFLAGS="$LDFLAGS -lmx"
75 dnl as long double doesn't sit well with -Wall -Werror
76 CFLAGS="$CFLAGS -Wno-long-double"
84 dnl Check for required libraries
85 AC_CHECK_LIB(pthread, pthread_create)
87 dnl Check for header files
89 AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h errno.h stdarg.h unistd.h signal.h],,)
90 AC_CHECK_HEADERS(complex.h,,AC_MSG_ERROR([Ouch! missing complex.h header]))
91 AC_CHECK_HEADERS(fftw3.h ,,AC_MSG_ERROR([Ouch! missing fftw3.h header]))
93 dnl Check for __VAR_ARGS__ support
94 AC_CACHE_CHECK(for C99 __VA_ARGS__ macro,
98 #define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__)
101 AUBIO_ERR("%s\n", "ERR");
103 ac_cv_varargs_macros=yes,
104 ac_cv_varargs_macros=no)
106 if test "$ac_cv_varargs_macros" = "yes"; then
107 AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
108 [Defined when c99 style varargs macros are supported])
111 dnl Check for pkg-config
112 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
114 PKG_CHECK_MODULES(SNDLIB, sndfile >= 1.0.4, SNDLIB_SUPPORT=1)
115 PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15, SAMPLERATE_SUPPORT=1)
117 if test "${SNDLIB_SUPPORT}" = "1"; then
118 AC_DEFINE(SNDLIB_SUPPORT,1,[Define to enable libsndfile support])
121 dnl Check for fftw3 (required)
122 AC_ARG_ENABLE(fftw3f,
123 AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
124 [with_fftw3f=$enableval],
126 if test "$with_fftw3f" = "yes"; then
127 PKG_CHECK_MODULES(FFTWLIB, fftw3f >= 3.0.0, FFTW3F_SUPPORT=1, FFTW3F_SUPPORT=0)
129 PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, FFTW3_SUPPORT=1)
131 if test "${FFTW3F_SUPPORT}" = "0"; then
132 PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, FFTW3_SUPPORT=1)
134 if test "${FFTW3_SUPPORT}" = "1"; then
135 AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support])
137 if test "${FFTW3F_SUPPORT}" = "1"; then
138 AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support])
141 dnl Enable jack support (auto)
143 AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]),
144 [with_jack=$enableval],
146 if test "$with_jack" = "yes"
148 PKG_CHECK_MODULES(JACK, jack >= 0.15.0, JACK_SUPPORT=1, JACK_SUPPORT=0)
149 if test "${JACK_SUPPORT}" = "1"; then
150 AC_DEFINE(JACK_SUPPORT,1,[Define to enable jack support])
154 dnl Enable alsa support (auto)
156 AC_HELP_STRING([--enable-alsa],[compile with alsa [[default=auto]]]),
157 [with_alsa=$enableval],
159 if test "$with_alsa" = "yes"
161 if test "$with_jack" = "yes"
163 PKG_CHECK_MODULES(ALSA, alsa >= 0.0.9, ALSA_SUPPORT=1, ALSA_SUPPORT=0)
164 if test "${ALSA_SUPPORT}" = "1"; then
165 AC_DEFINE(ALSA_SUPPORT,1,[Define to enable alsa support])
168 AC_MSG_WARN([Disabling alsa as jack was not found])
172 dnl Enable ladcca support (obsolete)
173 AC_ARG_ENABLE(ladcca,
174 AC_HELP_STRING([--enable-ladcca],[compile with ladcca [[default=no]]]),
175 [with_ladcca=$enableval],
177 if test "$with_ladcca" = "yes"
179 PKG_CHECK_MODULES(LADCCA, ladcca-1.0 >= 0.4.0, LADCCA_SUPPORT=1)
180 if test "${LADCCA_SUPPORT}" = "1"; then
181 AC_DEFINE(LADCCA_SUPPORT,1,[Define to enable ladcca support])
185 dnl Enable unit tests
186 AC_ARG_ENABLE(testprogs,
187 AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=no]]]),
188 [with_testprogs=$enableval],
190 AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
192 dnl Check for swig and python
193 dnl should check for swig version and python headers
194 AC_PATH_PROG(SWIG,swig,no)
195 AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no")
197 AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no")
202 SWCFLAGS="-Wno-long-double"
203 SWLDFLAGS="-bundle -framework python -L${prefix}/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
213 dnl Check for docbook-to-man
214 AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
215 AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
217 dnl Check for Puredata
218 AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
219 AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
227 examples/tests/Makefile
231 python/aubio/Makefile
233 plugins/audacity/Makefile
234 plugins/audacity/plug-ins/Makefile
235 plugins/wavesurfer/Makefile
236 plugins/puredata/Makefile
242 echo "**************************************************************"
244 if test "${FFTW3F_SUPPORT}" = "1"; then
245 echo "Fftw3: yes (using fftw3f)"
247 if test "${FFTW3_SUPPORT}" = "1"; then
248 echo "Fftw3: yes (not using fftw3f)"
250 echo "Fftw3: no (that should not happen)"
253 if test "${SNDLIB_SUPPORT}" = "1"; then
254 echo "Libsndfile: yes"
256 echo "Libsndfile: no"
258 if test "${SAMPLERATE_SUPPORT}" = "1"; then
259 echo "Libsamplerate: yes"
261 echo "Libsamplerate: no"
263 if test "${JACK_SUPPORT}" = "1"; then
268 if test "${ALSA_SUPPORT}" = "1"; then
269 echo "ALSA midi: yes"
273 if test "${LADCCA_SUPPORT}" = "1"; then
276 echo "**************************************************************"
277 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}