source: configure.ac @ b9f5dbf

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since b9f5dbf 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
Line 
1dnl Process this file with autoconf to produce a configure script
2
3dnl Init autoconf
4AC_INIT(src/aubio.h)
5
6dnl Package name and version
7PACKAGE=aubio
8. $srcdir/VERSION
9AUBIO_VERSION=${AUBIO_MAJOR_VERSION}.${AUBIO_MINOR_VERSION}.${AUBIO_PATCH_VERSION}${AUBIO_VERSION_STATUS}
10VERSION=${AUBIO_VERSION}
11
12dnl Shared library version
13SHARED_VERSION_INFO=${LIBAUBIO_LT_CUR}:${LIBAUBIO_LT_REV}:${LIBAUBIO_LT_AGE}
14AC_SUBST(SHARED_VERSION_INFO)
15
16dnl Init automake
17AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
18
19dnl Maintainer mode
20AM_MAINTAINER_MODE
21
22dnl Guess the host
23AC_CANONICAL_HOST
24
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
32dnl Enable debugging (no)
33AC_ARG_ENABLE(debug,
34  [  --enable-debug[[=value]]  compile with debug [[default=no]]],
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
43dnl Enable full warnings (yes)
44AC_ARG_ENABLE(warnme,
45  [  --enable-warnme[[=value]] compile with all -W [[default=yes]]],
46  with_warnme="no",
47  with_warnme="yes")
48if test "$with_warnme" = "yes"
49then
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
63fi
64
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")
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
79*mingw*)
80  mingw32_support="yes"
81  AC_CHECK_HEADER(windows.h)
82  ;;
83*darwin*)
84  dnl on macosx, cosf went to -lmx
85  LDFLAGS="$LDFLAGS -lmx"
86  dnl as long double doesn't sit well with -Wall -Werror
87  CFLAGS="$CFLAGS -Wno-long-double"
88  AC_ISC_POSIX
89  ;;
90*)
91  AC_ISC_POSIX
92  ;;
93esac
94
95dnl Check for required libraries
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]))
102AC_CHECK_HEADERS(fftw3.h  ,,AC_MSG_ERROR([Ouch! missing fftw3.h header]))
103
104dnl Check for __VAR_ARGS__ support
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
122dnl Check for pkg-config
123AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
124
125PKG_CHECK_MODULES(SNDLIB,     sndfile >= 1.0.4,       SNDLIB_SUPPORT=1)
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
132dnl Check for fftw3 (required)
133AC_ARG_ENABLE(fftw3f,
134  AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
135  [with_fftw3f=$enableval],
136  with_fftw3f="yes")
137if test "$with_fftw3f" = "yes"; then
138  PKG_CHECK_MODULES(FFTWLIB,    fftw3f >= 3.0.0,     FFTW3F_SUPPORT=1, FFTW3F_SUPPORT=0)
139else
140  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     FFTW3_SUPPORT=1)
141fi
142if test "${FFTW3F_SUPPORT}" = "0"; then
143  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     FFTW3_SUPPORT=1)
144fi
145if test "${FFTW3_SUPPORT}" = "1"; then
146  AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support])
147fi
148if test "${FFTW3F_SUPPORT}" = "1"; then
149  AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support])
150fi
151
152dnl Enable jack support (auto)
153AC_ARG_ENABLE(jack,
154  AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]),
155  [with_jack=$enableval],
156  with_jack="yes")
157if test "$with_jack" = "yes"
158then
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
163fi
164
165dnl Enable alsa support (auto)
166AC_ARG_ENABLE(alsa,
167  AC_HELP_STRING([--enable-alsa],[compile with alsa [[default=auto]]]),
168  [with_alsa=$enableval],
169  with_alsa="yes")
170if test "$with_alsa" = "yes"
171then
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
181fi
182
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"
189then
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"
193  fi
194fi
195 
196dnl Enable unit tests
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
203dnl Check for swig and python
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")
209#
210#if PYTHONFOUND
211case "${host_os}" in
212*darwin*)
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
220#
221AC_SUBST(SWCFLAGS)
222AC_SUBST(SWLDFLAGS)
223
224dnl Check for docbook-to-man
225AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
226AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
227
228dnl Check for Puredata
229AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
230AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
231
232dnl Create Makefiles
233AC_OUTPUT([
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
252echo
253echo "**************************************************************"
254echo "Summary:"
255if test "${FFTW3F_SUPPORT}" = "1"; then
256  echo "Fftw3:                   yes (using fftw3f)"
257else
258if test "${FFTW3_SUPPORT}" = "1"; then
259  echo "Fftw3:                   yes (not using fftw3f)"
260else
261  echo "Fftw3:                   no (that should not happen)"
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
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"
293fi
294echo "**************************************************************"
295echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
Note: See TracBrowser for help on using the repository browser.