| 1 |
dnl Process this file with autoconf to produce a configure script. |
|---|
| 2 |
|
|---|
| 3 |
dnl Require minimum autoconf version |
|---|
| 4 |
AC_PREREQ(2.50) |
|---|
| 5 |
|
|---|
| 6 |
AC_INIT([sweep],[0.9.3],[sweep-devel@lists.sourceforge.net], |
|---|
| 7 |
[sweep],[http://www.metadecks.org/software/sweep/]) |
|---|
| 8 |
|
|---|
| 9 |
AC_CONFIG_HEADERS([config.h]) |
|---|
| 10 |
AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION) |
|---|
| 11 |
|
|---|
| 12 |
AC_ISC_POSIX |
|---|
| 13 |
AC_PROG_CC |
|---|
| 14 |
AM_PROG_CC_STDC |
|---|
| 15 |
AC_HEADER_STDC |
|---|
| 16 |
AM_PROG_LIBTOOL |
|---|
| 17 |
AM_PROG_CC_C_O |
|---|
| 18 |
|
|---|
| 19 |
AC_CHECK_PROG(HAVE_GNOME_MOZ_REMOTE, 'gnome-moz-remote', yes, no) |
|---|
| 20 |
|
|---|
| 21 |
AC_C_BIGENDIAN |
|---|
| 22 |
|
|---|
| 23 |
AC_CHECK_FUNCS(strchr) |
|---|
| 24 |
AC_CHECK_FUNCS(madvise) |
|---|
| 25 |
|
|---|
| 26 |
ALL_LINGUAS="de el es_ES fr hu it ja pl ru en_AU" |
|---|
| 27 |
AM_GNU_GETTEXT |
|---|
| 28 |
|
|---|
| 29 |
dnl Overall configuration success flag |
|---|
| 30 |
sweep_config_ok=yes |
|---|
| 31 |
|
|---|
| 32 |
dnl Default audio handling to build in |
|---|
| 33 |
sweep_config_driver="" |
|---|
| 34 |
|
|---|
| 35 |
dnl |
|---|
| 36 |
dnl Configuration option for building of experimental code. |
|---|
| 37 |
dnl |
|---|
| 38 |
|
|---|
| 39 |
ac_enable_experimental=no |
|---|
| 40 |
AC_ARG_ENABLE(experimental, |
|---|
| 41 |
[ --enable-experimental enable building of experimental code ], |
|---|
| 42 |
[ ac_enable_experimental=yes ]) |
|---|
| 43 |
|
|---|
| 44 |
if test "x${ac_enable_experimental}" = xyes ; then |
|---|
| 45 |
AC_DEFINE([DEVEL_CODE], [], [Whether to build the develpment code.]) |
|---|
| 46 |
fi |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
dnl |
|---|
| 50 |
dnl Detect pthreads libraries |
|---|
| 51 |
dnl |
|---|
| 52 |
|
|---|
| 53 |
PTHREAD_LIBS=error |
|---|
| 54 |
AC_CHECK_LIB(pthread, pthread_attr_init, PTHREAD_LIBS="-lpthread") |
|---|
| 55 |
if test "x$PTHREAD_LIBS" = xerror; then |
|---|
| 56 |
AC_CHECK_LIB(pthreads, pthread_attr_init, PTHREAD_LIBS="-lpthreads") |
|---|
| 57 |
fi |
|---|
| 58 |
if test "x$PTHREAD_LIBS" = xerror; then |
|---|
| 59 |
AC_CHECK_LIB(c_r, pthread_attr_init, PTHREAD_LIBS="-lc_r") |
|---|
| 60 |
fi |
|---|
| 61 |
if test "x$PTHREAD_LIBS" = xerror; then |
|---|
| 62 |
AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="") |
|---|
| 63 |
fi |
|---|
| 64 |
AC_SUBST(PTHREAD_LIBS) |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
dnl |
|---|
| 69 |
dnl Detect Gthread, GLib and GTK+ libraries |
|---|
| 70 |
dnl |
|---|
| 71 |
|
|---|
| 72 |
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10.0, HAVE_GTK="yes", sweep_config_ok="no") |
|---|
| 73 |
AC_SUBST(GTK_CFLAGS) |
|---|
| 74 |
AC_SUBST(GTK_LIBS) |
|---|
| 75 |
if test "x$HAVE_GTK" != xyes ; then |
|---|
| 76 |
AC_CHECK_LIB(gtk-x11-2.0, gtk_init, HAVE_GTK="maybe", sweep_config_ok="no") |
|---|
| 77 |
fi |
|---|
| 78 |
|
|---|
| 79 |
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.2.0, HAVE_GLIB="yes", sweep_config_ok="no") |
|---|
| 80 |
AC_SUBST(GLIB_CFLAGS) |
|---|
| 81 |
AC_SUBST(GLIB_LIBS) |
|---|
| 82 |
if test "x$HAVE_GLIB" != xyes ; then |
|---|
| 83 |
AC_CHECK_LIB(glib-2.0, g_list_append, HAVE_GLIB="maybe", sweep_config_ok="no") |
|---|
| 84 |
fi |
|---|
| 85 |
|
|---|
| 86 |
PKG_CHECK_MODULES(GTHREADS, gthread-2.0 >= 2.2.0, HAVE_GTHREADS="yes", sweep_config_ok="no") |
|---|
| 87 |
AC_SUBST(GTHREADS_CFLAGS) |
|---|
| 88 |
AC_SUBST(GTHREADS_LIBS) |
|---|
| 89 |
if test "x$HAVE_GTHREADS" != xyes ; then |
|---|
| 90 |
AC_CHECK_LIB(gthread-2.0, g_thread_init, HAVE_GTHREADS="maybe", sweep_config_ok="no") |
|---|
| 91 |
fi |
|---|
| 92 |
|
|---|
| 93 |
dnl |
|---|
| 94 |
dnl Detect libsndfile 1.0 |
|---|
| 95 |
dnl |
|---|
| 96 |
|
|---|
| 97 |
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0, |
|---|
| 98 |
HAVE_LIBSNDFILE1="yes", HAVE_LIBSNDFILE1="no") |
|---|
| 99 |
|
|---|
| 100 |
if test "x$HAVE_LIBSNDFILE1" = xyes ; then |
|---|
| 101 |
AC_DEFINE([HAVE_LIBSNDFILE1], [], [Define if we have libsndfile1.]) |
|---|
| 102 |
AC_SUBST(SNDFILE_LIBS) |
|---|
| 103 |
else |
|---|
| 104 |
sweep_config_ok="no" |
|---|
| 105 |
AC_CHECK_LIB(sndfile, sf_open, HAVE_LIBSNDFILE1="maybe") |
|---|
| 106 |
fi |
|---|
| 107 |
|
|---|
| 108 |
if test "x$HAVE_LIBSNDFILE1" = xmaybe ; then |
|---|
| 109 |
AC_CHECK_HEADERS(sndfile.h, HAVE_LIBSNDFILE1="ouch") |
|---|
| 110 |
if test "x$HAVE_LIBSNDFILE1" = xouch ; then |
|---|
| 111 |
AC_MSG_ERROR([ |
|---|
| 112 |
*** |
|---|
| 113 |
*** libsndfile-1.0.0 or greater seems to exist on your system, however |
|---|
| 114 |
*** the pkg-config tool cannot find its build information. |
|---|
| 115 |
*** |
|---|
| 116 |
*** Please set your PKG_CONFIG_PATH environment variable to include the |
|---|
| 117 |
*** directory in which sndfile.pc was installed. For example, sndfile.pc |
|---|
| 118 |
*** is installed in /usr/local/lib/pkgconfig by default; if that is the |
|---|
| 119 |
*** case do: |
|---|
| 120 |
*** |
|---|
| 121 |
*** export PKG_CONFIG_PATH="\$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" |
|---|
| 122 |
*** |
|---|
| 123 |
*** then run this ./configure again. If you configured libsndfile with a |
|---|
| 124 |
*** different --prefix option, replace /usr/local above with that prefix. |
|---|
| 125 |
*** |
|---|
| 126 |
]) |
|---|
| 127 |
fi |
|---|
| 128 |
fi |
|---|
| 129 |
|
|---|
| 130 |
AC_CHECK_SIZEOF(off_t,1) |
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
dnl |
|---|
| 134 |
dnl Detect Ogg |
|---|
| 135 |
dnl |
|---|
| 136 |
|
|---|
| 137 |
HAVE_OGG=no |
|---|
| 138 |
HAVE_VORBIS=no |
|---|
| 139 |
HAVE_SPEEX=no |
|---|
| 140 |
|
|---|
| 141 |
ac_enable_oggvorbis=yes |
|---|
| 142 |
AC_ARG_ENABLE(oggvorbis, |
|---|
| 143 |
[ --disable-oggvorbis disable Ogg Vorbis support], |
|---|
| 144 |
[ ac_enable_oggvorbis=no ], [ ac_enable_oggvorbis=yes ]) |
|---|
| 145 |
|
|---|
| 146 |
ac_enable_speex=yes |
|---|
| 147 |
AC_ARG_ENABLE(speex, |
|---|
| 148 |
[ --disable-speex disable Speex support], |
|---|
| 149 |
[ ac_enable_speex=no ], [ ac_enable_speex=yes ]) |
|---|
| 150 |
|
|---|
| 151 |
dnl Both Vorbis and Speex require Ogg, so check for it first either way |
|---|
| 152 |
if test "x${ac_enable_oggvorbis}" != xno || |
|---|
| 153 |
test "x${ac_enable_speex}" != xno ; then |
|---|
| 154 |
|
|---|
| 155 |
XIPH_PATH_OGG(HAVE_OGG="yes", HAVE_OGG="no") |
|---|
| 156 |
if test "x$HAVE_OGG" = xno ; then |
|---|
| 157 |
AC_CHECK_LIB(ogg, ogg_stream_init, HAVE_OGG="maybe") |
|---|
| 158 |
fi |
|---|
| 159 |
if test "x$HAVE_OGG" = xmaybe; then |
|---|
| 160 |
AC_CHECK_HEADER([ogg/ogg.h], HAVE_OGG="yes", HAVE_OGG="no") |
|---|
| 161 |
fi |
|---|
| 162 |
|
|---|
| 163 |
AC_SUBST(OGG_LIBS) |
|---|
| 164 |
fi |
|---|
| 165 |
|
|---|
| 166 |
dnl |
|---|
| 167 |
dnl Detect Vorbis |
|---|
| 168 |
dnl |
|---|
| 169 |
dnl LIBS="$LIBS -lm -logg -lvorbis -lvorbisenc -lvorbisfile" |
|---|
| 170 |
|
|---|
| 171 |
if test "x$HAVE_OGG" = xyes && test "x${ac_enable_oggvorbis}" != xno ; then |
|---|
| 172 |
|
|---|
| 173 |
XIPH_PATH_VORBIS(HAVE_VORBIS="yes", HAVE_VORBIS="no") |
|---|
| 174 |
|
|---|
| 175 |
dnl Fall back to explicit checks if this fails |
|---|
| 176 |
if test "x$HAVE_VORBIS" = xno ; then |
|---|
| 177 |
AC_MSG_RESULT([ |
|---|
| 178 |
*** Trying explicit detection of Ogg Vorbis libraries and headers ...]) |
|---|
| 179 |
AC_CHECK_LIB(vorbis, vorbis_info_init, HAVE_VORBIS="maybe", , |
|---|
| 180 |
[-lm -logg]) |
|---|
| 181 |
AC_CHECK_LIB(vorbisenc, vorbis_encode_init, HAVE_VORBISENC="maybe", , |
|---|
| 182 |
[-lm -logg -lvorbis]) |
|---|
| 183 |
AC_CHECK_LIB(vorbisfile, ov_open, HAVE_VORBISFILE="maybe", , |
|---|
| 184 |
[-lm -logg -lvorbis]) |
|---|
| 185 |
AC_CHECK_HEADERS([vorbis/codec.h vorbis/vorbisfile.h vorbis/vorbisenc.h], |
|---|
| 186 |
HAVE_VORBIS_HEADERS="yes", HAVE_VORBIS_HEADERS="no") |
|---|
| 187 |
|
|---|
| 188 |
if test "x$HAVE_VORBIS" = xmaybe && test "x$HAVE_VORBISENC" = xmaybe && |
|---|
| 189 |
test "x$HAVE_VORBISFILE" = xmaybe && |
|---|
| 190 |
test "x$HAVE_VORBIS_HEADERS" = xyes ; then |
|---|
| 191 |
|
|---|
| 192 |
VORBIS_LIBS="-lvorbis -lm" |
|---|
| 193 |
VORBISFILE_LIBS="-lvorbisfile" |
|---|
| 194 |
VORBISENC_LIBS="-lvorbisenc" |
|---|
| 195 |
VORBIS_CFLAGS="" |
|---|
| 196 |
|
|---|
| 197 |
dnl HAVE_VORBIS="maybe" |
|---|
| 198 |
HAVE_VORBIS="yes" |
|---|
| 199 |
else |
|---|
| 200 |
HAVE_VORBIS="no" |
|---|
| 201 |
fi |
|---|
| 202 |
fi |
|---|
| 203 |
|
|---|
| 204 |
AC_SUBST(VORBIS_LIBS) |
|---|
| 205 |
AC_SUBST(VORBISENC_LIBS) |
|---|
| 206 |
AC_SUBST(VORBISFILE_LIBS) |
|---|
| 207 |
|
|---|
| 208 |
if test "x$HAVE_VORBIS" = xyes ; then |
|---|
| 209 |
AC_DEFINE([HAVE_OGGVORBIS], [], [Define if we have Ogg Vorbis.]) |
|---|
| 210 |
|
|---|
| 211 |
dnl Test out ov_read_float |
|---|
| 212 |
AC_MSG_CHECKING([for deprecated ov_read_float() interface]) |
|---|
| 213 |
|
|---|
| 214 |
ac_save_CFLAGS="$CFLAGS" |
|---|
| 215 |
ac_save_LIBS="$LIBS" |
|---|
| 216 |
CFLAGS="$CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS" |
|---|
| 217 |
LIBS="$LIBS $OGG_LIBS $VORBIS_LIBS $VORBISFILE_LIBS" |
|---|
| 218 |
|
|---|
| 219 |
AC_TRY_COMPILE([#include <vorbis/codec.h> |
|---|
| 220 |
#include <vorbis/vorbisfile.h> ], |
|---|
| 221 |
[OggVorbis_File * vf; float ** pcm; int b; |
|---|
| 222 |
ov_read_float (vf, &pcm, &b);], |
|---|
| 223 |
[ AC_DEFINE([OV_READ_FLOAT_THREE_ARGS], [], [Define if ov_read_float takes 3 arguments.]) |
|---|
| 224 |
AC_MSG_RESULT(yes) ], |
|---|
| 225 |
[ AC_MSG_RESULT(no) ]) |
|---|
| 226 |
|
|---|
| 227 |
CFLAGS="$ac_save_CFLAGS" |
|---|
| 228 |
LIBS="$ac_save_LIBS" |
|---|
| 229 |
|
|---|
| 230 |
else |
|---|
| 231 |
sweep_config_ok="no" |
|---|
| 232 |
fi |
|---|
| 233 |
|
|---|
| 234 |
else |
|---|
| 235 |
HAVE_VORBIS=disabled |
|---|
| 236 |
fi |
|---|
| 237 |
|
|---|
| 238 |
dnl |
|---|
| 239 |
dnl Detect speex |
|---|
| 240 |
dnl |
|---|
| 241 |
dnl LIBS="$LIBS -lm -logg -lspeex" |
|---|
| 242 |
|
|---|
| 243 |
if test "x$HAVE_OGG" = xyes && test "x${ac_enable_speex}" != xno ; then |
|---|
| 244 |
|
|---|
| 245 |
XIPH_PATH_SPEEX(HAVE_SPEEX="yes", HAVE_SPEEX="no") |
|---|
| 246 |
|
|---|
| 247 |
dnl Fall back to explicit checks if this fails |
|---|
| 248 |
if test "x$HAVE_SPEEX" = xno ; then |
|---|
| 249 |
AC_CHECK_LIB(speex, speex_encoder_init, HAVE_SPEEX="maybe", , [-lm -logg]) |
|---|
| 250 |
if test "x$HAVE_SPEEX" = xmaybe; then |
|---|
| 251 |
AC_CHECK_HEADER(speex.h, HAVE_SPEEX="yes", |
|---|
| 252 |
[AC_CHECK_HEADER([speex/speex.h], HAVE_SPEEX="yes", HAVE_SPEEX="no")] |
|---|
| 253 |
) |
|---|
| 254 |
fi |
|---|
| 255 |
fi |
|---|
| 256 |
|
|---|
| 257 |
if test "x$HAVE_SPEEX" = xyes ; then |
|---|
| 258 |
AC_CHECK_HEADER([speex/speex.h], |
|---|
| 259 |
AC_DEFINE(HAVE_SPEEX_SUBDIR, [1], [Define to 1 if speex headers are eg. <speex/speex.h>]) |
|---|
| 260 |
) |
|---|
| 261 |
|
|---|
| 262 |
AC_DEFINE([HAVE_SPEEX], [], [Define if we have speex.]) |
|---|
| 263 |
SPEEX_LIBS="-lspeex -lm" |
|---|
| 264 |
AC_SUBST(SPEEX_LIBS) |
|---|
| 265 |
fi |
|---|
| 266 |
|
|---|
| 267 |
else |
|---|
| 268 |
HAVE_SPEEX=disabled |
|---|
| 269 |
fi |
|---|
| 270 |
|
|---|
| 271 |
|
|---|
| 272 |
dnl |
|---|
| 273 |
dnl Detect libmad |
|---|
| 274 |
dnl |
|---|
| 275 |
|
|---|
| 276 |
HAVE_MAD=no |
|---|
| 277 |
|
|---|
| 278 |
ac_enable_mad=yes |
|---|
| 279 |
AC_ARG_ENABLE(mad, |
|---|
| 280 |
[ --disable-mad disable libmad (MPEG audio loading) support], |
|---|
| 281 |
[ ac_enable_mad=no ], [ ac_enable_mad=yes ]) |
|---|
| 282 |
|
|---|
| 283 |
if test "x${ac_enable_mad}" != xno ; then |
|---|
| 284 |
AC_CHECK_LIB(mad, mad_decoder_init, HAVE_MAD="maybe") |
|---|
| 285 |
|
|---|
| 286 |
if test "x$HAVE_MAD" = xmaybe ; then |
|---|
| 287 |
AC_CHECK_HEADER(mad.h, HAVE_MAD="yes", HAVE_MAD="no") |
|---|
| 288 |
fi |
|---|
| 289 |
if test "x$HAVE_MAD" = xyes ; then |
|---|
| 290 |
AC_DEFINE([HAVE_MAD], [], [Define if we have mad.]) |
|---|
| 291 |
MAD_LIBS="-lmad" |
|---|
| 292 |
AC_SUBST(MAD_LIBS) |
|---|
| 293 |
fi |
|---|
| 294 |
|
|---|
| 295 |
else |
|---|
| 296 |
HAVE_MAD=disabled |
|---|
| 297 |
fi |
|---|
| 298 |
|
|---|
| 299 |
dnl |
|---|
| 300 |
dnl Detect secret rabbit code |
|---|
| 301 |
dnl |
|---|
| 302 |
|
|---|
| 303 |
HAVE_LIBSAMPLERATE=no |
|---|
| 304 |
|
|---|
| 305 |
ac_enable_src=yes |
|---|
| 306 |
AC_ARG_ENABLE(src, |
|---|
| 307 |
[ --disable-src enable secret rabbit code (libsamplerate)], |
|---|
| 308 |
[ ac_enable_src=no ], [ ac_enable_src=yes]) |
|---|
| 309 |
|
|---|
| 310 |
if test "x${ac_enable_src}" != xno ; then |
|---|
| 311 |
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.9, |
|---|
| 312 |
HAVE_LIBSAMPLERATE="yes", HAVE_LIBSAMPLERATE="no") |
|---|
| 313 |
|
|---|
| 314 |
if test "x$HAVE_LIBSAMPLERATE" = xyes ; then |
|---|
| 315 |
AC_DEFINE([HAVE_LIBSAMPLERATE], [], [Define if we have libsamplerate.]) |
|---|
| 316 |
AC_SUBST(SAMPLERATE_LIBS) |
|---|
| 317 |
fi |
|---|
| 318 |
else |
|---|
| 319 |
HAVE_LIBSAMPLERATE=disabled |
|---|
| 320 |
fi |
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
dnl |
|---|
| 324 |
dnl Detect output drivers. Enable as many as possible by default and |
|---|
| 325 |
dnl choose between them at runtime. |
|---|
| 326 |
dnl |
|---|
| 327 |
|
|---|
| 328 |
ac_enable_alsa=yes |
|---|
| 329 |
AC_ARG_ENABLE(alsa, |
|---|
| 330 |
AC_HELP_STRING([--disable-alsa],[Disable ALSA driver]), |
|---|
| 331 |
[ ac_enable_alsa=no ]) |
|---|
| 332 |
|
|---|
| 333 |
ac_enable_jack=yes |
|---|
| 334 |
AC_ARG_ENABLE(jack, |
|---|
| 335 |
AC_HELP_STRING([--disable-jack],[Disable JACK driver]), |
|---|
| 336 |
[ ac_enable_jack=no ]) |
|---|
| 337 |
|
|---|
| 338 |
ac_enable_oss=yes |
|---|
| 339 |
AC_ARG_ENABLE(oss, |
|---|
| 340 |
AC_HELP_STRING([--disable-oss],[Disable OSS driver]), |
|---|
| 341 |
[ ac_enable_oss=no ]) |
|---|
| 342 |
|
|---|
| 343 |
ac_enable_pulseaudio=yes |
|---|
| 344 |
AC_ARG_ENABLE(pulseaudio, |
|---|
| 345 |
AC_HELP_STRING([--disable-pulseaudio],[Disable PulseAudio driver]), |
|---|
| 346 |
[ ac_enable_pulseaudio=no ]) |
|---|
| 347 |
|
|---|
| 348 |
if test "x${ac_enable_alsa}" != xno ; then |
|---|
| 349 |
PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0, |
|---|
| 350 |
HAVE_ALSA="yes", sweep_config_ok="no") |
|---|
| 351 |
AC_SUBST(ALSA_CFLAGS) |
|---|
| 352 |
AC_SUBST(ALSA_LIBS) |
|---|
| 353 |
AC_DEFINE([DRIVER_ALSA], [], [Define if we have and want ALSA driver.]) |
|---|
| 354 |
if test "x$HAVE_ALSA" == xyes ; then |
|---|
| 355 |
AC_CHECK_LIB(asound, snd_seq_open, HAVE_ALSA="maybe", sweep_config_ok="no") |
|---|
| 356 |
sweep_config_driver="$sweep_config_driver ALSA" |
|---|
| 357 |
fi |
|---|
| 358 |
fi |
|---|
| 359 |
|
|---|
| 360 |
if test "x${ac_enable_jack}" != xno ; then |
|---|
| 361 |
PKG_CHECK_MODULES(JACK, jack >= 0.100, HAVE_JACK=yes, sweep_config_ok="no") |
|---|
| 362 |
AC_SUBST(JACK_CFLAGS) |
|---|
| 363 |
AC_SUBST(JACK_LIBS) |
|---|
| 364 |
AC_DEFINE([DRIVER_JACK], [], [Define if we have and want JACK driver.]) |
|---|
| 365 |
if test "x$HAVE_JACK" == xyes ; then |
|---|
| 366 |
sweep_config_driver="$sweep_config_driver JACK" |
|---|
| 367 |
fi |
|---|
| 368 |
fi |
|---|
| 369 |
|
|---|
| 370 |
if test "x${ac_enable_oss}" != xno ; then |
|---|
| 371 |
dnl Test for OSS |
|---|
| 372 |
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h) |
|---|
| 373 |
if test "x${ac_cv_header_sys_soundcard_h}" = xyes || \ |
|---|
| 374 |
test "x${ac_cv_header_machine_soundcard_h}" = xyes; then |
|---|
| 375 |
if test "x$ac_enable_alsa" = xyes ; then |
|---|
| 376 |
AC_DEFINE([DRIVER_OSS], [], [Define if we have and want OSS.]) |
|---|
| 377 |
dnl Check for NetBSD's OSS compatability layer |
|---|
| 378 |
AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBS="$LIBS -lossaudio") |
|---|
| 379 |
sweep_config_driver="$sweep_config_driver OSS" |
|---|
| 380 |
fi |
|---|
| 381 |
fi |
|---|
| 382 |
fi |
|---|
| 383 |
|
|---|
| 384 |
if test "x${ac_enable_pulseaudio}" != xno ; then |
|---|
| 385 |
PKG_CHECK_MODULES(PULSEAUDIO, libpulse-simple >= 0.9.10, HAVE_PULSEAUDIO="yes", sweep_config_ok="no") |
|---|
| 386 |
AC_SUBST(PULSEAUDIO_CFLAGS) |
|---|
| 387 |
AC_SUBST(PULSEAUDIO_LIBS) |
|---|
| 388 |
if test "x$HAVE_PULSEAUDIO" = xyes; then |
|---|
| 389 |
AC_DEFINE([DRIVER_PULSEAUDIO], [], [Define if we have and want pulseaudio.]) |
|---|
| 390 |
sweep_config_driver="$sweep_config_driver PulseAudio" |
|---|
| 391 |
fi |
|---|
| 392 |
fi |
|---|
| 393 |
|
|---|
| 394 |
dnl Test for Solaris audio |
|---|
| 395 |
case $host in |
|---|
| 396 |
*-*-solaris*) |
|---|
| 397 |
AC_CHECK_HEADERS(sys/audioio.h) |
|---|
| 398 |
if test "x${ac_cv_header_sys_audioio_h}" = xyes; then |
|---|
| 399 |
AC_DEFINE([DRIVER_SOLARIS_AUDIO], [], [Define if we have and want the solaris audio driver.]) |
|---|
| 400 |
sweep_config_driver="$sweep_config_driver Solaris" |
|---|
| 401 |
fi |
|---|
| 402 |
;; |
|---|
| 403 |
esac |
|---|
| 404 |
|
|---|
| 405 |
dnl Set PACKAGE_LOCALE_DIR in config.h. |
|---|
| 406 |
if test "x${prefix}" = xNONE; then |
|---|
| 407 |
AC_DEFINE_UNQUOTED([PACKAGE_LOCALE_DIR], "${ac_default_prefix}/${DATADIRNAME}/locale", [Define the PACKAGE_LOCALE_DIR.]) |
|---|
| 408 |
else |
|---|
| 409 |
AC_DEFINE_UNQUOTED([PACKAGE_LOCALE_DIR], "${prefix}/${DATADIRNAME}/locale") |
|---|
| 410 |
fi |
|---|
| 411 |
|
|---|
| 412 |
if test "x${datadir}" = 'x${prefix}/share'; then |
|---|
| 413 |
if test "x${prefix}" = xNONE; then |
|---|
| 414 |
PACKAGE_DATA_DIR='"${ac_default_prefix}/share/${PACKAGE}"' |
|---|
| 415 |
else |
|---|
| 416 |
PACKAGE_DATA_DIR='"${prefix}/share/${PACKAGE}"' |
|---|
| 417 |
fi |
|---|
| 418 |
else |
|---|
| 419 |
PACKAGE_DATA_DIR='"${datadir}/${PACKAGE}"' |
|---|
| 420 |
fi |
|---|
| 421 |
AC_SUBST(PACKAGE_DATA_DIR) |
|---|
| 422 |
|
|---|
| 423 |
dnl Set PACKAGE_PLUGIN_DIR in Makefiles and config.h. |
|---|
| 424 |
PACKAGE_PLUGIN_DIR=$libdir/sweep |
|---|
| 425 |
AC_SUBST(PACKAGE_PLUGIN_DIR) |
|---|
| 426 |
if test "x${prefix}" = xNONE; then |
|---|
| 427 |
sweep_plugin_dir="${ac_default_prefix}/lib/${PACKAGE}" |
|---|
| 428 |
else |
|---|
| 429 |
sweep_plugin_dir="${prefix}/lib/${PACKAGE}" |
|---|
| 430 |
fi |
|---|
| 431 |
AC_DEFINE_UNQUOTED([PACKAGE_PLUGIN_DIR], "$sweep_plugin_dir", [Define the PACKAGE_PLUGIN_DIR.]) |
|---|
| 432 |
|
|---|
| 433 |
dnl Set PACKAGE_SOURCE_DIR in config.h. |
|---|
| 434 |
packagesrcdir=`cd $srcdir && pwd` |
|---|
| 435 |
AC_DEFINE_UNQUOTED([PACKAGE_SOURCE_DIR], "${packagesrcdir}", [Define the PACKAGE_SOURCE_DIR.]) |
|---|
| 436 |
|
|---|
| 437 |
|
|---|
| 438 |
AC_ARG_ENABLE(gcc-werror, |
|---|
| 439 |
AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles])) |
|---|
| 440 |
|
|---|
| 441 |
dnl Use -Wall if we have gcc. |
|---|
| 442 |
dnl changequote(,)dnl |
|---|
| 443 |
if test "x$ac_cv_prog_gcc" = xyes ; then |
|---|
| 444 |
CFLAGS="$CFLAGS -Wall" |
|---|
| 445 |
|
|---|
| 446 |
if test x$enable_gcc_werror = "xyes" ; then |
|---|
| 447 |
CFLAGS="$CFLAGS -Werror" |
|---|
| 448 |
fi |
|---|
| 449 |
|
|---|
| 450 |
fi |
|---|
| 451 |
dnl changequote([,])dnl |
|---|
| 452 |
|
|---|
| 453 |
dnl - Modified from www.nagios.org who modified it from www.erlang.org |
|---|
| 454 |
|
|---|
| 455 |
dnl Check how to export functions from the sweep executable, needed |
|---|
| 456 |
dnl when dynamically loaded drivers are loaded (so that they can find |
|---|
| 457 |
dnl sweep functions). |
|---|
| 458 |
dnl OS'es with ELF executables using the GNU linker (Linux and recent *BSD , |
|---|
| 459 |
dnl in rare cases Solaris) typically need '-Wl,-export-dynamic' (i.e. pass |
|---|
| 460 |
dnl -export-dynamic to the linker - also known as -rdynamic and some other |
|---|
| 461 |
dnl variants); some sysVr4 system(s) instead need(s) '-Wl,-Bexport'. |
|---|
| 462 |
dnl AIX 4.x (perhaps only for x>=2) wants -Wl,-bexpall,-brtl and doesn't |
|---|
| 463 |
dnl reliably return an error for others, thus we separate it out. |
|---|
| 464 |
dnl Otherwise we assume that if the linker accepts the flag, it is needed. |
|---|
| 465 |
|
|---|
| 466 |
AC_MSG_CHECKING(for extra flags needed to export symbols) |
|---|
| 467 |
case $host_os in |
|---|
| 468 |
aix4*|aix5*) |
|---|
| 469 |
EXPORT_DYNAMIC_FLAGS="-Wl,-bexpall,-brtl" |
|---|
| 470 |
;; |
|---|
| 471 |
bsdi*) |
|---|
| 472 |
EXPORT_DYNAMIC_FLAGS="-rdynamic" |
|---|
| 473 |
;; |
|---|
| 474 |
*) |
|---|
| 475 |
save_ldflags="$LDFLAGS" |
|---|
| 476 |
LDFLAGS=-Wl,-export-dynamic |
|---|
| 477 |
AC_TRY_LINK(,,[EXPORT_DYNAMIC_FLAGS="-Wl,-export-dynamic"], [ |
|---|
| 478 |
LDFLAGS=-Wl,-Bexport |
|---|
| 479 |
AC_TRY_LINK(,,[EXPORT_DYNAMIC_FLAGS="- Wl,-Bexport"], |
|---|
| 480 |
AC_MSG_RESULT(none))]) |
|---|
| 481 |
LDFLAGS="$save_ldflags" |
|---|
| 482 |
;; |
|---|
| 483 |
esac |
|---|
| 484 |
AC_SUBST(EXPORT_DYNAMIC_FLAGS) |
|---|
| 485 |
test "x$EXPORT_DYNAMIC_FLAGS" != x && AC_MSG_RESULT([$EXPORT_DYNAMIC_FLAGS]) |
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 |
|
|---|
| 489 |
dnl |
|---|
| 490 |
dnl Configuration tests complete -- provide summary of results. |
|---|
| 491 |
dnl |
|---|
| 492 |
|
|---|
| 493 |
if test $sweep_config_ok = no ; then |
|---|
| 494 |
|
|---|
| 495 |
AC_MSG_RESULT([ |
|---|
| 496 |
************************************************************** |
|---|
| 497 |
|
|---|
| 498 |
*** Sweep $VERSION: Automatic configuration FAILED. |
|---|
| 499 |
|
|---|
| 500 |
*** The file config.log has full details. |
|---|
| 501 |
|
|---|
| 502 |
*** The following required libraries are missing or |
|---|
| 503 |
*** misconfigured on your system: |
|---|
| 504 |
]) |
|---|
| 505 |
|
|---|
| 506 |
if test "x$HAVE_GLIB" != xyes || test "x$HAVE_GTHREADS" != xyes; then |
|---|
| 507 |
AC_MSG_RESULT([ |
|---|
| 508 |
*** GLib version 2.2.x or greater, available from http://www.gtk.org/ |
|---|
| 509 |
]) |
|---|
| 510 |
fi |
|---|
| 511 |
|
|---|
| 512 |
if test "x$HAVE_GLIB" = xmaybe || test "x$HAVE_GTHREADS" = xmaybe; then |
|---|
| 513 |
AC_MSG_RESULT([ |
|---|
| 514 |
Development files missing: The libglib-2.0 binary seems |
|---|
| 515 |
to be installed, but the pkg-config tool cannot find its build |
|---|
| 516 |
information. |
|---|
| 517 |
]) |
|---|
| 518 |
fi |
|---|
| 519 |
|
|---|
| 520 |
if test "x$HAVE_GTK" != xyes ; then |
|---|
| 521 |
AC_MSG_RESULT([ |
|---|
| 522 |
*** GTK+ version 2.2.x or greater, available from http://www.gtk.org/ |
|---|
| 523 |
]) |
|---|
| 524 |
fi |
|---|
| 525 |
if test "x$HAVE_GTK" = xmaybe ; then |
|---|
| 526 |
AC_MSG_RESULT([ |
|---|
| 527 |
Development files missing: The libgtk binary seems |
|---|
| 528 |
to be installed, but the pkg-config tool cannot find its build |
|---|
| 529 |
information.. |
|---|
| 530 |
]) |
|---|
| 531 |
fi |
|---|
| 532 |
|
|---|
| 533 |
if test "x$HAVE_LIBSNDFILE1" != xyes ; then |
|---|
| 534 |
AC_MSG_RESULT([ |
|---|
| 535 |
*** libsndfile version 1.0.0 or greater, available from |
|---|
| 536 |
*** http://www.mega-nerd.com/libsndfile/ |
|---|
| 537 |
]) |
|---|
| 538 |
fi |
|---|
| 539 |
if test "x$HAVE_LIBSNDFILE1" = xmaybe ; then |
|---|
| 540 |
AC_MSG_RESULT([ |
|---|
| 541 |
Development files missing: libsndfile-1.0.0 or greater |
|---|
| 542 |
seems to exist on your system, however the header files |
|---|
| 543 |
are missing and the pkg-config tool cannot find its build |
|---|
| 544 |
information. |
|---|
| 545 |
]) |
|---|
| 546 |
fi |
|---|
| 547 |
|
|---|
| 548 |
if test "x$HAVE_ALSA" = xmaybe ; then |
|---|
| 549 |
AC_MSG_RESULT([ |
|---|
| 550 |
Development files missing: alsa-lib 1.0.0 or greater seems to exist |
|---|
| 551 |
on your system, however the pkg-config tool cannot find the |
|---|
| 552 |
build information. |
|---|
| 553 |
]) |
|---|
| 554 |
fi |
|---|
| 555 |
|
|---|
| 556 |
if test "x$HAVE_ALSA" != xyes ; then |
|---|
| 557 |
AC_MSG_RESULT([ |
|---|
| 558 |
*** alsa-lib version 1.0.0 or greater, available from |
|---|
| 559 |
*** http://alsa-project.org/ |
|---|
| 560 |
]) |
|---|
| 561 |
fi |
|---|
| 562 |
|
|---|
| 563 |
if test "x$HAVE_VORBIS" = xmaybe ; then |
|---|
| 564 |
AC_MSG_RESULT([ |
|---|
| 565 |
Development files missing: The libogg, libvorbis, libvorbisenc and |
|---|
| 566 |
libvorbisfile library binaries seem to be installed, but building of |
|---|
| 567 |
a test program failed. |
|---|
| 568 |
]) |
|---|
| 569 |
fi |
|---|
| 570 |
|
|---|
| 571 |
if test "x$HAVE_VORBIS" != xyes ; then |
|---|
| 572 |
AC_MSG_RESULT([ |
|---|
| 573 |
*** Ogg Vorbis libraries, available from http://www.xiph.org/ogg/vorbis/ |
|---|
| 574 |
]) |
|---|
| 575 |
fi |
|---|
| 576 |
|
|---|
| 577 |
if test "x$HAVE_VORBIS" != xyes ; then |
|---|
| 578 |
AC_MSG_RESULT([ |
|---|
| 579 |
*** Or, to build a version of Sweep without Ogg Vorbis support, do: |
|---|
| 580 |
*** |
|---|
| 581 |
*** ./configure --disable-oggvorbis |
|---|
| 582 |
]) |
|---|
| 583 |
fi |
|---|
| 584 |
|
|---|
| 585 |
if test "x$HAVE_GLIB" = xmaybe || test "x$HAVE_GTK" = xmaybe || |
|---|
| 586 |
test "x$HAVE_LIBSNDFILE1" = xmaybe || test "x$HAVE_TDB" = xmaybe || |
|---|
| 587 |
test "x$HAVE_GTHREADS" = xmaybe || test "x$HAVE_ALSA" = xmaybe || |
|---|
| 588 |
test "x$HAVE_OGG" = xmaybe || test "x$HAVE_VORBIS" = xmaybe ; then |
|---|
| 589 |
AC_MSG_RESULT([ |
|---|
| 590 |
*** HOW TO FIX "development files missing": you have probably |
|---|
| 591 |
*** installed the library package from your distribution. You |
|---|
| 592 |
*** must also install the library's "development" package. |
|---|
| 593 |
]) |
|---|
| 594 |
fi |
|---|
| 595 |
|
|---|
| 596 |
AC_MSG_RESULT([ |
|---|
| 597 |
*** If you install the required libraries from source, you |
|---|
| 598 |
*** need to inform the dynamic linker of their location. If |
|---|
| 599 |
*** you install them in a system-wide directory such as |
|---|
| 600 |
*** /usr/local (the default), you must ensure that |
|---|
| 601 |
*** /usr/local/lib is listed in /etc/ld.so.conf, then run |
|---|
| 602 |
*** ldconfig to update the dynamic linking system. |
|---|
| 603 |
*** Alternatively, you can set your LD_LIBRARY_PATH environment |
|---|
| 604 |
*** variable to include the library installation directory. |
|---|
| 605 |
]) |
|---|
| 606 |
|
|---|
| 607 |
|
|---|
| 608 |
AC_MSG_RESULT([ |
|---|
| 609 |
************************************************************** |
|---|
| 610 |
]) |
|---|
| 611 |
|
|---|
| 612 |
AC_MSG_ERROR([ |
|---|
| 613 |
*** |
|---|
| 614 |
*** After fixing the above problems, you must run ./configure again. |
|---|
| 615 |
*** |
|---|
| 616 |
]) |
|---|
| 617 |
|
|---|
| 618 |
else |
|---|
| 619 |
|
|---|
| 620 |
# Shave make automake/libtool output much less verbose and much more |
|---|
| 621 |
# readable. See : git://git.lespiau.name/shave |
|---|
| 622 |
SHAVE_INIT([],[enable]) |
|---|
| 623 |
|
|---|
| 624 |
AC_OUTPUT([ |
|---|
| 625 |
shave |
|---|
| 626 |
shave-libtool |
|---|
| 627 |
Makefile |
|---|
| 628 |
sweep.spec |
|---|
| 629 |
m4/Makefile |
|---|
| 630 |
include/Makefile |
|---|
| 631 |
include/sweep/Makefile |
|---|
| 632 |
src/Makefile |
|---|
| 633 |
src/tdb/Makefile |
|---|
| 634 |
plugins/Makefile |
|---|
| 635 |
plugins/echo/Makefile |
|---|
| 636 |
plugins/normalise/Makefile |
|---|
| 637 |
plugins/fade/Makefile |
|---|
| 638 |
plugins/reverse/Makefile |
|---|
| 639 |
plugins/ladspa/Makefile |
|---|
| 640 |
plugins/byenergy/Makefile |
|---|
| 641 |
plugins/example/Makefile |
|---|
| 642 |
doc/Makefile |
|---|
| 643 |
intl/Makefile |
|---|
| 644 |
po/Makefile.in |
|---|
| 645 |
doc/sweep.1 |
|---|
| 646 |
]) |
|---|
| 647 |
|
|---|
| 648 |
AC_MSG_RESULT([ |
|---|
| 649 |
************************************************************ |
|---|
| 650 |
* Sweep $VERSION: Automatic configuration OK. |
|---|
| 651 |
** |
|---|
| 652 |
** Configuration summary: |
|---|
| 653 |
** |
|---|
| 654 |
** Experimental code: ....... ${ac_enable_experimental} |
|---|
| 655 |
** Audio devices: ...........$sweep_config_driver |
|---|
| 656 |
** PCM: libsndfile .......... $HAVE_LIBSNDFILE1 |
|---|
| 657 |
** Ogg Vorbis support: ...... $HAVE_VORBIS |
|---|
| 658 |
** MPEG (MP3) loading: ...... $HAVE_MAD |
|---|
| 659 |
** Speex support: ........... $HAVE_SPEEX |
|---|
| 660 |
** Secret Rabbit Code: ...... $HAVE_LIBSAMPLERATE |
|---|
| 661 |
** Translations: ............ $ALL_LINGUAS |
|---|
| 662 |
** |
|---|
| 663 |
** Installation directories: |
|---|
| 664 |
** |
|---|
| 665 |
** Program: ................. ${prefix}/bin |
|---|
| 666 |
** Plugins: ................. $sweep_plugin_dir |
|---|
| 667 |
** |
|---|
| 668 |
************************************************************** |
|---|
| 669 |
** |
|---|
| 670 |
** Type 'make' to compile Sweep. |
|---|
| 671 |
** |
|---|
| 672 |
** Type 'make install' to install Sweep. Plugins will not be |
|---|
| 673 |
** accessible until you have done this. |
|---|
| 674 |
** |
|---|
| 675 |
** Have fun with Scrubby! |
|---|
| 676 |
* |
|---|
| 677 |
************************************************************ |
|---|
| 678 |
]) |
|---|
| 679 |
|
|---|
| 680 |
fi |
|---|