source: configure.ac @ 614963a

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 614963a was 4db0752, checked in by Paul Brossier <piem@piem.org>, 12 years ago

configure.ac: enable tests by default, add m4

  • Property mode set to 100644
File size: 8.5 KB
Line 
1dnl Process this file with autoconf to produce a configure script
2
3dnl Init autoconf
4AC_INIT(src/aubio.h)
5
6AC_CONFIG_MACRO_DIR([m4])
7
8dnl Package name and version
9PACKAGE=aubio
10. $srcdir/VERSION
11AUBIO_VERSION=${AUBIO_MAJOR_VERSION}.${AUBIO_MINOR_VERSION}.${AUBIO_PATCH_VERSION}${AUBIO_VERSION_STATUS}
12VERSION=${AUBIO_VERSION}
13
14dnl Shared library version
15SHARED_VERSION_INFO=${LIBAUBIO_LT_CUR}:${LIBAUBIO_LT_REV}:${LIBAUBIO_LT_AGE}
16AC_SUBST(SHARED_VERSION_INFO)
17
18dnl Init automake
19AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
20
21dnl Enable silent rules, use with make V=0
22dnl AM_SILENT_RULES
23
24dnl Maintainer mode
25AM_MAINTAINER_MODE
26
27dnl Guess the host
28AC_CANONICAL_HOST
29
30dnl Check for programs
31AC_PROG_CC
32AM_PROG_CC_C_O dnl compiling with per-target flag
33if test "$ac_cv_prog_cc" = "no" ; then
34   AC_MSG_ERROR([*** No C compiler found !])
35fi
36AC_PROG_INSTALL
37
38AUBIO_CFLAGS=
39
40AC_CHECK_LIB(m, floorf)
41AUBIO_LIBS="-lm"
42
43dnl Enable double precision (no)
44AC_ARG_ENABLE(double,
45  AC_HELP_STRING([--enable-double],[compile in double precision [[default=no]]]),
46  with_double_precision="yes",
47  with_double_precision="no")
48if test "$with_double_precision" = "yes"
49then
50  AC_DEFINE(HAVE_AUBIO_DOUBLE,1,[Define to enable double precision])
51fi
52
53dnl Enable debugging (no)
54AC_ARG_ENABLE(debug,
55  AC_HELP_STRING([--enable-debug],[compile in debug mode [[default=no]]]),
56  with_debug="yes",
57  with_debug="no")
58if test "$with_debug" = "yes"
59then
60  AC_DEFINE(DEBUG,1,[Define to enable debug])
61  AUBIO_CFLAGS="$AUBIO_CFLAGS -g"
62fi
63
64dnl Enable full warnings (yes)
65AC_ARG_ENABLE(warnings,
66  AC_HELP_STRING([--enable-warnings],[compile with all gcc warnings [[default=yes]]]),
67  with_warnme="no",
68  with_warnme="yes")
69if test "$with_warnme" = "yes"
70then
71  dnl Check for -Wextra support to allow compilation on gcc <= 3.4
72  AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra,
73  [old_CFLAGS="$CFLAGS"
74  CFLAGS="$CFLAGS -Wextra"
75  AC_COMPILE_IFELSE([void foo (void) {}],
76          ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
77  CFLAGS="$old_CFLAGS"
78  ])
79  if test "$ac_cv_cc_wextra" = "yes"
80  then
81    AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall -Wextra"
82  else
83    AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall"
84  fi
85fi
86
87dnl fail on compilation warnings
88AC_ARG_ENABLE(errorfail,
89  AC_HELP_STRING([--enable-errorfail],[fail on compilation warnings [[default=no]]]),
90  AUBIO_CFLAGS="$AUBIO_CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter",
91  with_errorfail="no")
92
93dnl add gcov/lcov profiling and coverage flags
94AC_ARG_ENABLE(lcov,
95  AC_HELP_STRING([--enable-lcov],[compile with gcov/lcov profiling flags [[default=no]]]),
96  AUBIO_CFLAGS="$AUBIO_CFLAGS -fprofile-arcs -ftest-coverage",
97  with_lcov="no")
98
99dnl Check for libtool
100AC_LIBTOOL_DLOPEN
101dnl AC_DISABLE_STATIC
102dnl allow cross compiling
103AC_LIBTOOL_WIN32_DLL
104AC_PROG_LIBTOOL
105
106AC_CONFIG_HEADERS(src/config.h)
107AC_CONFIG_FILES(aubio.pc)
108
109AM_CONDITIONAL(MINGW, false)
110AM_CONDITIONAL(DARWIN, false)
111case "${host}" in
112*mingw* | *cygwin*)
113  mingw32_support="yes"
114  AC_CHECK_HEADER(windows.h)
115  AM_CONDITIONAL(MINGW, true)
116  LDFLAGS="$LDFLAGS -no-undefined"
117  ;;
118*darwin* | *rhapsody* | *macosx*)
119  AC_ISC_POSIX
120  AM_CONDITIONAL(DARWIN, true)
121  ;;
122*)
123  AC_ISC_POSIX
124  ;;
125esac
126
127dnl Check for required libraries
128AC_CHECK_LIB(pthread, pthread_create)
129
130dnl Check for header files
131AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h limits.h errno.h stdarg.h unistd.h signal.h],,)
132AC_ARG_ENABLE(complex,
133  AC_HELP_STRING([--enable-complex],[compile with complex.h [[default=auto]]]),
134  [with_complex=$enableval],
135  with_complex="no")
136if test "$with_complex" = "yes"; then
137  AC_CHECK_HEADERS(complex.h,,AC_MSG_WARN([Ouch! missing complex.h header]))
138fi
139
140dnl Check for __VAR_ARGS__ support
141AC_CACHE_CHECK(for C99 __VA_ARGS__ macro,
142    ac_cv_varargs_macros,
143AC_TRY_COMPILE([
144  #include <stdio.h>
145  #define AUBIO_ERR(...)                       fprintf(stderr, __VA_ARGS__)
146],
147[
148  AUBIO_ERR("%s\n", "ERR");
149],
150        ac_cv_varargs_macros=yes,
151        ac_cv_varargs_macros=no)
152)
153if test "$ac_cv_varargs_macros" = "yes"; then
154    AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
155            [Defined when c99 style varargs macros are supported])
156fi
157
158AC_ARG_ENABLE(sndfile,
159  AC_HELP_STRING([--enable-sndfile],[compile with sndfile [[default=auto]]]),
160  [with_sndfile=$enableval],
161  with_sndfile="yes")
162if test "$with_sndfile" = "yes"; then
163  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.4, HAVE_SNDFILE=1, HAVE_SNDFILE=0)
164  if test "${HAVE_SNDFILE}" = "1"; then
165    AC_DEFINE(HAVE_SNDFILE,1,[Define to enable libsndfile support])
166  fi
167fi
168
169dnl Enable samplerate support (auto)
170AC_ARG_ENABLE(samplerate,
171  AC_HELP_STRING([--enable-samplerate],[compile with samplerate [[default=auto]]]),
172  [with_samplerate=$enableval],
173  with_samplerate="yes")
174if test "$with_samplerate" = "yes"; then
175  PKG_CHECK_MODULES(SAMPLERATE, samplerate  >= 0.0.15,  HAVE_SAMPLERATE=1,
176                    HAVE_SAMPLERATE=0)
177  if test "${HAVE_SAMPLERATE}" = "1"; then
178    AC_DEFINE(HAVE_SAMPLERATE,1,[Define to enable libsamplerate support])
179  fi
180fi
181
182dnl Check for fftw3 (required)
183dnl if we compile in double precsion, default to fftw3, else fftw3f
184
185AC_ARG_ENABLE(fftw3,
186  AC_HELP_STRING([--enable-fftw3],[compile with fftw3 [[default=auto]]]),
187  [with_fftw3=$enableval],
188  with_fftw3="yes")
189
190if test "$with_double_precision" = "yes"; then
191    default_fftw3f="no"
192else
193    default_fftw3f=$with_fftw3
194fi
195
196AC_ARG_ENABLE(fftw3f,
197  AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
198  [with_fftw3f=$enableval],
199  [with_fftw3f=$default_fftw3f])
200
201# check if we have fftw3f
202if test "$with_fftw3f" = "yes"; then
203  PKG_CHECK_MODULES(FFTWLIB,    fftw3f >= 3.0.0,     HAVE_FFTW3F=1, HAVE_FFTW3F=0)
204else
205# check if we have fftw3
206if test "$with_fftw3" = "yes"; then
207  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     HAVE_FFTW3=1, HAVE_FFTW3=0)
208fi
209fi
210
211if test "${HAVE_FFTW3}" = "1"; then
212  AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support])
213fi
214if test "${HAVE_FFTW3F}" = "1"; then
215  AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support])
216  AC_DEFINE(HAVE_FFTW3F,1,[Define to enable fftw3f support])
217fi
218
219dnl Enable jack support (auto)
220AC_ARG_ENABLE(jack,
221  AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]),
222  [with_jack=$enableval],
223  with_jack="yes")
224if test "$with_jack" = "yes"
225then
226  PKG_CHECK_MODULES(JACK,       jack  >= 0.15.0,     HAVE_JACK=1, HAVE_JACK=0)
227  if test "${HAVE_JACK}" = "1"; then
228    AC_DEFINE(HAVE_JACK,1,[Define to enable jack support])
229  fi
230fi
231
232dnl Enable lash support
233AC_ARG_ENABLE(lash,
234  AC_HELP_STRING([--enable-lash],[compile with lash [[default=auto]]]),
235  [with_lash=$enableval],
236  with_lash="yes")
237if test "$with_lash" = "yes"
238then
239  PKG_CHECK_MODULES(LASH,   lash-1.0 >= 0.5.0,   HAVE_LASH=1, HAVE_LASH=0)
240  if test "${HAVE_LASH}" = "1"; then
241    AC_DEFINE(HAVE_LASH,1,[Define to enable lash support])
242  fi
243fi
244 
245dnl Enable unit tests
246AC_ARG_ENABLE(testprogs,
247  AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=yes]]]),
248  [with_testprogs=$enableval],
249  with_testprogs="yes")
250AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
251
252AC_SUBST(AUBIO_CFLAGS)
253AC_SUBST(AUBIO_LIBS)
254
255dnl Check for swig and python
256dnl should check for swig version and python headers
257AC_PATH_PROG(SWIG,swig,no)
258AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no")
259AM_PATH_PYTHON
260AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no")
261
262dnl Check for docbook-to-man
263AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
264AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
265
266dnl Create Makefiles
267AC_OUTPUT([
268    Makefile
269    src/Makefile
270    examples/Makefile
271    tests/Makefile
272    tests/src/Makefile
273    sounds/Makefile
274    swig/Makefile
275    python/Makefile
276    python/aubio/Makefile
277    doc/Makefile
278  ])
279
280dnl Print summary
281echo
282echo "**************************************************************"
283echo "Summary:"
284if test "${HAVE_FFTW3F}" = "1"; then
285  echo "FFT:                     using fftw3f"
286else
287if test "${HAVE_FFTW3}" = "1"; then
288  echo "Fft:                     using fftw3"
289else
290  echo "Fft:                     using ooura"
291fi
292fi
293if test "${HAVE_SNDFILE}" = "1"; then
294  echo "Libsndfile:              yes"
295else
296  echo "Libsndfile:              no"
297fi
298if test "${HAVE_SAMPLERATE}" = "1"; then
299  echo "Libsamplerate:           yes"
300else
301  echo "Libsamplerate:           no"
302fi
303if test "${HAVE_JACK}" = "1"; then
304  echo "JACK:                    yes"
305else
306  echo "JACK:                    no"
307fi
308if test "${HAVE_LASH}" = "1"; then
309  echo "Lash:                    yes"
310else
311  echo "Lash:                    no"
312fi
313echo "**************************************************************"
314echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
Note: See TracBrowser for help on using the repository browser.