cleaner clean
[aubio.git] / configure.ac
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         
18 dnl Check for debug
19 AC_ARG_ENABLE(debug,
20   [  --enable-debug[[=value]]   compile with debug [[default=no]]],
21   with_debug="yes",
22   with_debug="no")
23 if test "$with_debug" = "yes"
24 then
25   AC_DEFINE(DEBUG,1,[Define to enable debug])
26   CFLAGS="$CFLAGS -g"
27 fi
28
29 dnl
30 AC_ARG_ENABLE(warnme,
31   [  --enable-warnme[[=value]]   compile with all -W [[default=yes]]],
32   with_warnme="no",
33   with_warnme="yes")
34 if test "$with_warnme" = "yes"
35 then
36         ALL_CWARNINGS="-Wall -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-char-subscripts -Wno-unknown-pragmas"
37         CFLAGS="$CFLAGS $ALL_CWARNINGS"
38 fi
39
40
41 dnl Guess the host
42 AC_CANONICAL_HOST
43
44 dnl Check for programs
45 AC_PROG_CC
46 if test "$ac_cv_prog_cc" = "no" ; then
47    AC_MSG_ERROR([*** No C compiler found !])
48 fi
49 AC_PROG_INSTALL
50 dnl AC_PROG_SWIG
51
52 dnl Check for libtool
53 AC_LIBTOOL_DLOPEN
54 dnl AC_DISABLE_STATIC
55 AC_PROG_LIBTOOL
56
57 AC_CONFIG_HEADERS(src/config.h)
58 AC_CONFIG_FILES(aubio.pc)
59
60 case "${host_os}" in
61 mingw*)
62   mingw32_support="yes"
63   AC_CHECK_HEADER(windows.h)
64   ;;
65 darwin*)
66   dnl on macosx, cosf went to -lmx
67   LDFLAGS="$LDFLAGS -lmx"
68   AC_ISC_POSIX
69   ;;
70 *)
71   AC_ISC_POSIX
72   ;;
73 esac
74
75 dnl Check for 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 dnl Check for required libraries
88 PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,        FFTW3_SUPPORT=1)
89 if test "${FFTW3_SUPPORT}" = "1"; then
90   AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support])
91 fi
92 PKG_CHECK_MODULES(SNDLIB,     sndfile >= 1.0.4,       SNDLIB_SUPPORT=1)
93 PKG_CHECK_MODULES(SAMPLERATE, samplerate  >= 0.0.15,  SAMPLERATE_SUPPORT=1)
94
95 if test "${SNDLIB_SUPPORT}" = "1"; then
96   AC_DEFINE(SNDLIB_SUPPORT,1,[Define to enable libsndfile support])
97 fi
98
99
100 dnl Check for optional libraries
101 AC_ARG_ENABLE(fftw3f,
102   [  --enable-fftw3f[[=value]]   compile with fftw3f [[default=no]]],
103   with_fftw3f="yes",
104   with_fftw3f="no")
105 if test "$with_fftw3f" = "yes"; then
106         PKG_CHECK_MODULES(FFTWLIB,    fftw3f  >= 3.0.0,     FFTW3F_SUPPORT=1)
107 fi
108 if test "${FFTW3F_SUPPORT}" = "1"; then
109   AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support])
110 fi
111
112 AC_ARG_ENABLE(jack,
113   [  --enable-jack[[=value]]   compile with jack [[default=no]]],
114   with_jack="yes",
115   with_jack="no")
116 if test "$with_jack" = "yes"
117 then
118         PKG_CHECK_MODULES(JACK,       jack  >= 0.15.0,        JACK_SUPPORT=1)
119         if test "${JACK_SUPPORT}" = "1"; then
120           AC_DEFINE(JACK_SUPPORT,1,[Define to enable jack support])
121         fi
122 fi
123
124 AC_ARG_ENABLE(alsa,
125   [  --enable-alsa[[=value]]   compile with alsa [[default=no]]],
126   with_alsa="yes",
127   with_alsa="no")
128 if test "$with_alsa" = "yes"
129 then
130         PKG_CHECK_MODULES(ALSA,       alsa >= 0.0.9,          ALSA_SUPPORT=1)
131         if test "${ALSA_SUPPORT}" = "1"; then
132           AC_DEFINE(ALSA_SUPPORT,1,[Define to enable alsa support])
133         fi
134 fi
135
136 AC_ARG_ENABLE(ladcca,
137   [  --enable-ladcca[[=value]]   compile with ladcca [[default=no]]],
138   with_ladcca="yes",
139   with_ladcca="no")
140 if test "$with_ladcca" = "yes"
141 then
142         PKG_CHECK_MODULES(LADCCA,       ladcca-1.0 >= 0.4.0,          LADCCA_SUPPORT=1)
143         if test "${LADCCA_SUPPORT}" = "1"; then
144           AC_DEFINE(LADCCA_SUPPORT,1,[Define to enable ladcca support])
145         fi
146 fi
147   
148 AM_PATH_PYTHON(,,)
149
150 AC_OUTPUT([
151                 Makefile
152                 src/Makefile
153                 examples/Makefile
154                 sounds/Makefile
155                 doc/Makefile
156                 python/Makefile
157                 python/aubio/Makefile
158                 plugins/Makefile
159                 plugins/audacity/Makefile
160                 plugins/audacity/plug-ins/Makefile
161                 plugins/wavesurfer/Makefile
162                 swig/Makefile
163         ])
164
165 echo
166 echo "**************************************************************"
167 echo "Summary:"
168 if test "${FFTW3F_SUPPORT}" = "1"; then
169   echo "Fftw3:                   yes (fftw3f)"
170 else
171 if test "${FFTW3_SUPPORT}" = "1"; then
172   echo "Fftw3:                   yes"
173 else
174   echo "Fftw3f:                  no"
175 fi
176 fi
177 if test "${SNDLIB_SUPPORT}" = "1"; then
178   echo "Libsndfile:              yes"
179 else
180   echo "Libsndfile:              no"
181 fi
182 if test "${SAMPLERATE_SUPPORT}" = "1"; then
183   echo "Libsamplerate:           yes"
184 else
185   echo "Libsamplerate:           no"
186 fi
187 if test "${JACK_SUPPORT}" = "1"; then
188   echo "JACK:                    yes"
189 else
190   echo "JACK:                    no"
191 fi
192 if test "${ALSA_SUPPORT}" = "1"; then
193   echo "ALSA midi:               yes"
194 else
195   echo "ALSA midi:               no"
196 fi
197 if test "${LADCCA_SUPPORT}" = "1"; then
198   echo "Ladcca:                  yes"
199 else
200   echo "Ladcca:                  no"
201 fi
202 echo "**************************************************************"
203 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}