source: configure.ac @ 3ec9d9c

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

added FFTWLIB_CFLAGS to examples/Makefile.am, added host_os to configure.ac

  • Property mode set to 100644
File size: 7.2 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=1
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  ALL_CWARNINGS="-Wall -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-char-subscripts -Wno-unknown-pragmas"
45  CFLAGS="$CFLAGS $ALL_CWARNINGS"
46fi
47
48
49dnl Guess the host
50AC_CANONICAL_HOST
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="$CLFAGS -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 headeri]))
92
93AC_CACHE_CHECK(for C99 __VA_ARGS__ macro,
94    ac_cv_varargs_macros,
95AC_TRY_COMPILE([
96  #include <stdio.h>
97  #define AUBIO_ERR(...)                       fprintf(stderr, __VA_ARGS__)
98],
99[
100  AUBIO_ERR("%s\n", "ERR");
101],
102        ac_cv_varargs_macros=yes,
103        ac_cv_varargs_macros=no)
104)
105if test "$ac_cv_varargs_macros" = "yes"; then
106    AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
107            [Defined when c99 style varargs macros are supported])
108fi
109
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
121
122dnl Check for optional libraries
123AC_ARG_ENABLE(fftw3f,
124  AC_HELP_STRING([--enable-fftw3f],[compile with fftw3f [[default=auto]]]),
125  [with_fftw3f=$enableval],
126  with_fftw3f="yes")
127if test "$with_fftw3f" = "yes"; then
128        PKG_CHECK_MODULES(FFTWLIB,    fftw3f  >= 3.0.0,     FFTW3F_SUPPORT=1, FFTW3F_SUPPORT=0)
129else
130        PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,      FFTW3_SUPPORT=1)
131fi
132if test "${FFTW3F_SUPPORT}" = "0"; then
133        PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,      FFTW3_SUPPORT=1)
134fi
135if test "${FFTW3_SUPPORT}" = "1"; then
136  AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support])
137fi
138if test "${FFTW3F_SUPPORT}" = "1"; then
139  AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support])
140fi
141
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
154AC_ARG_ENABLE(alsa,
155  AC_HELP_STRING([--enable-alsa],[compile with alsa [[default=auto]]]),
156  [with_alsa=$enableval],
157  with_alsa="yes")
158if test "$with_alsa" = "yes"
159then
160        if test "$with_jack" = "yes"
161        then
162        PKG_CHECK_MODULES(ALSA,       alsa >= 0.0.9,          ALSA_SUPPORT=1, ALSA_SUPPORT=0)
163        if test "${ALSA_SUPPORT}" = "1"; then
164          AC_DEFINE(ALSA_SUPPORT,1,[Define to enable alsa support])
165        fi
166        else
167        AC_MSG_WARN([Disabling alsa as jack was not found])
168        fi
169fi
170
171AC_ARG_ENABLE(ladcca,
172  AC_HELP_STRING([--enable-ladcca],[compile with ladcca [[default=no]]]),
173  [with_ladcca=$enableval],
174  with_ladcca="no")
175if test "$with_ladcca" = "yes"
176then
177        PKG_CHECK_MODULES(LADCCA,       ladcca-1.0 >= 0.4.0,          LADCCA_SUPPORT=1)
178        if test "${LADCCA_SUPPORT}" = "1"; then
179          AC_DEFINE(LADCCA_SUPPORT,1,[Define to enable ladcca support])
180        fi
181fi
182 
183AC_ARG_ENABLE(testprogs,
184  AC_HELP_STRING([--enable-testprogs],[compile test programs [[default=no]]]),
185  [with_testprogs=$enableval],
186  with_testprogs="no")
187AM_CONDITIONAL(COMPILE_TESTS,test "${with_testprogs}" != "no")
188
189dnl Check for optional programs
190
191dnl should check for swig version and python headers
192AC_PATH_PROG(SWIG,swig,no)
193AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no")
194AM_PATH_PYTHON
195AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no")
196
197#if PYTHONFOUND
198case "${host_os}" in
199*darwin*)
200  SWCFLAGS="-Wno-long-double"
201  SWLDFLAGS="-bundle -framework python -L${prefix}/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
202  ;;
203*)
204  SWLDFLAGS="-shared"
205  ;;
206esac
207
208AC_SUBST(SWCFLAGS)
209AC_SUBST(SWLDFLAGS)
210
211AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
212AM_CONDITIONAL(DOCBOOKFOUND, test "${DOCBOOK_TO_MAN}" != "no")
213
214AC_CHECK_HEADER(m_pd.h,PUREDATA=y,AC_MSG_WARN([Puredata header not found.]))
215AM_CONDITIONAL(PUREDATAFOUND, test "${PUREDATA}" = "y")
216
217AC_OUTPUT([
218                Makefile
219                src/Makefile
220                ext/Makefile
221                examples/Makefile
222                examples/tests/Makefile
223                sounds/Makefile
224                swig/Makefile
225                python/Makefile
226                python/aubio/Makefile
227                plugins/Makefile
228                plugins/audacity/Makefile
229                plugins/audacity/plug-ins/Makefile
230                plugins/wavesurfer/Makefile
231                plugins/puredata/Makefile
232                doc/Makefile
233        ])
234
235echo
236echo "**************************************************************"
237echo "Summary:"
238if test "${FFTW3F_SUPPORT}" = "1"; then
239  echo "Fftw3:                   yes (using fftw3f)"
240else
241if test "${FFTW3_SUPPORT}" = "1"; then
242  echo "Fftw3:                   yes (not using fftw3f)"
243else
244  echo "Fftw3:                   no (that should not happen)"
245fi
246fi
247if test "${SNDLIB_SUPPORT}" = "1"; then
248  echo "Libsndfile:              yes"
249else
250  echo "Libsndfile:              no"
251fi
252if test "${SAMPLERATE_SUPPORT}" = "1"; then
253  echo "Libsamplerate:           yes"
254else
255  echo "Libsamplerate:           no"
256fi
257if test "${JACK_SUPPORT}" = "1"; then
258  echo "JACK:                    yes"
259else
260  echo "JACK:                    no"
261fi
262if test "${ALSA_SUPPORT}" = "1"; then
263  echo "ALSA midi:               yes"
264else
265  echo "ALSA midi:               no"
266fi
267if test "${LADCCA_SUPPORT}" = "1"; then
268  echo "Ladcca:                  yes"
269else
270  echo "Ladcca:                  no"
271fi
272echo "**************************************************************"
273echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
Note: See TracBrowser for help on using the repository browser.