source: configure.ac @ dbd19ea

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since dbd19ea was 5274ee6, checked in by Paul Brossier <piem@altern.org>, 18 years ago

bump version number, use VERSION to store it
bump version number, use VERSION to store it

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