[5215c01] | 1 | dnl Process this file with autoconf to produce a configure script |
---|
[96fb8ad] | 2 | |
---|
| 3 | AC_INIT(src/aubio.h) |
---|
| 4 | |
---|
[9fc2c7e] | 5 | dnl package version |
---|
[96fb8ad] | 6 | . $srcdir/VERSION |
---|
| 7 | AUBIO_VERSION=${AUBIO_MAJOR_VERSION}.${AUBIO_MINOR_VERSION}.${AUBIO_PATCH_VERSION}${AUBIO_VERSION_STATUS} |
---|
| 8 | VERSION=${AUBIO_VERSION} |
---|
| 9 | PACKAGE=aubio |
---|
| 10 | |
---|
[9fc2c7e] | 11 | dnl shared library version |
---|
[6610143] | 12 | LIBAUBIO_LT_CURRENT=2 |
---|
[9fc2c7e] | 13 | LIBAUBIO_LT_REVISION=0 |
---|
| 14 | LIBAUBIO_LT_AGE=0 |
---|
| 15 | SHARED_VERSION_INFO="$LIBAUBIO_LT_CURRENT:$LIBAUBIO_LT_REVISION:$LIBAUBIO_LT_AGE" |
---|
| 16 | AC_SUBST(SHARED_VERSION_INFO) |
---|
| 17 | |
---|
[96fb8ad] | 18 | AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION}) |
---|
[5215c01] | 19 | AM_MAINTAINER_MODE |
---|
[96fb8ad] | 20 | |
---|
| 21 | AC_PREFIX_DEFAULT(/usr) |
---|
| 22 | |
---|
| 23 | dnl enable optimization |
---|
| 24 | CFLAGS="$CFLAGS -O2" |
---|
[d17f63e] | 25 | |
---|
[96fb8ad] | 26 | dnl Check for debug |
---|
| 27 | AC_ARG_ENABLE(debug, |
---|
| 28 | [ --enable-debug[[=value]] compile with debug [[default=no]]], |
---|
| 29 | with_debug="yes", |
---|
| 30 | with_debug="no") |
---|
| 31 | if test "$with_debug" = "yes" |
---|
| 32 | then |
---|
| 33 | AC_DEFINE(DEBUG,1,[Define to enable debug]) |
---|
| 34 | CFLAGS="$CFLAGS -g" |
---|
| 35 | fi |
---|
| 36 | |
---|
| 37 | dnl |
---|
| 38 | AC_ARG_ENABLE(warnme, |
---|
| 39 | [ --enable-warnme[[=value]] compile with all -W [[default=yes]]], |
---|
| 40 | with_warnme="no", |
---|
| 41 | with_warnme="yes") |
---|
| 42 | if test "$with_warnme" = "yes" |
---|
| 43 | then |
---|
[3050cb8] | 44 | ALL_CWARNINGS="-Wall -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-char-subscripts -Wno-unknown-pragmas" |
---|
| 45 | CFLAGS="$CFLAGS $ALL_CWARNINGS" |
---|
[96fb8ad] | 46 | fi |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | dnl Guess the host |
---|
| 50 | AC_CANONICAL_HOST |
---|
| 51 | |
---|
| 52 | dnl Check for programs |
---|
| 53 | AC_PROG_CC |
---|
| 54 | if test "$ac_cv_prog_cc" = "no" ; then |
---|
| 55 | AC_MSG_ERROR([*** No C compiler found !]) |
---|
| 56 | fi |
---|
| 57 | AC_PROG_INSTALL |
---|
| 58 | |
---|
| 59 | dnl Check for libtool |
---|
| 60 | AC_LIBTOOL_DLOPEN |
---|
| 61 | dnl AC_DISABLE_STATIC |
---|
| 62 | AC_PROG_LIBTOOL |
---|
| 63 | |
---|
| 64 | AC_CONFIG_HEADERS(src/config.h) |
---|
| 65 | AC_CONFIG_FILES(aubio.pc) |
---|
| 66 | |
---|
| 67 | case "${host_os}" in |
---|
[162fd27] | 68 | *mingw*) |
---|
[96fb8ad] | 69 | mingw32_support="yes" |
---|
| 70 | AC_CHECK_HEADER(windows.h) |
---|
| 71 | ;; |
---|
[162fd27] | 72 | *darwin*) |
---|
[d17f63e] | 73 | dnl on macosx, cosf went to -lmx |
---|
| 74 | LDFLAGS="$LDFLAGS -lmx" |
---|
[b6f6d58] | 75 | dnl as long double doesn't sit well with -Wall -Werror |
---|
| 76 | CFLAGS="$CLFAGS -Wno-long-double" |
---|
[d17f63e] | 77 | AC_ISC_POSIX |
---|
| 78 | ;; |
---|
[96fb8ad] | 79 | *) |
---|
| 80 | AC_ISC_POSIX |
---|
| 81 | ;; |
---|
| 82 | esac |
---|
| 83 | |
---|
[3050cb8] | 84 | dnl Check for required libraries |
---|
[96fb8ad] | 85 | AC_CHECK_LIB(pthread, pthread_create) |
---|
| 86 | |
---|
| 87 | dnl Check for header files |
---|
| 88 | AC_HEADER_STDC |
---|
| 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])) |
---|
[091b171] | 91 | AC_CHECK_HEADERS(fftw3.h ,,AC_MSG_ERROR([Ouch! missing fftw3.h header])) |
---|
[96fb8ad] | 92 | |
---|
[5215c01] | 93 | AC_CACHE_CHECK(for C99 __VA_ARGS__ macro, |
---|
| 94 | ac_cv_varargs_macros, |
---|
| 95 | AC_TRY_COMPILE([ |
---|
| 96 | #include <stdio.h> |
---|
| 97 | #define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__) |
---|
| 98 | ], |
---|
| 99 | [ |
---|
| 100 | AUBIO_ERR("%s\n", "ERR"); |
---|
| 101 | ], |
---|
| 102 | ac_cv_varargs_macros=yes, |
---|
| 103 | ac_cv_varargs_macros=no) |
---|
| 104 | ) |
---|
| 105 | if test "$ac_cv_varargs_macros" = "yes"; then |
---|
| 106 | AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1, |
---|
| 107 | [Defined when c99 style varargs macros are supported]) |
---|
| 108 | fi |
---|
| 109 | |
---|
| 110 | |
---|
[96fb8ad] | 111 | dnl check for pkg-config |
---|
| 112 | AC_PATH_PROG(PKG_CONFIG,pkg-config,no) |
---|
| 113 | |
---|
| 114 | PKG_CHECK_MODULES(SNDLIB, sndfile >= 1.0.4, SNDLIB_SUPPORT=1) |
---|
| 115 | PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15, SAMPLERATE_SUPPORT=1) |
---|
| 116 | |
---|
| 117 | if test "${SNDLIB_SUPPORT}" = "1"; then |
---|
| 118 | AC_DEFINE(SNDLIB_SUPPORT,1,[Define to enable libsndfile support]) |
---|
| 119 | fi |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | dnl Check for optional libraries |
---|
| 123 | AC_ARG_ENABLE(fftw3f, |
---|
[dc27a81] | 124 | AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]), |
---|
| 125 | [with_fftw3f=$enableval], |
---|
| 126 | with_fftw3f="yes") |
---|
[96fb8ad] | 127 | if test "$with_fftw3f" = "yes"; then |
---|
[dc27a81] | 128 | PKG_CHECK_MODULES(FFTWLIB, fftw3f >= 3.0.0, FFTW3F_SUPPORT=1, FFTW3F_SUPPORT=0) |
---|
[e50b695] | 129 | else |
---|
[dc27a81] | 130 | PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, FFTW3_SUPPORT=1) |
---|
| 131 | fi |
---|
| 132 | if test "${FFTW3F_SUPPORT}" = "0"; then |
---|
| 133 | PKG_CHECK_MODULES(FFTWLIB, fftw3 >= 3.0.0, FFTW3_SUPPORT=1) |
---|
[e50b695] | 134 | fi |
---|
| 135 | if test "${FFTW3_SUPPORT}" = "1"; then |
---|
| 136 | AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support]) |
---|
[96fb8ad] | 137 | fi |
---|
| 138 | if test "${FFTW3F_SUPPORT}" = "1"; then |
---|
| 139 | AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support]) |
---|
| 140 | fi |
---|
| 141 | |
---|
| 142 | AC_ARG_ENABLE(jack, |
---|
[dc27a81] | 143 | AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]), |
---|
| 144 | [with_jack=$enableval], |
---|
| 145 | with_jack="yes") |
---|
[96fb8ad] | 146 | if test "$with_jack" = "yes" |
---|
| 147 | then |
---|
[dc27a81] | 148 | PKG_CHECK_MODULES(JACK, jack >= 0.15.0, JACK_SUPPORT=1, JACK_SUPPORT=0) |
---|
[96fb8ad] | 149 | if test "${JACK_SUPPORT}" = "1"; then |
---|
| 150 | AC_DEFINE(JACK_SUPPORT,1,[Define to enable jack support]) |
---|
| 151 | fi |
---|
| 152 | fi |
---|
| 153 | |
---|
| 154 | AC_ARG_ENABLE(alsa, |
---|
[dc27a81] | 155 | AC_HELP_STRING([--enable-alsa],[compile with alsa [[default=auto]]]), |
---|
| 156 | [with_alsa=$enableval], |
---|
| 157 | with_alsa="yes") |
---|
[96fb8ad] | 158 | if test "$with_alsa" = "yes" |
---|
| 159 | then |
---|
[ead2920] | 160 | if test "$with_jack" = "yes" |
---|
| 161 | then |
---|
[dc27a81] | 162 | PKG_CHECK_MODULES(ALSA, alsa >= 0.0.9, ALSA_SUPPORT=1, ALSA_SUPPORT=0) |
---|
[96fb8ad] | 163 | if test "${ALSA_SUPPORT}" = "1"; then |
---|
| 164 | AC_DEFINE(ALSA_SUPPORT,1,[Define to enable alsa support]) |
---|
| 165 | fi |
---|
[ead2920] | 166 | else |
---|
| 167 | AC_MSG_WARN([Disabling alsa as jack was not found]) |
---|
| 168 | fi |
---|
[96fb8ad] | 169 | fi |
---|
| 170 | |
---|
| 171 | AC_ARG_ENABLE(ladcca, |
---|
[dc27a81] | 172 | AC_HELP_STRING([--enable-ladcca],[compile with ladcca [[default=no]]]), |
---|
| 173 | [with_ladcca=$enableval], |
---|
[96fb8ad] | 174 | with_ladcca="no") |
---|
| 175 | if test "$with_ladcca" = "yes" |
---|
| 176 | then |
---|
| 177 | PKG_CHECK_MODULES(LADCCA, ladcca-1.0 >= 0.4.0, LADCCA_SUPPORT=1) |
---|
| 178 | if test "${LADCCA_SUPPORT}" = "1"; then |
---|
| 179 | AC_DEFINE(LADCCA_SUPPORT,1,[Define to enable ladcca support]) |
---|
| 180 | fi |
---|
| 181 | fi |
---|
| 182 | |
---|
[5215c01] | 183 | AC_ARG_ENABLE(testprogs, |
---|
| 184 | AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=no]]]), |
---|
| 185 | [with_testprogs=$enableval], |
---|
| 186 | with_testprogs="no") |
---|
| 187 | AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no") |
---|
| 188 | |
---|
[3050cb8] | 189 | dnl Check for optional programs |
---|
| 190 | |
---|
| 191 | dnl should check for swig version and python headers |
---|
| 192 | AC_PATH_PROG(SWIG,swig,no) |
---|
| 193 | AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no") |
---|
| 194 | AM_PATH_PYTHON |
---|
| 195 | AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no") |
---|
| 196 | |
---|
[d09cad2] | 197 | #if PYTHONFOUND |
---|
| 198 | case "${host_os}" in |
---|
[162fd27] | 199 | *darwin*) |
---|
[d09cad2] | 200 | SWCFLAGS="-Wno-long-double" |
---|
| 201 | SWLDFLAGS="-bundle -framework python -L${prefix}/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" |
---|
| 202 | ;; |
---|
| 203 | *) |
---|
| 204 | SWLDFLAGS="-shared" |
---|
| 205 | ;; |
---|
| 206 | esac |
---|
| 207 | |
---|
| 208 | AC_SUBST(SWCFLAGS) |
---|
| 209 | AC_SUBST(SWLDFLAGS) |
---|
| 210 | |
---|
[3050cb8] | 211 | AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no) |
---|
| 212 | AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no") |
---|
| 213 | |
---|
[5215c01] | 214 | AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.])) |
---|
[3050cb8] | 215 | AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y") |
---|
[96fb8ad] | 216 | |
---|
| 217 | AC_OUTPUT([ |
---|
| 218 | Makefile |
---|
| 219 | src/Makefile |
---|
[b60dd4ae] | 220 | ext/Makefile |
---|
[96fb8ad] | 221 | examples/Makefile |
---|
[5215c01] | 222 | examples/tests/Makefile |
---|
[96fb8ad] | 223 | sounds/Makefile |
---|
[5215c01] | 224 | swig/Makefile |
---|
[96fb8ad] | 225 | python/Makefile |
---|
| 226 | python/aubio/Makefile |
---|
| 227 | plugins/Makefile |
---|
| 228 | plugins/audacity/Makefile |
---|
| 229 | plugins/audacity/plug-ins/Makefile |
---|
| 230 | plugins/wavesurfer/Makefile |
---|
[f647e82] | 231 | plugins/puredata/Makefile |
---|
| 232 | doc/Makefile |
---|
[96fb8ad] | 233 | ]) |
---|
| 234 | |
---|
| 235 | echo |
---|
| 236 | echo "**************************************************************" |
---|
| 237 | echo "Summary:" |
---|
| 238 | if test "${FFTW3F_SUPPORT}" = "1"; then |
---|
[dc27a81] | 239 | echo "Fftw3: yes (using fftw3f)" |
---|
[96fb8ad] | 240 | else |
---|
| 241 | if test "${FFTW3_SUPPORT}" = "1"; then |
---|
[dc27a81] | 242 | echo "Fftw3: yes (not using fftw3f)" |
---|
[96fb8ad] | 243 | else |
---|
[dc27a81] | 244 | echo "Fftw3: no (that should not happen)" |
---|
[96fb8ad] | 245 | fi |
---|
| 246 | fi |
---|
| 247 | if test "${SNDLIB_SUPPORT}" = "1"; then |
---|
| 248 | echo "Libsndfile: yes" |
---|
| 249 | else |
---|
| 250 | echo "Libsndfile: no" |
---|
| 251 | fi |
---|
| 252 | if test "${SAMPLERATE_SUPPORT}" = "1"; then |
---|
| 253 | echo "Libsamplerate: yes" |
---|
| 254 | else |
---|
| 255 | echo "Libsamplerate: no" |
---|
| 256 | fi |
---|
| 257 | if test "${JACK_SUPPORT}" = "1"; then |
---|
| 258 | echo "JACK: yes" |
---|
| 259 | else |
---|
| 260 | echo "JACK: no" |
---|
| 261 | fi |
---|
| 262 | if test "${ALSA_SUPPORT}" = "1"; then |
---|
| 263 | echo "ALSA midi: yes" |
---|
| 264 | else |
---|
| 265 | echo "ALSA midi: no" |
---|
| 266 | fi |
---|
| 267 | if test "${LADCCA_SUPPORT}" = "1"; then |
---|
| 268 | echo "Ladcca: yes" |
---|
| 269 | fi |
---|
| 270 | echo "**************************************************************" |
---|
| 271 | echo Configuration completed successfully. Type \'make\' to build ${PACKAGE} |
---|