source: configure.ac @ 9169c51

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 9169c51 was 5215c01, checked in by Paul Brossier <piem@altern.org>, 19 years ago

add c99 varargs checks, thanks to Mo DeJong?

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