source: configure.ac @ 2b4d006

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

configure.ac: do not check for fftw3.h, let pkg-config do that

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