source: configure.ac @ db62622

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since db62622 was 10a5413, checked in by Paul Brossier <piem@piem.org>, 15 years ago

src/mathutils.c: add aubio_is_power_of_two and aubio_next_power_of_two

  • Property mode set to 100644
File size: 8.4 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 Enable silent rules, use with make V=0
20dnl AM_SILENT_RULES
21
22dnl Maintainer mode
23AM_MAINTAINER_MODE
24
25dnl Guess the host
26AC_CANONICAL_HOST
27
28dnl Check for programs
29AC_PROG_CC
30AM_PROG_CC_C_O dnl compiling with per-target flag
31if test "$ac_cv_prog_cc" = "no" ; then
32   AC_MSG_ERROR([*** No C compiler found !])
33fi
34AC_PROG_CXX
35AC_PROG_INSTALL
36
37AUBIO_CFLAGS=
38
39dnl Enable debugging (no)
40AC_ARG_ENABLE(debug,
41  AC_HELP_STRING([--enable-debug],[compile in debug mode [[default=no]]]),
42  with_debug="yes",
43  with_debug="no")
44if test "$with_debug" = "yes"
45then
46  AC_DEFINE(DEBUG,1,[Define to enable debug])
47  AUBIO_CFLAGS="$AUBIO_CFLAGS -g"
48fi
49
50dnl Enable full warnings (yes)
51AC_ARG_ENABLE(warnings,
52  AC_HELP_STRING([--enable-warnings],[compile with all gcc warnings [[default=yes]]]),
53  with_warnme="no",
54  with_warnme="yes")
55if test "$with_warnme" = "yes"
56then
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)
63  CFLAGS="$old_CFLAGS"
64  ])
65  if test "$ac_cv_cc_wextra" = "yes"
66  then
67    AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall -Wextra"
68  else
69    AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall"
70  fi
71fi
72
73dnl fail on compilation warnings
74AC_ARG_ENABLE(errorfail,
75  AC_HELP_STRING([--enable-errorfail],[fail on compilation warnings [[default=no]]]),
76  AUBIO_CFLAGS="$AUBIO_CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter",
77  with_errorfail="no")
78
79dnl add gcov/lcov profiling and coverage flags
80AC_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")
84
85dnl Check for libtool
86AC_LIBTOOL_DLOPEN
87dnl AC_DISABLE_STATIC
88dnl allow cross compiling
89AC_LIBTOOL_WIN32_DLL
90AC_PROG_LIBTOOL
91
92AC_CONFIG_HEADERS(src/config.h)
93AC_CONFIG_FILES(aubio.pc)
94
95AM_CONDITIONAL(MINGW, false)
96AM_CONDITIONAL(DARWIN, false)
97case "${host}" in
98*mingw* | *cygwin*)
99  mingw32_support="yes"
100  AC_CHECK_HEADER(windows.h)
101  AM_CONDITIONAL(MINGW, true)
102  LDFLAGS="$LDFLAGS -no-undefined"
103  ;;
104*darwin* | *rhapsody* | *macosx*)
105  AC_ISC_POSIX
106  AM_CONDITIONAL(DARWIN, true)
107  ;;
108*)
109  AC_ISC_POSIX
110  ;;
111esac
112
113dnl Check for required libraries
114AC_CHECK_LIB(pthread, pthread_create)
115
116dnl Check for header files
117AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h limits.h errno.h stdarg.h unistd.h signal.h],,)
118AC_CHECK_HEADERS(fftw3.h,,AC_MSG_ERROR([Ouch! missing fftw3.h header]))
119AC_ARG_ENABLE(complex,
120  AC_HELP_STRING([--enable-complex],[compile with complex.h [[default=auto]]]),
121  [with_complex=$enableval],
122  with_complex="yes")
123if test "$with_complex" = "yes"; then
124  AC_CHECK_HEADERS(complex.h,,AC_MSG_WARN([Ouch! missing complex.h header]))
125fi
126
127dnl Check for __VAR_ARGS__ support
128AC_CACHE_CHECK(for C99 __VA_ARGS__ macro,
129    ac_cv_varargs_macros,
130AC_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)
140if test "$ac_cv_varargs_macros" = "yes"; then
141    AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
142            [Defined when c99 style varargs macros are supported])
143fi
144
145dnl Check for pkg-config
146AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
147
148PKG_CHECK_MODULES(SNDFILE,     sndfile >= 1.0.4,       HAVE_SNDFILE=1)
149if test "${HAVE_SNDFILE}" = "1"; then
150  AC_DEFINE(HAVE_SNDFILE,1,[Define to enable libsndfile support])
151fi
152
153dnl Enable samplerate support (auto)
154AC_ARG_ENABLE(samplerate,
155  AC_HELP_STRING([--enable-samplerate],[compile with samplerate [[default=auto]]]),
156  [with_samplerate=$enableval],
157  with_samplerate="yes")
158if 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
163fi
164
165dnl Check for fftw3 (required)
166AC_ARG_ENABLE(fftw3f,
167  AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
168  [with_fftw3f=$enableval],
169  with_fftw3f="yes")
170if test "$with_fftw3f" = "yes"; then
171  PKG_CHECK_MODULES(FFTWLIB,    fftw3f >= 3.0.0,     HAVE_FFTW3F=1, HAVE_FFTW3F=0)
172else
173  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     HAVE_FFTW3=1)
174fi
175if test "${HAVE_FFTW3F}" = "0"; then
176  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     HAVE_FFTW3=1)
177fi
178if test "${HAVE_FFTW3}" = "1"; then
179  AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support])
180fi
181if test "${HAVE_FFTW3F}" = "1"; then
182  AC_DEFINE(HAVE_FFTW3F,1,[Define to enable fftw3f support])
183fi
184
185dnl Enable jack support (auto)
186AC_ARG_ENABLE(jack,
187  AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]),
188  [with_jack=$enableval],
189  with_jack="yes")
190if test "$with_jack" = "yes"
191then
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])
195  fi
196fi
197
198dnl Enable lash support
199AC_ARG_ENABLE(lash,
200  AC_HELP_STRING([--enable-lash],[compile with lash [[default=auto]]]),
201  [with_lash=$enableval],
202  with_lash="yes")
203if test "$with_lash" = "yes"
204then
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"
208  fi
209fi
210 
211dnl Enable unit tests
212AC_ARG_ENABLE(testprogs,
213  AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=no]]]),
214  [with_testprogs=$enableval],
215  with_testprogs="no")
216AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
217
218AC_SUBST(AUBIO_CFLAGS)
219
220dnl Check for swig and python
221dnl should check for swig version and python headers
222AC_PATH_PROG(SWIG,swig,no)
223AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no")
224AM_PATH_PYTHON
225AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no")
226
227dnl Check for docbook-to-man
228AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
229AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
230
231dnl Check for Puredata
232AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
233AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
234
235dnl Check for Java
236AC_CHECK_HEADER(jni.h,JAVAHEADERS=y,AC_MSG_WARN([Java header jni.h not found.]))
237AM_CONDITIONAL(JAVAFOUND, test "${JAVAHEADERS}" = "y")
238
239dnl Create Makefiles
240AC_OUTPUT([
241    Makefile
242    src/Makefile
243    ext/Makefile
244    examples/Makefile
245    tests/Makefile
246    tests/src/Makefile
247    tests/cpp/Makefile
248    sounds/Makefile
249    swig/Makefile
250    python/Makefile
251    python/aubio/Makefile
252    interfaces/java/Makefile
253    interfaces/java/aubio/Makefile
254    interfaces/cpp/Makefile
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
263dnl Print summary
264echo
265echo "**************************************************************"
266echo "Summary:"
267if test "${HAVE_FFTW3F}" = "1"; then
268  echo "Fftw3:                   yes (using fftw3f)"
269else
270if test "${HAVE_FFTW3}" = "1"; then
271  echo "Fftw3:                   yes (not using fftw3f)"
272else
273  echo "Fftw3:                   no (that should not happen)"
274fi
275fi
276if test "${HAVE_SNDFILE}" = "1"; then
277  echo "Libsndfile:              yes"
278else
279  echo "Libsndfile:              no"
280fi
281if test "${HAVE_SAMPLERATE}" = "1"; then
282  echo "Libsamplerate:           yes"
283else
284  echo "Libsamplerate:           no"
285fi
286if test "${HAVE_JACK}" = "1"; then
287  echo "JACK:                    yes"
288else
289  echo "JACK:                    no"
290fi
291if test "${HAVE_LASH}" = "1"; then
292  echo "Lash:                    yes"
293else
294  echo "Lash:                    no"
295fi
296if test "${PUREDATA}" = "y"; then
297  echo "PureData:                yes"
298else
299  echo "PureData:                no"
300fi
301echo "**************************************************************"
302echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
Note: See TracBrowser for help on using the repository browser.