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