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