source: configure.ac @ e3db73f

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

make configure.ac more readable
make configure.ac more readable

  • Property mode set to 100644
File size: 7.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
13LIBAUBIO_LT_CURRENT=2
14LIBAUBIO_LT_REVISION=0
15LIBAUBIO_LT_AGE=0
16SHARED_VERSION_INFO="$LIBAUBIO_LT_CURRENT:$LIBAUBIO_LT_REVISION:$LIBAUBIO_LT_AGE"
17AC_SUBST(SHARED_VERSION_INFO)
18
19dnl Init automake
20AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
21
22dnl Maintainer mode
23AM_MAINTAINER_MODE
24
25dnl Guess the host
26AC_CANONICAL_HOST
27
28dnl Default optimization
29CFLAGS="$CFLAGS -O2"
30
31dnl Enable debugging (no)
32AC_ARG_ENABLE(debug,
33  [  --enable-debug[[=value]]   compile with debug [[default=no]]],
34  with_debug="yes",
35  with_debug="no")
36if test "$with_debug" = "yes"
37then
38  AC_DEFINE(DEBUG,1,[Define to enable debug])
39  CFLAGS="$CFLAGS -g"
40fi
41
42dnl Enable full warnings (yes)
43AC_ARG_ENABLE(warnme,
44  [  --enable-warnme[[=value]]   compile with all -W [[default=yes]]],
45  with_warnme="no",
46  with_warnme="yes")
47if test "$with_warnme" = "yes"
48then
49  CFLAGS="$CFLAGS -Wall -Wextra -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter"
50fi
51
52dnl Check for programs
53AC_PROG_CC
54if test "$ac_cv_prog_cc" = "no" ; then
55   AC_MSG_ERROR([*** No C compiler found !])
56fi
57AC_PROG_INSTALL
58
59dnl Check for libtool
60AC_LIBTOOL_DLOPEN
61dnl AC_DISABLE_STATIC
62AC_PROG_LIBTOOL
63
64AC_CONFIG_HEADERS(src/config.h)
65AC_CONFIG_FILES(aubio.pc)
66
67case "${host_os}" in
68*mingw*)
69  mingw32_support="yes"
70  AC_CHECK_HEADER(windows.h)
71  ;;
72*darwin*)
73  dnl on macosx, cosf went to -lmx
74  LDFLAGS="$LDFLAGS -lmx"
75  dnl as long double doesn't sit well with -Wall -Werror
76  CFLAGS="$CFLAGS -Wno-long-double"
77  AC_ISC_POSIX
78  ;;
79*)
80  AC_ISC_POSIX
81  ;;
82esac
83
84dnl Check for required libraries
85AC_CHECK_LIB(pthread, pthread_create)
86
87dnl Check for header files
88AC_HEADER_STDC
89AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h errno.h stdarg.h unistd.h signal.h],,)
90AC_CHECK_HEADERS(complex.h,,AC_MSG_ERROR([Ouch! missing complex.h header]))
91AC_CHECK_HEADERS(fftw3.h  ,,AC_MSG_ERROR([Ouch! missing fftw3.h header]))
92
93dnl Check for __VAR_ARGS__ support
94AC_CACHE_CHECK(for C99 __VA_ARGS__ macro,
95    ac_cv_varargs_macros,
96AC_TRY_COMPILE([
97  #include <stdio.h>
98  #define AUBIO_ERR(...)                       fprintf(stderr, __VA_ARGS__)
99],
100[
101  AUBIO_ERR("%s\n", "ERR");
102],
103        ac_cv_varargs_macros=yes,
104        ac_cv_varargs_macros=no)
105)
106if test "$ac_cv_varargs_macros" = "yes"; then
107    AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
108            [Defined when c99 style varargs macros are supported])
109fi
110
111dnl Check for pkg-config
112AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
113
114PKG_CHECK_MODULES(SNDLIB,     sndfile >= 1.0.4,       SNDLIB_SUPPORT=1)
115PKG_CHECK_MODULES(SAMPLERATE, samplerate  >= 0.0.15,  SAMPLERATE_SUPPORT=1)
116
117if test "${SNDLIB_SUPPORT}" = "1"; then
118  AC_DEFINE(SNDLIB_SUPPORT,1,[Define to enable libsndfile support])
119fi
120
121dnl Check for fftw3 (required)
122AC_ARG_ENABLE(fftw3f,
123  AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
124  [with_fftw3f=$enableval],
125  with_fftw3f="yes")
126if test "$with_fftw3f" = "yes"; then
127  PKG_CHECK_MODULES(FFTWLIB,    fftw3f >= 3.0.0,     FFTW3F_SUPPORT=1, FFTW3F_SUPPORT=0)
128else
129  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     FFTW3_SUPPORT=1)
130fi
131if test "${FFTW3F_SUPPORT}" = "0"; then
132  PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,     FFTW3_SUPPORT=1)
133fi
134if test "${FFTW3_SUPPORT}" = "1"; then
135  AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support])
136fi
137if test "${FFTW3F_SUPPORT}" = "1"; then
138  AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support])
139fi
140
141dnl Enable jack support (auto)
142AC_ARG_ENABLE(jack,
143  AC_HELP_STRING([--enable-jack],[compile with jack [[default=auto]]]),
144  [with_jack=$enableval],
145  with_jack="yes")
146if test "$with_jack" = "yes"
147then
148  PKG_CHECK_MODULES(JACK,       jack  >= 0.15.0,     JACK_SUPPORT=1, JACK_SUPPORT=0)
149  if test "${JACK_SUPPORT}" = "1"; then
150    AC_DEFINE(JACK_SUPPORT,1,[Define to enable jack support])
151  fi
152fi
153
154dnl Enable alsa support (auto)
155AC_ARG_ENABLE(alsa,
156  AC_HELP_STRING([--enable-alsa],[compile with alsa [[default=auto]]]),
157  [with_alsa=$enableval],
158  with_alsa="yes")
159if test "$with_alsa" = "yes"
160then
161  if test "$with_jack" = "yes"
162  then
163    PKG_CHECK_MODULES(ALSA,      alsa >= 0.0.9,      ALSA_SUPPORT=1, ALSA_SUPPORT=0)
164    if test "${ALSA_SUPPORT}" = "1"; then
165      AC_DEFINE(ALSA_SUPPORT,1,[Define to enable alsa support])
166    fi
167  else
168    AC_MSG_WARN([Disabling alsa as jack was not found])
169  fi
170fi
171
172dnl Enable ladcca support (obsolete)
173AC_ARG_ENABLE(ladcca,
174  AC_HELP_STRING([--enable-ladcca],[compile with ladcca [[default=no]]]),
175  [with_ladcca=$enableval],
176  with_ladcca="no")
177if test "$with_ladcca" = "yes"
178then
179  PKG_CHECK_MODULES(LADCCA,   ladcca-1.0 >= 0.4.0,   LADCCA_SUPPORT=1)
180  if test "${LADCCA_SUPPORT}" = "1"; then
181    AC_DEFINE(LADCCA_SUPPORT,1,[Define to enable ladcca support])
182  fi
183fi
184 
185dnl Enable unit tests
186AC_ARG_ENABLE(testprogs,
187  AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=no]]]),
188  [with_testprogs=$enableval],
189  with_testprogs="no")
190AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
191
192dnl Check for swig and python
193dnl should check for swig version and python headers
194AC_PATH_PROG(SWIG,swig,no)
195AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no")
196AM_PATH_PYTHON
197AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no")
198#
199#if PYTHONFOUND
200case "${host_os}" in
201*darwin*)
202  SWCFLAGS="-Wno-long-double"
203  SWLDFLAGS="-bundle -framework python -L${prefix}/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
204  ;;
205*)
206  SWLDFLAGS="-shared"
207  ;;
208esac
209#
210AC_SUBST(SWCFLAGS)
211AC_SUBST(SWLDFLAGS)
212
213dnl Check for docbook-to-man
214AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
215AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
216
217dnl Check for Puredata
218AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
219AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
220
221dnl Create Makefiles
222AC_OUTPUT([
223    Makefile
224    src/Makefile
225    ext/Makefile
226    examples/Makefile
227    examples/tests/Makefile
228    sounds/Makefile
229    swig/Makefile
230    python/Makefile
231    python/aubio/Makefile
232    plugins/Makefile
233    plugins/audacity/Makefile
234    plugins/audacity/plug-ins/Makefile
235    plugins/wavesurfer/Makefile
236    plugins/puredata/Makefile
237    doc/Makefile
238  ])
239
240dnl Print summary
241echo
242echo "**************************************************************"
243echo "Summary:"
244if test "${FFTW3F_SUPPORT}" = "1"; then
245  echo "Fftw3:                   yes (using fftw3f)"
246else
247if test "${FFTW3_SUPPORT}" = "1"; then
248  echo "Fftw3:                   yes (not using fftw3f)"
249else
250  echo "Fftw3:                   no (that should not happen)"
251fi
252fi
253if test "${SNDLIB_SUPPORT}" = "1"; then
254  echo "Libsndfile:              yes"
255else
256  echo "Libsndfile:              no"
257fi
258if test "${SAMPLERATE_SUPPORT}" = "1"; then
259  echo "Libsamplerate:           yes"
260else
261  echo "Libsamplerate:           no"
262fi
263if test "${JACK_SUPPORT}" = "1"; then
264  echo "JACK:                    yes"
265else
266  echo "JACK:                    no"
267fi
268if test "${ALSA_SUPPORT}" = "1"; then
269  echo "ALSA midi:               yes"
270else
271  echo "ALSA midi:               no"
272fi
273if test "${LADCCA_SUPPORT}" = "1"; then
274  echo "Ladcca:                  yes"
275fi
276echo "**************************************************************"
277echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
Note: See TracBrowser for help on using the repository browser.