source: configure.ac @ 4db0752

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 4db0752 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
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
[4db0752]6AC_CONFIG_MACRO_DIR([m4])
7
[16109b3]8dnl Package name and version
9PACKAGE=aubio
[96fb8ad]10. $srcdir/VERSION
11AUBIO_VERSION=${AUBIO_MAJOR_VERSION}.${AUBIO_MINOR_VERSION}.${AUBIO_PATCH_VERSION}${AUBIO_VERSION_STATUS}
12VERSION=${AUBIO_VERSION}
13
[16109b3]14dnl Shared library version
[5274ee6]15SHARED_VERSION_INFO=${LIBAUBIO_LT_CUR}:${LIBAUBIO_LT_REV}:${LIBAUBIO_LT_AGE}
[9fc2c7e]16AC_SUBST(SHARED_VERSION_INFO)
17
[16109b3]18dnl Init automake
[96fb8ad]19AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
[16109b3]20
[e24b5f3]21dnl Enable silent rules, use with make V=0
[18738ad]22dnl AM_SILENT_RULES
[e24b5f3]23
[16109b3]24dnl Maintainer mode
[5215c01]25AM_MAINTAINER_MODE
[96fb8ad]26
[16109b3]27dnl Guess the host
28AC_CANONICAL_HOST
[96fb8ad]29
[ee0a1f3]30dnl Check for programs
31AC_PROG_CC
[00c522b]32AM_PROG_CC_C_O dnl compiling with per-target flag
[ee0a1f3]33if test "$ac_cv_prog_cc" = "no" ; then
34   AC_MSG_ERROR([*** No C compiler found !])
35fi
36AC_PROG_INSTALL
37
[17db1cd]38AUBIO_CFLAGS=
39
[5ddcdf2]40AC_CHECK_LIB(m, floorf)
41AUBIO_LIBS="-lm"
42
[66760af]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
[16109b3]53dnl Enable debugging (no)
[96fb8ad]54AC_ARG_ENABLE(debug,
[ec0d43c]55  AC_HELP_STRING([--enable-debug],[compile in debug mode [[default=no]]]),
[96fb8ad]56  with_debug="yes",
57  with_debug="no")
58if test "$with_debug" = "yes"
59then
60  AC_DEFINE(DEBUG,1,[Define to enable debug])
[098bd92]61  AUBIO_CFLAGS="$AUBIO_CFLAGS -g"
[96fb8ad]62fi
63
[16109b3]64dnl Enable full warnings (yes)
[f43867f]65AC_ARG_ENABLE(warnings,
[ec0d43c]66  AC_HELP_STRING([--enable-warnings],[compile with all gcc warnings [[default=yes]]]),
[96fb8ad]67  with_warnme="no",
68  with_warnme="yes")
69if test "$with_warnme" = "yes"
70then
[ee0a1f3]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)
[17db1cd]77  CFLAGS="$old_CFLAGS"
[ee0a1f3]78  ])
79  if test "$ac_cv_cc_wextra" = "yes"
80  then
[17db1cd]81    AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall -Wextra"
[ee0a1f3]82  else
[17db1cd]83    AUBIO_CFLAGS="$AUBIO_CFLAGS -Wall"
[ee0a1f3]84  fi
[96fb8ad]85fi
86
[ec0d43c]87dnl fail on compilation warnings
[f43867f]88AC_ARG_ENABLE(errorfail,
[ec0d43c]89  AC_HELP_STRING([--enable-errorfail],[fail on compilation warnings [[default=no]]]),
[f43867f]90  AUBIO_CFLAGS="$AUBIO_CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter",
[ec0d43c]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")
[96fb8ad]98
99dnl Check for libtool
100AC_LIBTOOL_DLOPEN
101dnl AC_DISABLE_STATIC
[fce58d9e]102dnl allow cross compiling
103AC_LIBTOOL_WIN32_DLL
[96fb8ad]104AC_PROG_LIBTOOL
105
106AC_CONFIG_HEADERS(src/config.h)
107AC_CONFIG_FILES(aubio.pc)
108
[be929a5]109AM_CONDITIONAL(MINGW, false)
110AM_CONDITIONAL(DARWIN, false)
[651cac8]111case "${host}" in
[cbea730]112*mingw* | *cygwin*)
[96fb8ad]113  mingw32_support="yes"
114  AC_CHECK_HEADER(windows.h)
[be929a5]115  AM_CONDITIONAL(MINGW, true)
[cbea730]116  LDFLAGS="$LDFLAGS -no-undefined"
[96fb8ad]117  ;;
[cbea730]118*darwin* | *rhapsody* | *macosx*)
[d17f63e]119  AC_ISC_POSIX
[be929a5]120  AM_CONDITIONAL(DARWIN, true)
[d17f63e]121  ;;
[96fb8ad]122*)
123  AC_ISC_POSIX
124  ;;
125esac
126
[3050cb8]127dnl Check for required libraries
[96fb8ad]128AC_CHECK_LIB(pthread, pthread_create)
129
130dnl Check for header files
[10a5413]131AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h limits.h errno.h stdarg.h unistd.h signal.h],,)
[237f632]132AC_ARG_ENABLE(complex,
133  AC_HELP_STRING([--enable-complex],[compile with complex.h [[default=auto]]]),
134  [with_complex=$enableval],
[62b8ab2]135  with_complex="no")
[237f632]136if test "$with_complex" = "yes"; then
137  AC_CHECK_HEADERS(complex.h,,AC_MSG_WARN([Ouch! missing complex.h header]))
138fi
[96fb8ad]139
[16109b3]140dnl Check for __VAR_ARGS__ support
[5215c01]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
[9906b3f]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
[588ee77]167fi
[96fb8ad]168
[588ee77]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
[740f06b]175  PKG_CHECK_MODULES(SAMPLERATE, samplerate  >= 0.0.15,  HAVE_SAMPLERATE=1,
176                    HAVE_SAMPLERATE=0)
[588ee77]177  if test "${HAVE_SAMPLERATE}" = "1"; then
178    AC_DEFINE(HAVE_SAMPLERATE,1,[Define to enable libsamplerate support])
179  fi
[96fb8ad]180fi
181
[16109b3]182dnl Check for fftw3 (required)
[240e416]183dnl if we compile in double precsion, default to fftw3, else fftw3f
[729a3c0]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
[240e416]190if test "$with_double_precision" = "yes"; then
191    default_fftw3f="no"
192else
[729a3c0]193    default_fftw3f=$with_fftw3
[240e416]194fi
[729a3c0]195
[96fb8ad]196AC_ARG_ENABLE(fftw3f,
[dc27a81]197  AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
198  [with_fftw3f=$enableval],
[240e416]199  [with_fftw3f=$default_fftw3f])
[729a3c0]200
201# check if we have fftw3f
[96fb8ad]202if test "$with_fftw3f" = "yes"; then
[b511fa9]203  PKG_CHECK_MODULES(FFTWLIB,    fftw3f >= 3.0.0,     HAVE_FFTW3F=1, HAVE_FFTW3F=0)
[e50b695]204else
[729a3c0]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)
[dc27a81]208fi
[e50b695]209fi
[729a3c0]210
[b511fa9]211if test "${HAVE_FFTW3}" = "1"; then
212  AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support])
[96fb8ad]213fi
[b511fa9]214if test "${HAVE_FFTW3F}" = "1"; then
[729a3c0]215  AC_DEFINE(HAVE_FFTW3,1,[Define to enable fftw3 support])
[b511fa9]216  AC_DEFINE(HAVE_FFTW3F,1,[Define to enable fftw3f support])
[96fb8ad]217fi
218
[16109b3]219dnl Enable jack support (auto)
[96fb8ad]220AC_ARG_ENABLE(jack,
[dc27a81]221  AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]),
222  [with_jack=$enableval],
223  with_jack="yes")
[96fb8ad]224if test "$with_jack" = "yes"
225then
[b511fa9]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])
[16109b3]229  fi
[96fb8ad]230fi
231
[a814968]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"
[96fb8ad]238then
[b511fa9]239  PKG_CHECK_MODULES(LASH,   lash-1.0 >= 0.5.0,   HAVE_LASH=1, HAVE_LASH=0)
240  if test "${HAVE_LASH}" = "1"; then
[883deec]241    AC_DEFINE(HAVE_LASH,1,[Define to enable lash support])
[16109b3]242  fi
[96fb8ad]243fi
244 
[16109b3]245dnl Enable unit tests
[5215c01]246AC_ARG_ENABLE(testprogs,
[4db0752]247  AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=yes]]]),
[5215c01]248  [with_testprogs=$enableval],
[4db0752]249  with_testprogs="yes")
[5215c01]250AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
251
[5a405dd]252AC_SUBST(AUBIO_CFLAGS)
[5ddcdf2]253AC_SUBST(AUBIO_LIBS)
[5a405dd]254
[16109b3]255dnl Check for swig and python
[3050cb8]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")
[d09cad2]261
[16109b3]262dnl Check for docbook-to-man
[3050cb8]263AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
264AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
265
[16109b3]266dnl Create Makefiles
[96fb8ad]267AC_OUTPUT([
[16109b3]268    Makefile
269    src/Makefile
270    examples/Makefile
[de2a8af]271    tests/Makefile
272    tests/src/Makefile
[16109b3]273    sounds/Makefile
274    swig/Makefile
275    python/Makefile
276    python/aubio/Makefile
277    doc/Makefile
278  ])
279
280dnl Print summary
[96fb8ad]281echo
282echo "**************************************************************"
283echo "Summary:"
[b511fa9]284if test "${HAVE_FFTW3F}" = "1"; then
[729a3c0]285  echo "FFT:                     using fftw3f"
[96fb8ad]286else
[b511fa9]287if test "${HAVE_FFTW3}" = "1"; then
[729a3c0]288  echo "Fft:                     using fftw3"
[96fb8ad]289else
[729a3c0]290  echo "Fft:                     using ooura"
[96fb8ad]291fi
292fi
[588ee77]293if test "${HAVE_SNDFILE}" = "1"; then
[96fb8ad]294  echo "Libsndfile:              yes"
295else
296  echo "Libsndfile:              no"
297fi
[b511fa9]298if test "${HAVE_SAMPLERATE}" = "1"; then
[96fb8ad]299  echo "Libsamplerate:           yes"
300else
301  echo "Libsamplerate:           no"
302fi
[b511fa9]303if test "${HAVE_JACK}" = "1"; then
[96fb8ad]304  echo "JACK:                    yes"
305else
306  echo "JACK:                    no"
307fi
[b511fa9]308if test "${HAVE_LASH}" = "1"; then
[a814968]309  echo "Lash:                    yes"
310else
311  echo "Lash:                    no"
312fi
[96fb8ad]313echo "**************************************************************"
314echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
Note: See TracBrowser for help on using the repository browser.