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})
19 dnl Enable silent rules, use with make V=0
28 dnl Check for programs
30 AM_PROG_CC_C_O dnl compiling with per-target flag
31 if test "$ac_cv_prog_cc" = "no" ; then
32 AC_MSG_ERROR([*** No C compiler found !])
39 dnl Enable debugging (no)
41 AC_HELP_STRING([--enable-debug],[compile in debug mode [[default=no]]]),
44 if test "$with_debug" = "yes"
46 AC_DEFINE(DEBUG,1,[Define to enable debug])
47 AUBIO_CFLAGS="$AUBIO_CFLAGS -g"
50 dnl Enable full warnings (yes)
51 AC_ARG_ENABLE(warnings,
52 AC_HELP_STRING([--enable-warnings],[compile with all gcc warnings [[default=yes]]]),
55 if test "$with_warnme" = "yes"
57 dnl Check for -Wextra support to allow compilation on gcc <= 3.4
58 AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra,
60 CFLAGS="$CFLAGS -Wextra"
61 AC_COMPILE_IFELSE([void foo (void) {}],
62 ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
65 if test "$ac_cv_cc_wextra" = "yes"
67 AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall -Wextra"
69 AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall"
73 dnl fail on compilation warnings
74 AC_ARG_ENABLE(errorfail,
75 AC_HELP_STRING([--enable-errorfail],[fail on compilation warnings [[default=no]]]),
76 AUBIO_CFLAGS="$AUBIO_CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter",
79 dnl add gcov/lcov profiling and coverage flags
81 AC_HELP_STRING([--enable-lcov],[compile with gcov/lcov profiling flags [[default=no]]]),
82 AUBIO_CFLAGS="$AUBIO_CFLAGS -fprofile-arcs -ftest-coverage",
88 dnl allow cross compiling
92 AC_CONFIG_HEADERS(src/config.h)
93 AC_CONFIG_FILES(aubio.pc)
95 AM_CONDITIONAL(MINGW, false)
96 AM_CONDITIONAL(DARWIN, false)
100 AC_CHECK_HEADER(windows.h)
101 AM_CONDITIONAL(MINGW, true)
102 LDFLAGS="$LDFLAGS -no-undefined"
104 *darwin* | *rhapsody* | *macosx*)
106 AM_CONDITIONAL(DARWIN, true)
113 dnl Check for required libraries
114 AC_CHECK_LIB(pthread, pthread_create)
116 dnl Check for header files
117 AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h errno.h stdarg.h unistd.h signal.h],,)
118 AC_CHECK_HEADERS(fftw3.h,,AC_MSG_ERROR([Ouch! missing fftw3.h header]))
119 AC_ARG_ENABLE(complex,
120 AC_HELP_STRING([--enable-complex],[compile with complex.h [[default=auto]]]),
121 [with_complex=$enableval],
123 if test "$with_complex" = "yes"; then
124 AC_CHECK_HEADERS(complex.h,,AC_MSG_WARN([Ouch! missing complex.h header]))
127 dnl Check for __VAR_ARGS__ support
128 AC_CACHE_CHECK(for C99 __VA_ARGS__ macro,
129 ac_cv_varargs_macros,
132 #define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__)
135 AUBIO_ERR("%s\n", "ERR");
137 ac_cv_varargs_macros=yes,
138 ac_cv_varargs_macros=no)
140 if test "$ac_cv_varargs_macros" = "yes"; then
141 AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
142 [Defined when c99 style varargs macros are supported])
145 dnl Check for pkg-config
146 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
148 PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.4, HAVE_SNDFILE=1)
149 if test "${HAVE_SNDFILE}" = "1"; then
150 AC_DEFINE(HAVE_SNDFILE,1,[Define to enable libsndfile support])
153 dnl Enable samplerate support (auto)
154 AC_ARG_ENABLE(samplerate,
155 AC_HELP_STRING([--enable-samplerate],[compile with samplerate [[default=auto]]]),
156 [with_samplerate=$enableval],
157 with_samplerate="yes")
158 if test "$with_samplerate" = "yes"; then
159 PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15, HAVE_SAMPLERATE=1)
160 if test "${HAVE_SAMPLERATE}" = "1"; then
161 AC_DEFINE(HAVE_SAMPLERATE,1,[Define to enable libsamplerate support])
165 dnl Check for fftw3 (required)
166 AC_ARG_ENABLE(fftw3f,
167 AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
168 [with_fftw3f=$enableval],
170 if test "$with_fftw3f" = "yes"; then
171 PKG_CHECK_MODULES(FFTWLIB, fftw3f >= 3.0.0, HAVE_FFTW3F=1, HAVE_FFTW3F=0)
173 PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, HAVE_FFTW3=1)
175 if test "${HAVE_FFTW3F}" = "0"; then
176 PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, HAVE_FFTW3=1)
178 if test "${HAVE_FFTW3}" = "1"; then
179 AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support])
181 if test "${HAVE_FFTW3F}" = "1"; then
182 AC_DEFINE(HAVE_FFTW3F,1,[Define to enable fftw3f support])
185 dnl Enable jack support (auto)
187 AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]),
188 [with_jack=$enableval],
190 if test "$with_jack" = "yes"
192 PKG_CHECK_MODULES(JACK, jack >= 0.15.0, HAVE_JACK=1, HAVE_JACK=0)
193 if test "${HAVE_JACK}" = "1"; then
194 AC_DEFINE(HAVE_JACK,1,[Define to enable jack support])
198 dnl Enable lash support
200 AC_HELP_STRING([--enable-lash],[compile with lash [[default=auto]]]),
201 [with_lash=$enableval],
203 if test "$with_lash" = "yes"
205 PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.5.0, HAVE_LASH=1, HAVE_LASH=0)
206 if test "${HAVE_LASH}" = "1"; then
207 LASH_CFLAGS+="-DHAVE_LASH"
211 dnl Enable unit tests
212 AC_ARG_ENABLE(testprogs,
213 AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=no]]]),
214 [with_testprogs=$enableval],
216 AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
218 AC_SUBST(AUBIO_CFLAGS)
220 dnl Check for swig and python
221 dnl should check for swig version and python headers
222 AC_PATH_PROG(SWIG,swig,no)
223 AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no")
225 AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no")
227 dnl Check for docbook-to-man
228 AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
229 AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
231 dnl Check for Puredata
232 AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
233 AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
236 AC_CHECK_HEADER(jni.h,JAVAHEADERS=y,AC_MSG_WARN([Java header jni.h not found.]))
237 AM_CONDITIONAL(JAVAFOUND, test "${JAVAHEADERS}" = "y")
251 python/aubio/Makefile
252 interfaces/java/Makefile
253 interfaces/java/aubio/Makefile
254 interfaces/cpp/Makefile
256 plugins/audacity/Makefile
257 plugins/audacity/plug-ins/Makefile
258 plugins/wavesurfer/Makefile
259 plugins/puredata/Makefile
265 echo "**************************************************************"
267 if test "${HAVE_FFTW3F}" = "1"; then
268 echo "Fftw3: yes (using fftw3f)"
270 if test "${HAVE_FFTW3}" = "1"; then
271 echo "Fftw3: yes (not using fftw3f)"
273 echo "Fftw3: no (that should not happen)"
276 if test "${HAVE_SNDFILE}" = "1"; then
277 echo "Libsndfile: yes"
279 echo "Libsndfile: no"
281 if test "${HAVE_SAMPLERATE}" = "1"; then
282 echo "Libsamplerate: yes"
284 echo "Libsamplerate: no"
286 if test "${HAVE_JACK}" = "1"; then
291 if test "${HAVE_LASH}" = "1"; then
296 if test "${PUREDATA}" = "y"; then
301 echo "**************************************************************"
302 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}