source: configure.ac @ 73883af

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

use -Wextra but unused parameters, fix macos CFLAGS
use -Wextra but unused parameters, fix macos CFLAGS

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