ef15064226fddf3a91ec62bb23bf0d1e839a74d3
[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 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 dnl AC_PROG_SWIG
50
51 dnl Check for libtool
52 AC_LIBTOOL_DLOPEN
53 dnl AC_DISABLE_STATIC
54 AC_PROG_LIBTOOL
55
56 AC_CONFIG_HEADERS(src/config.h)
57 AC_CONFIG_FILES(aubio.pc)
58
59 case "${host_os}" in
60 mingw*)
61   mingw32_support="yes"
62   AC_CHECK_HEADER(windows.h)
63   ;;
64 *)
65   AC_ISC_POSIX
66   ;;
67 esac
68
69 dnl Check for libraries
70 AC_CHECK_LIB(pthread, pthread_create)
71
72 dnl Check for header files
73 AC_HEADER_STDC
74 AC_CHECK_HEADERS([string.h stdlib.h stdio.h math.h errno.h stdarg.h unistd.h signal.h],,)
75 AC_CHECK_HEADERS(complex.h,,AC_MSG_ERROR([Ouch! missing complex.h header]))
76 AC_CHECK_HEADERS(fftw3.h  ,,AC_MSG_ERROR([Ouch! missing fftw3.h headeri]))
77
78 dnl check for pkg-config
79 AC_PATH_PROG(PKG_CONFIG,pkg-config,no)
80
81 dnl Check for required libraries
82 PKG_CHECK_MODULES(FFTWLIB,    fftw3  >= 3.0.0,        FFTW3_SUPPORT=1)
83 if test "${FFTW3_SUPPORT}" = "1"; then
84   AC_DEFINE(FFTW3_SUPPORT,1,[Define to enable fftw3 support])
85 fi
86 PKG_CHECK_MODULES(SNDLIB,     sndfile >= 1.0.4,       SNDLIB_SUPPORT=1)
87 PKG_CHECK_MODULES(SAMPLERATE, samplerate  >= 0.0.15,  SAMPLERATE_SUPPORT=1)
88
89 if test "${SNDLIB_SUPPORT}" = "1"; then
90   AC_DEFINE(SNDLIB_SUPPORT,1,[Define to enable libsndfile support])
91 fi
92
93
94 dnl Check for optional libraries
95 AC_ARG_ENABLE(fftw3f,
96   [  --enable-fftw3f[[=value]]   compile with fftw3f [[default=no]]],
97   with_fftw3f="yes",
98   with_fftw3f="no")
99 if test "$with_fftw3f" = "yes"; then
100         PKG_CHECK_MODULES(FFTWLIB,    fftw3f  >= 3.0.0,     FFTW3F_SUPPORT=1)
101 fi
102 if test "${FFTW3F_SUPPORT}" = "1"; then
103   AC_DEFINE(FFTW3F_SUPPORT,1,[Define to enable fftw3f support])
104 fi
105
106 AC_ARG_ENABLE(jack,
107   [  --enable-jack[[=value]]   compile with jack [[default=no]]],
108   with_jack="yes",
109   with_jack="no")
110 if test "$with_jack" = "yes"
111 then
112         PKG_CHECK_MODULES(JACK,       jack  >= 0.15.0,        JACK_SUPPORT=1)
113         if test "${JACK_SUPPORT}" = "1"; then
114           AC_DEFINE(JACK_SUPPORT,1,[Define to enable jack support])
115         fi
116 fi
117
118 AC_ARG_ENABLE(alsa,
119   [  --enable-alsa[[=value]]   compile with alsa [[default=no]]],
120   with_alsa="yes",
121   with_alsa="no")
122 if test "$with_alsa" = "yes"
123 then
124         PKG_CHECK_MODULES(ALSA,       alsa >= 0.0.9,          ALSA_SUPPORT=1)
125         if test "${ALSA_SUPPORT}" = "1"; then
126           AC_DEFINE(ALSA_SUPPORT,1,[Define to enable alsa support])
127         fi
128 fi
129
130 AC_ARG_ENABLE(ladcca,
131   [  --enable-ladcca[[=value]]   compile with ladcca [[default=no]]],
132   with_ladcca="yes",
133   with_ladcca="no")
134 if test "$with_ladcca" = "yes"
135 then
136         PKG_CHECK_MODULES(LADCCA,       ladcca-1.0 >= 0.4.0,          LADCCA_SUPPORT=1)
137         if test "${LADCCA_SUPPORT}" = "1"; then
138           AC_DEFINE(LADCCA_SUPPORT,1,[Define to enable ladcca support])
139         fi
140 fi
141   
142 AM_PATH_PYTHON(,,)
143
144 AC_OUTPUT([
145                 Makefile
146                 src/Makefile
147                 examples/Makefile
148                 sounds/Makefile
149                 doc/Makefile
150                 python/Makefile
151                 python/aubio/Makefile
152                 plugins/Makefile
153                 plugins/audacity/Makefile
154                 plugins/audacity/plug-ins/Makefile
155                 plugins/wavesurfer/Makefile
156                 swig/Makefile
157         ])
158
159 echo
160 echo "**************************************************************"
161 echo "Summary:"
162 if test "${FFTW3F_SUPPORT}" = "1"; then
163   echo "Fftw3:                   yes (fftw3f)"
164 else
165 if test "${FFTW3_SUPPORT}" = "1"; then
166   echo "Fftw3:                   yes"
167 else
168   echo "Fftw3f:                  no"
169 fi
170 fi
171 if test "${SNDLIB_SUPPORT}" = "1"; then
172   echo "Libsndfile:              yes"
173 else
174   echo "Libsndfile:              no"
175 fi
176 if test "${SAMPLERATE_SUPPORT}" = "1"; then
177   echo "Libsamplerate:           yes"
178 else
179   echo "Libsamplerate:           no"
180 fi
181 if test "${JACK_SUPPORT}" = "1"; then
182   echo "JACK:                    yes"
183 else
184   echo "JACK:                    no"
185 fi
186 if test "${ALSA_SUPPORT}" = "1"; then
187   echo "ALSA midi:               yes"
188 else
189   echo "ALSA midi:               no"
190 fi
191 if test "${LADCCA_SUPPORT}" = "1"; then
192   echo "Ladcca:                  yes"
193 else
194   echo "Ladcca:                  no"
195 fi
196 echo "**************************************************************"
197 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}