[5215c01] | 1 | dnl Process this file with autoconf to produce a configure script |
---|
[96fb8ad] | 2 | |
---|
[16109b3] | 3 | dnl Init autoconf |
---|
[96fb8ad] | 4 | AC_INIT(src/aubio.h) |
---|
| 5 | |
---|
[4db0752] | 6 | AC_CONFIG_MACRO_DIR([m4]) |
---|
| 7 | |
---|
[16109b3] | 8 | dnl Package name and version |
---|
| 9 | PACKAGE=aubio |
---|
[96fb8ad] | 10 | . $srcdir/VERSION |
---|
| 11 | AUBIO_VERSION=${AUBIO_MAJOR_VERSION}.${AUBIO_MINOR_VERSION}.${AUBIO_PATCH_VERSION}${AUBIO_VERSION_STATUS} |
---|
| 12 | VERSION=${AUBIO_VERSION} |
---|
| 13 | |
---|
[16109b3] | 14 | dnl Shared library version |
---|
[5274ee6] | 15 | SHARED_VERSION_INFO=${LIBAUBIO_LT_CUR}:${LIBAUBIO_LT_REV}:${LIBAUBIO_LT_AGE} |
---|
[9fc2c7e] | 16 | AC_SUBST(SHARED_VERSION_INFO) |
---|
| 17 | |
---|
[16109b3] | 18 | dnl Init automake |
---|
[96fb8ad] | 19 | AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION}) |
---|
[16109b3] | 20 | |
---|
[e24b5f3] | 21 | dnl Enable silent rules, use with make V=0 |
---|
[18738ad] | 22 | dnl AM_SILENT_RULES |
---|
[e24b5f3] | 23 | |
---|
[16109b3] | 24 | dnl Maintainer mode |
---|
[5215c01] | 25 | AM_MAINTAINER_MODE |
---|
[96fb8ad] | 26 | |
---|
[16109b3] | 27 | dnl Guess the host |
---|
| 28 | AC_CANONICAL_HOST |
---|
[96fb8ad] | 29 | |
---|
[ee0a1f3] | 30 | dnl Check for programs |
---|
| 31 | AC_PROG_CC |
---|
[00c522b] | 32 | AM_PROG_CC_C_O dnl compiling with per-target flag |
---|
[ee0a1f3] | 33 | if test "$ac_cv_prog_cc" = "no" ; then |
---|
| 34 | AC_MSG_ERROR([*** No C compiler found !]) |
---|
| 35 | fi |
---|
| 36 | AC_PROG_INSTALL |
---|
| 37 | |
---|
[17db1cd] | 38 | AUBIO_CFLAGS= |
---|
| 39 | |
---|
[5ddcdf2] | 40 | AC_CHECK_LIB(m, floorf) |
---|
| 41 | AUBIO_LIBS="-lm" |
---|
| 42 | |
---|
[66760af] | 43 | dnl Enable double precision (no) |
---|
| 44 | AC_ARG_ENABLE(double, |
---|
| 45 | AC_HELP_STRING([--enable-double],[compile in double precision [[default=no]]]), |
---|
| 46 | with_double_precision="yes", |
---|
| 47 | with_double_precision="no") |
---|
| 48 | if test "$with_double_precision" = "yes" |
---|
| 49 | then |
---|
| 50 | AC_DEFINE(HAVE_AUBIO_DOUBLE,1,[Define to enable double precision]) |
---|
| 51 | fi |
---|
| 52 | |
---|
[16109b3] | 53 | dnl Enable debugging (no) |
---|
[96fb8ad] | 54 | AC_ARG_ENABLE(debug, |
---|
[ec0d43c] | 55 | AC_HELP_STRING([--enable-debug],[compile in debug mode [[default=no]]]), |
---|
[96fb8ad] | 56 | with_debug="yes", |
---|
| 57 | with_debug="no") |
---|
| 58 | if test "$with_debug" = "yes" |
---|
| 59 | then |
---|
| 60 | AC_DEFINE(DEBUG,1,[Define to enable debug]) |
---|
[098bd92] | 61 | AUBIO_CFLAGS="$AUBIO_CFLAGS -g" |
---|
[96fb8ad] | 62 | fi |
---|
| 63 | |
---|
[16109b3] | 64 | dnl Enable full warnings (yes) |
---|
[f43867f] | 65 | AC_ARG_ENABLE(warnings, |
---|
[ec0d43c] | 66 | AC_HELP_STRING([--enable-warnings],[compile with all gcc warnings [[default=yes]]]), |
---|
[96fb8ad] | 67 | with_warnme="no", |
---|
| 68 | with_warnme="yes") |
---|
| 69 | if test "$with_warnme" = "yes" |
---|
| 70 | then |
---|
[ee0a1f3] | 71 | dnl Check for -Wextra support to allow compilation on gcc <= 3.4 |
---|
| 72 | AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, |
---|
| 73 | [old_CFLAGS="$CFLAGS" |
---|
| 74 | CFLAGS="$CFLAGS -Wextra" |
---|
| 75 | AC_COMPILE_IFELSE([void foo (void) {}], |
---|
| 76 | ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no) |
---|
[17db1cd] | 77 | CFLAGS="$old_CFLAGS" |
---|
[ee0a1f3] | 78 | ]) |
---|
| 79 | if test "$ac_cv_cc_wextra" = "yes" |
---|
| 80 | then |
---|
[17db1cd] | 81 | AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall -Wextra" |
---|
[ee0a1f3] | 82 | else |
---|
[17db1cd] | 83 | AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall" |
---|
[ee0a1f3] | 84 | fi |
---|
[96fb8ad] | 85 | fi |
---|
| 86 | |
---|
[ec0d43c] | 87 | dnl fail on compilation warnings |
---|
[f43867f] | 88 | AC_ARG_ENABLE(errorfail, |
---|
[ec0d43c] | 89 | AC_HELP_STRING([--enable-errorfail],[fail on compilation warnings [[default=no]]]), |
---|
[f43867f] | 90 | AUBIO_CFLAGS="$AUBIO_CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter", |
---|
[ec0d43c] | 91 | with_errorfail="no") |
---|
| 92 | |
---|
| 93 | dnl add gcov/lcov profiling and coverage flags |
---|
| 94 | AC_ARG_ENABLE(lcov, |
---|
| 95 | AC_HELP_STRING([--enable-lcov],[compile with gcov/lcov profiling flags [[default=no]]]), |
---|
| 96 | AUBIO_CFLAGS="$AUBIO_CFLAGS -fprofile-arcs -ftest-coverage", |
---|
| 97 | with_lcov="no") |
---|
[96fb8ad] | 98 | |
---|
| 99 | dnl Check for libtool |
---|
| 100 | AC_LIBTOOL_DLOPEN |
---|
| 101 | dnl AC_DISABLE_STATIC |
---|
[fce58d9e] | 102 | dnl allow cross compiling |
---|
| 103 | AC_LIBTOOL_WIN32_DLL |
---|
[96fb8ad] | 104 | AC_PROG_LIBTOOL |
---|
| 105 | |
---|
| 106 | AC_CONFIG_HEADERS(src/config.h) |
---|
| 107 | AC_CONFIG_FILES(aubio.pc) |
---|
| 108 | |
---|
[be929a5] | 109 | AM_CONDITIONAL(MINGW, false) |
---|
| 110 | AM_CONDITIONAL(DARWIN, false) |
---|
[651cac8] | 111 | case "${host}" in |
---|
[cbea730] | 112 | *mingw* | *cygwin*) |
---|
[96fb8ad] | 113 | mingw32_support="yes" |
---|
| 114 | AC_CHECK_HEADER(windows.h) |
---|
[be929a5] | 115 | AM_CONDITIONAL(MINGW, true) |
---|
[cbea730] | 116 | LDFLAGS="$LDFLAGS -no-undefined" |
---|
[96fb8ad] | 117 | ;; |
---|
[cbea730] | 118 | *darwin* | *rhapsody* | *macosx*) |
---|
[d17f63e] | 119 | AC_ISC_POSIX |
---|
[be929a5] | 120 | AM_CONDITIONAL(DARWIN, true) |
---|
[d17f63e] | 121 | ;; |
---|
[96fb8ad] | 122 | *) |
---|
| 123 | AC_ISC_POSIX |
---|
| 124 | ;; |
---|
| 125 | esac |
---|
| 126 | |
---|
[3050cb8] | 127 | dnl Check for required libraries |
---|
[96fb8ad] | 128 | AC_CHECK_LIB(pthread, pthread_create) |
---|
| 129 | |
---|
| 130 | dnl Check for header files |
---|
[10a5413] | 131 | AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h limits.h errno.h stdarg.h unistd.h signal.h],,) |
---|
[237f632] | 132 | AC_ARG_ENABLE(complex, |
---|
| 133 | AC_HELP_STRING([--enable-complex],[compile with complex.h [[default=auto]]]), |
---|
| 134 | [with_complex=$enableval], |
---|
[62b8ab2] | 135 | with_complex="no") |
---|
[237f632] | 136 | if test "$with_complex" = "yes"; then |
---|
| 137 | AC_CHECK_HEADERS(complex.h,,AC_MSG_WARN([Ouch! missing complex.h header])) |
---|
| 138 | fi |
---|
[96fb8ad] | 139 | |
---|
[16109b3] | 140 | dnl Check for __VAR_ARGS__ support |
---|
[5215c01] | 141 | AC_CACHE_CHECK(for C99 __VA_ARGS__ macro, |
---|
| 142 | ac_cv_varargs_macros, |
---|
| 143 | AC_TRY_COMPILE([ |
---|
| 144 | #include <stdio.h> |
---|
| 145 | #define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__) |
---|
| 146 | ], |
---|
| 147 | [ |
---|
| 148 | AUBIO_ERR("%s\n", "ERR"); |
---|
| 149 | ], |
---|
| 150 | ac_cv_varargs_macros=yes, |
---|
| 151 | ac_cv_varargs_macros=no) |
---|
| 152 | ) |
---|
| 153 | if test "$ac_cv_varargs_macros" = "yes"; then |
---|
| 154 | AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1, |
---|
| 155 | [Defined when c99 style varargs macros are supported]) |
---|
| 156 | fi |
---|
| 157 | |
---|
[9906b3f] | 158 | AC_ARG_ENABLE(sndfile, |
---|
| 159 | AC_HELP_STRING([--enable-sndfile],[compile with sndfile [[default=auto]]]), |
---|
| 160 | [with_sndfile=$enableval], |
---|
| 161 | with_sndfile="yes") |
---|
| 162 | if test "$with_sndfile" = "yes"; then |
---|
| 163 | PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.4, HAVE_SNDFILE=1, HAVE_SNDFILE=0) |
---|
| 164 | if test "${HAVE_SNDFILE}" = "1"; then |
---|
| 165 | AC_DEFINE(HAVE_SNDFILE,1,[Define to enable libsndfile support]) |
---|
| 166 | fi |
---|
[588ee77] | 167 | fi |
---|
[96fb8ad] | 168 | |
---|
[588ee77] | 169 | dnl Enable samplerate support (auto) |
---|
| 170 | AC_ARG_ENABLE(samplerate, |
---|
| 171 | AC_HELP_STRING([--enable-samplerate],[compile with samplerate [[default=auto]]]), |
---|
| 172 | [with_samplerate=$enableval], |
---|
| 173 | with_samplerate="yes") |
---|
| 174 | if test "$with_samplerate" = "yes"; then |
---|
[740f06b] | 175 | PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15, HAVE_SAMPLERATE=1, |
---|
| 176 | HAVE_SAMPLERATE=0) |
---|
[588ee77] | 177 | if test "${HAVE_SAMPLERATE}" = "1"; then |
---|
| 178 | AC_DEFINE(HAVE_SAMPLERATE,1,[Define to enable libsamplerate support]) |
---|
| 179 | fi |
---|
[96fb8ad] | 180 | fi |
---|
| 181 | |
---|
[16109b3] | 182 | dnl Check for fftw3 (required) |
---|
[240e416] | 183 | dnl if we compile in double precsion, default to fftw3, else fftw3f |
---|
[729a3c0] | 184 | |
---|
| 185 | AC_ARG_ENABLE(fftw3, |
---|
| 186 | AC_HELP_STRING([--enable-fftw3],[compile with fftw3 [[default=auto]]]), |
---|
| 187 | [with_fftw3=$enableval], |
---|
| 188 | with_fftw3="yes") |
---|
| 189 | |
---|
[240e416] | 190 | if test "$with_double_precision" = "yes"; then |
---|
| 191 | default_fftw3f="no" |
---|
| 192 | else |
---|
[729a3c0] | 193 | default_fftw3f=$with_fftw3 |
---|
[240e416] | 194 | fi |
---|
[729a3c0] | 195 | |
---|
[96fb8ad] | 196 | AC_ARG_ENABLE(fftw3f, |
---|
[dc27a81] | 197 | AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]), |
---|
| 198 | [with_fftw3f=$enableval], |
---|
[240e416] | 199 | [with_fftw3f=$default_fftw3f]) |
---|
[729a3c0] | 200 | |
---|
| 201 | # check if we have fftw3f |
---|
[96fb8ad] | 202 | if test "$with_fftw3f" = "yes"; then |
---|
[b511fa9] | 203 | PKG_CHECK_MODULES(FFTWLIB, fftw3f >= 3.0.0, HAVE_FFTW3F=1, HAVE_FFTW3F=0) |
---|
[e50b695] | 204 | else |
---|
[729a3c0] | 205 | # check if we have fftw3 |
---|
| 206 | if test "$with_fftw3" = "yes"; then |
---|
| 207 | PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, HAVE_FFTW3=1, HAVE_FFTW3=0) |
---|
[dc27a81] | 208 | fi |
---|
[e50b695] | 209 | fi |
---|
[729a3c0] | 210 | |
---|
[b511fa9] | 211 | if test "${HAVE_FFTW3}" = "1"; then |
---|
| 212 | AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support]) |
---|
[96fb8ad] | 213 | fi |
---|
[b511fa9] | 214 | if test "${HAVE_FFTW3F}" = "1"; then |
---|
[729a3c0] | 215 | AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support]) |
---|
[b511fa9] | 216 | AC_DEFINE(HAVE_FFTW3F,1,[Define to enable fftw3f support]) |
---|
[96fb8ad] | 217 | fi |
---|
| 218 | |
---|
[16109b3] | 219 | dnl Enable jack support (auto) |
---|
[96fb8ad] | 220 | AC_ARG_ENABLE(jack, |
---|
[dc27a81] | 221 | AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]), |
---|
| 222 | [with_jack=$enableval], |
---|
| 223 | with_jack="yes") |
---|
[96fb8ad] | 224 | if test "$with_jack" = "yes" |
---|
| 225 | then |
---|
[b511fa9] | 226 | PKG_CHECK_MODULES(JACK, jack >= 0.15.0, HAVE_JACK=1, HAVE_JACK=0) |
---|
| 227 | if test "${HAVE_JACK}" = "1"; then |
---|
| 228 | AC_DEFINE(HAVE_JACK,1,[Define to enable jack support]) |
---|
[16109b3] | 229 | fi |
---|
[96fb8ad] | 230 | fi |
---|
| 231 | |
---|
[a814968] | 232 | dnl Enable lash support |
---|
| 233 | AC_ARG_ENABLE(lash, |
---|
| 234 | AC_HELP_STRING([--enable-lash],[compile with lash [[default=auto]]]), |
---|
| 235 | [with_lash=$enableval], |
---|
| 236 | with_lash="yes") |
---|
| 237 | if test "$with_lash" = "yes" |
---|
[96fb8ad] | 238 | then |
---|
[b511fa9] | 239 | PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.5.0, HAVE_LASH=1, HAVE_LASH=0) |
---|
| 240 | if test "${HAVE_LASH}" = "1"; then |
---|
[883deec] | 241 | AC_DEFINE(HAVE_LASH,1,[Define to enable lash support]) |
---|
[16109b3] | 242 | fi |
---|
[96fb8ad] | 243 | fi |
---|
| 244 | |
---|
[16109b3] | 245 | dnl Enable unit tests |
---|
[5215c01] | 246 | AC_ARG_ENABLE(testprogs, |
---|
[4db0752] | 247 | AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=yes]]]), |
---|
[5215c01] | 248 | [with_testprogs=$enableval], |
---|
[4db0752] | 249 | with_testprogs="yes") |
---|
[5215c01] | 250 | AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no") |
---|
| 251 | |
---|
[5a405dd] | 252 | AC_SUBST(AUBIO_CFLAGS) |
---|
[5ddcdf2] | 253 | AC_SUBST(AUBIO_LIBS) |
---|
[5a405dd] | 254 | |
---|
[16109b3] | 255 | dnl Check for swig and python |
---|
[3050cb8] | 256 | dnl should check for swig version and python headers |
---|
| 257 | AC_PATH_PROG(SWIG,swig,no) |
---|
| 258 | AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no") |
---|
| 259 | AM_PATH_PYTHON |
---|
| 260 | AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no") |
---|
[d09cad2] | 261 | |
---|
[16109b3] | 262 | dnl Check for docbook-to-man |
---|
[3050cb8] | 263 | AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no) |
---|
| 264 | AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no") |
---|
| 265 | |
---|
[16109b3] | 266 | dnl Create Makefiles |
---|
[96fb8ad] | 267 | AC_OUTPUT([ |
---|
[16109b3] | 268 | Makefile |
---|
| 269 | src/Makefile |
---|
| 270 | examples/Makefile |
---|
[de2a8af] | 271 | tests/Makefile |
---|
| 272 | tests/src/Makefile |
---|
[16109b3] | 273 | sounds/Makefile |
---|
| 274 | swig/Makefile |
---|
| 275 | python/Makefile |
---|
| 276 | python/aubio/Makefile |
---|
| 277 | doc/Makefile |
---|
| 278 | ]) |
---|
| 279 | |
---|
| 280 | dnl Print summary |
---|
[96fb8ad] | 281 | echo |
---|
| 282 | echo "**************************************************************" |
---|
| 283 | echo "Summary:" |
---|
[b511fa9] | 284 | if test "${HAVE_FFTW3F}" = "1"; then |
---|
[729a3c0] | 285 | echo "FFT: using fftw3f" |
---|
[96fb8ad] | 286 | else |
---|
[b511fa9] | 287 | if test "${HAVE_FFTW3}" = "1"; then |
---|
[729a3c0] | 288 | echo "Fft: using fftw3" |
---|
[96fb8ad] | 289 | else |
---|
[729a3c0] | 290 | echo "Fft: using ooura" |
---|
[96fb8ad] | 291 | fi |
---|
| 292 | fi |
---|
[588ee77] | 293 | if test "${HAVE_SNDFILE}" = "1"; then |
---|
[96fb8ad] | 294 | echo "Libsndfile: yes" |
---|
| 295 | else |
---|
| 296 | echo "Libsndfile: no" |
---|
| 297 | fi |
---|
[b511fa9] | 298 | if test "${HAVE_SAMPLERATE}" = "1"; then |
---|
[96fb8ad] | 299 | echo "Libsamplerate: yes" |
---|
| 300 | else |
---|
| 301 | echo "Libsamplerate: no" |
---|
| 302 | fi |
---|
[b511fa9] | 303 | if test "${HAVE_JACK}" = "1"; then |
---|
[96fb8ad] | 304 | echo "JACK: yes" |
---|
| 305 | else |
---|
| 306 | echo "JACK: no" |
---|
| 307 | fi |
---|
[b511fa9] | 308 | if test "${HAVE_LASH}" = "1"; then |
---|
[a814968] | 309 | echo "Lash: yes" |
---|
| 310 | else |
---|
| 311 | echo "Lash: no" |
---|
| 312 | fi |
---|
[96fb8ad] | 313 | echo "**************************************************************" |
---|
| 314 | echo Configuration completed successfully. Type \'make\' to build ${PACKAGE} |
---|