1 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(SoX, 14.4.3git, sox-devel@lists.sourceforge.net)
7 AC_CONFIG_MACRO_DIR([m4])
9 dnl Find target architecture
13 AM_SILENT_RULES([yes])
15 dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
16 AC_CONFIG_HEADERS([src/soxconfig.h])
18 dnl Check we have the right srcdir
19 AC_CONFIG_SRCDIR(sox.1)
21 dnl Checks for programs.
27 AX_APPEND_LINK_FLAGS([-Wl,--as-needed])
29 dnl Increase version when binary compatibility with previous version is broken
31 AC_SUBST(SHLIB_VERSION)
34 AS_HELP_STRING([--without-libltdl],
35 [Don't try to use libltdl for external dynamic library support]),
36 with_libltdl=$withval, with_libltdl=default)
38 if test "$with_libltdl" = "default"; then
39 dnl Default to no libltdl support when building only static libraries
40 if test "$enable_shared" != "no"; then
47 using_libltdl=$with_libltdl
50 LT_INIT([dlopen win32-dll])
51 AC_SUBST(LIBTOOL_DEPS)
53 AC_ARG_WITH(dyn-default,AS_HELP_STRING([--with-dyn-default],[Default to loading optional formats dynamically]),opt_default=dyn,opt_default=yes)
55 AC_ARG_WITH(pkgconfigdir,
56 AS_HELP_STRING([--with-pkgconfigdir],
57 [location to install .pc files or "no" to disable (default=$(libdir)/pkgconfig)]))
59 m4_ifndef([PKG_PROG_PKG_CONFIG], with_pkgconfigdir="no")
62 if test "$with_pkgconfigdir" != "no"; then
63 if test "$with_pkgconfigdir" = ""; then
64 with_pkgconfigdir="\$(libdir)/pkgconfig"
69 AM_CONDITIONAL(HAVE_PKGCONFIG, test x$using_pkgconfig = xyes)
70 AC_SUBST(PKGCONFIGDIR, $with_pkgconfigdir)
75 using_win32_glob="yes"
78 if test "$using_win32_glob" = yes; then
79 AC_DEFINE([HAVE_WIN32_GLOB_H], 1, [Define to 1 to use win32 glob])
81 AM_CONDITIONAL(HAVE_WIN32_GLOB, test x$using_win32_glob = xyes)
84 AC_MSG_CHECKING([whether to make a debug build])
85 AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [make a debug build]))
86 AC_MSG_RESULT($enable_debug)
87 if test "$enable_debug" = "yes"; then
89 if test "$GCC" = "yes"; then
90 CFLAGS="$CFLAGS -ggdb"
97 AC_ARG_ENABLE([stack-protector],
98 [AS_HELP_STRING([--disable-stack-protector],
99 [Disable GCC's/libc's stack-smashing protection])],
100 [case "${enableval}" in
101 yes) enable_ssp=yes ;;
103 *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
107 if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
108 AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
112 if test x"$enable_ssp" = x"yes"; then
113 # Check for broken ssp in libc: http://www.avahi.org/ticket/105
114 # libc's brokenness will get in the way regardless of whether -lssp is
115 # provided, but provide it anyway (otherwise non-libc ssp would wrongly
118 # Get -lssp if it exists
119 GCC_STACK_PROTECT_LIB
121 AC_MSG_CHECKING([whether stack-smashing protection is available])
122 ssp_old_cflags="$CFLAGS"
123 ssp_old_ldflags="$LDFLAGS"
124 CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
125 LDFLAGS="$LDFLAGS -Wl,-z,defs"
126 cat confdefs.h > conftest.c
127 cat >>conftest.c <<_ACEOF
128 void test_broken_ssp(c)
131 char arr[[123]], *p; /* beware of possible double-braces if copying this */
132 for (p = arr; *c; ++p) {
140 if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
142 AC_MSG_CHECKING([whether stack-smashing protection is buggy])
143 if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
153 rm -f conftest.c conftest.o conftest.so
155 CFLAGS="$ssp_old_cflags"
156 LDFLAGS="$ssp_old_ldflags"
159 if test x"$enable_ssp" = x"yes"; then
160 # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
163 # XXX: Update the enable_ssp value now for output later?
166 dnl Extra CFLAGS if we have gcc
167 if test "$GCC" = "yes"; then
169 AC_MSG_CHECKING([gcc version])
170 gccver=`$CC -dumpversion`
171 AC_MSG_RESULT($gccver)
173 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes"
175 dnl Define stricter policy on GNU/Linux, all symbols must be resolved
178 LDFLAGS="$LDFLAGS -Wl,-z,defs"
180 *os2* | *cygwin* | *mingw*)
181 APP_LDFLAGS="-no-undefined"
185 AC_SUBST(APP_LDFLAGS)
186 AC_SUBST(WARN_CFLAGS)
188 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=distro], [Provide distribution name]))
189 if test "x$with_distro" != "x"; then
190 DISTRO="$with_distro"
192 AC_DEFINE(HAVE_DISTRO, 1, [1 if DISTRO is defined])
195 DISTRO="not specified!"
197 AM_CONDITIONAL(HAVE_DISTRO, test x$have_distro = xyes)
199 dnl Check for system dependent features.
203 dnl Checks for header files.
205 AC_CHECK_HEADERS(fcntl.h unistd.h byteswap.h sys/ioctl.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/utsname.h termios.h glob.h fenv.h)
207 dnl Checks for library functions.
208 AC_CHECK_FUNCS(strcasecmp strdup popen vsnprintf gettimeofday mkstemp fmemopen sigaction)
210 dnl Check if math library is needed.
211 AC_SEARCH_LIBS([pow], [m])
212 AC_SEARCH_LIBS([lrint], [m])
213 AC_CHECK_FUNCS([lrint])
215 dnl Large File Support
218 if test "$ac_cv_sys_file_offset_bits" = "64"; then
219 dnl This is either a 64-bit platform or a 32-bit platform
220 dnl that supports large files.
221 dnl There are to many broken glibc+kernel's out there that
222 dnl detect 64-bit off_t on 32-bit system and require
223 dnl _LARGEFILE_SOURCE to make fseeko() go into 64-bit mode.
224 dnl Force defining _LARGEFILE_SOURCE always. My assumption
225 dnl is its harmlessly ignored on 64-bit platforms and platforms
226 dnl that chose other solutions.
227 AC_MSG_NOTICE(Forcing _LARGEFILE_SOURCE to be safe since off_t is 64 bits)
228 AC_DEFINE(_LARGEFILE_SOURCE, 1)
231 dnl Allow libtool to be silenced
232 AC_MSG_CHECKING([whether libtool should be silenced])
233 AC_ARG_ENABLE(silent-libtool,
234 AS_HELP_STRING([--disable-silent-libtool], [Verbose libtool]),,enable_silent_libtool=yes)
235 AC_MSG_RESULT($enable_silent_libtool)
236 if test "$enable_silent_libtool" = "yes"; then
237 LIBTOOLFLAGS=--silent
239 AC_SUBST(LIBTOOLFLAGS)
241 dnl Check if ltdl should be enabled.
242 using_win32_ltdl="no"
243 if test "$using_libltdl" != "no"; then
246 AC_DEFINE([HAVE_WIN32_LTDL_H], 1, [Define to 1 to use internal win32 ltdl])
248 using_win32_ltdl="yes"
251 AC_CHECK_HEADERS(ltdl.h,
252 AC_CHECK_LIB(ltdl, lt_dlinit, LIBLTDL="$LIBLTDL -lltdl",
253 using_libltdl=no), using_libltdl=no)
257 if test "$using_libltdl" = yes; then
258 AC_DEFINE([HAVE_LIBLTDL], 1, [Define to 1 if you have libltdl])
260 AM_CONDITIONAL(HAVE_LIBLTDL, test x$using_libltdl = xyes -a x$using_win32_ltdl = xno)
261 AM_CONDITIONAL(HAVE_WIN32_LTDL, test x$using_win32_ltdl = xyes)
267 if test "x$OPENMP_CFLAGS" != "x"; then dnl Old libtool workaround start
268 AC_MSG_CHECKING([for libtool version])
269 lt_version="`grep '^VERSION' $srcdir/ltmain.sh | sed -e 's/VERSION\=//g;s/ .*//g;s/"//g'`"
270 AS_VERSION_COMPARE([$lt_version], [2.4],
271 [AS_IF([test "$GCC" = "yes"],
272 [AC_MSG_RESULT([$lt_version, needs OpenMP linker workaround])
274 [AC_MSG_RESULT([$lt_version and not GCC, deactivating OpenMP])
276 [AC_MSG_RESULT([$lt_version, OK])],
277 [AC_MSG_RESULT([$lt_version, OK])])
279 AC_SUBST(GOMP_LIBS) dnl Old libtool workaround end.
280 dnl Only necessary if libtool version < 2.4, as older
281 dnl versions don't pass on "-fopenmp" to the linker.
282 dnl One day, replace with LT_PREREQ([2.4]) above.
283 CFLAGS="$CFLAGS $OPENMP_CFLAGS"
286 dnl Check for magic library
288 AS_HELP_STRING([--without-magic],
289 [Don't try to use magic]))
291 if test "$with_magic" != "no"; then
293 AC_CHECK_HEADER(magic.h,
294 [AC_CHECK_LIB(magic, magic_open, MAGIC_LIBS="-lmagic",using_magic=no)],
296 if test "$with_magic" = "yes" -a "$using_magic" = "no"; then
297 AC_MSG_FAILURE([cannot find magic])
300 if test "$using_magic" = yes; then
301 AC_DEFINE(HAVE_MAGIC, 1, [Define to 1 if you have magic.])
303 AM_CONDITIONAL(HAVE_MAGIC, test x$using_magic = xyes)
308 dnl Check for png libraries
310 AS_HELP_STRING([--without-png],
311 [Don't try to use png]))
313 if test "$with_png" != "no"; then
314 AC_CHECK_HEADERS(png.h libpng/png.h,using_png=yes)
315 if test "$using_png" = "yes"; then
316 AC_CHECK_LIB(png, png_set_rows, PNG_LIBS="$PNG_LIBS -lpng -lz",
317 [AC_CHECK_LIB(png12, png_set_rows,
318 PNG_LIBS="$PNG_LIBS -lpng12 -lz",
319 using_png=no, -lz)], -lz)
321 if test "$with_png" = "yes" -a "$using_png" = "no"; then
322 AC_MSG_FAILURE([cannot find png])
325 if test "$using_png" = yes; then
326 AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have PNG.])
328 AM_CONDITIONAL(HAVE_PNG, test x$using_png = xyes)
335 AS_HELP_STRING([--without-ladspa], [Don't try to use LADSPA]))
337 if test "$with_ladspa" != "no" -a "$using_libltdl" = "yes"; then
339 AC_DEFINE(HAVE_LADSPA_H, 1, [1 if should enable LADSPA])
341 LADSPA_PATH=${libdir}/ladspa
342 AC_ARG_WITH(ladspa-path,
343 AS_HELP_STRING([--with-ladspa-path], [Default search path for LADSPA plugins]))
344 AC_SUBST(LADSPA_PATH)
348 dnl Check for MAD libraries
350 AS_HELP_STRING([--without-mad],
351 [Don't try to use MAD (MP3 Audio Decoder)]))
353 if test "$with_mad" != "no"; then
355 AC_CHECK_HEADERS(mad.h,, using_mad=no)
356 AC_MSG_CHECKING([whether to dlopen mad])
357 AC_ARG_ENABLE(dl_mad,
358 AS_HELP_STRING([--enable-dl-mad], [Dlopen mad instead of linking in.]),
359 enable_dl_mad=$enableval, enable_dl_mad=no)
360 AC_MSG_RESULT($enable_dl_mad)
361 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_mad" = "xyes"; then
362 AC_DEFINE(DL_MAD, 1, [Define to dlopen() mad.])
365 AC_CHECK_LIB(mad, mad_stream_buffer, MP3_LIBS="$MP3_LIBS -lmad",using_mad=no)
366 if test "$with_mad" = "yes" -a "$using_mad" = "no"; then
367 AC_MSG_FAILURE([cannot find libmad])
374 dnl Check for id3tag libraries
376 AS_HELP_STRING([--without-id3tag],
377 [Don't try to use id3tag]))
379 if test "$with_id3tag" != "no"; then
381 AC_CHECK_HEADER(id3tag.h,
382 [AC_CHECK_LIB(id3tag, id3_file_open, MP3_LIBS="$MP3_LIBS -lid3tag -lz",using_id3tag=no, -lz)],
384 if test "$with_id3tag" = "yes" -a "$using_id3tag" = "no"; then
385 AC_MSG_FAILURE([cannot find id3tag])
388 if test "$using_id3tag" = yes; then
389 AC_DEFINE(HAVE_ID3TAG, 1, [Define to 1 if you have id3tag.])
391 AM_CONDITIONAL(HAVE_ID3TAG, test x$using_id3tag = xyes)
395 dnl Check for LAME library.
397 AS_HELP_STRING([--without-lame],
398 [Don't try to use LAME (LAME Ain't an MP3 Encoder)]))
400 if test "$with_lame" != "no"; then
402 AC_MSG_CHECKING([whether to dlopen lame])
403 AC_ARG_ENABLE(dl_lame,
404 AS_HELP_STRING([--enable-dl-lame], [Dlopen lame instead of linking in.]),
405 enable_dl_lame=$enableval, enable_dl_lame=no)
406 AC_MSG_RESULT($enable_dl_lame)
407 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_lame" = "xyes"; then
408 AC_DEFINE(DL_LAME, 1, [Define to dlopen() lame.])
411 AC_CHECK_HEADERS(lame/lame.h,,
412 [AC_CHECK_HEADERS(lame.h, [], using_lame=no)])
413 AC_CHECK_LIB(mp3lame, lame_get_lametag_frame, MP3_LIBS="$MP3_LIBS -lmp3lame", using_lame=no)
414 AC_CHECK_LIB(mp3lame, id3tag_set_fieldvalue, using_lame=$using_lame)
415 if test "$ac_cv_lib_mp3lame_id3tag_set_fieldvalue" = yes; then
416 AC_DEFINE(HAVE_LAME_ID3TAG, 1, [Define to 1 if lame supports optional ID3 tags.])
418 if test "$with_lame" = "yes" -a "$using_lame" = "no"; then
419 AC_MSG_FAILURE([cannot find LAME])
426 dnl Check for Twolame library
428 AS_HELP_STRING([--without-twolame],
429 [Don't try to use Twolame (MP2 Audio Encoder)]))
431 if test "$with_twolame" != "no"; then
433 AC_CHECK_HEADERS(twolame.h,, using_twolame=no)
434 AC_MSG_CHECKING([whether to dlopen twolame])
435 AC_ARG_ENABLE(dl_twolame,
436 AS_HELP_STRING([--enable-dl-twolame], [Dlopen twolame instead of linking in.]),
437 enable_dl_twolame=$enableval, enable_dl_twolame=no)
438 AC_MSG_RESULT($enable_dl_twolame)
439 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_twolame" = "xyes"; then
440 AC_DEFINE(DL_TWOLAME, 1, [Define to dlopen() libtwolame.])
442 enable_dl_twolame="no"
443 AC_CHECK_LIB(twolame, twolame_init, MP3_LIBS="$MP3_LIBS -ltwolame",using_twolame=no)
444 if test "$with_twolame" = "yes" -a "$using_twolame" = "no"; then
445 AC_MSG_FAILURE([cannot find libtwolame])
452 AC_CHECK_HEADERS(gsm/gsm.h, ,
453 [AC_CHECK_HEADERS(gsm.h, ,found_libgsm=no)])
454 AC_CHECK_LIB(gsm, gsm_create, GSM_LIBS="$GSM_LIBS -lgsm", found_libgsm=no)
455 if test "$found_libgsm" = yes; then
456 AC_DEFINE(EXTERNAL_GSM, 1, [Define if you are using an external GSM library])
458 LIBGSM_LIBADD=../libgsm/libgsm.la
460 AM_CONDITIONAL(EXTERNAL_GSM, test x$found_libgsm = xyes)
461 AC_SUBST(LIBGSM_LIBADD)
467 AC_CHECK_HEADERS(lpc10.h, ,
468 [AC_CHECK_HEADERS(lpc10.h, ,found_liblpc10=no)])
469 AC_CHECK_LIB(lpc10, create_lpc10_encoder_state, LPC10_LIBS="$LPC10_LIBS -llpc10", found_liblpc10=no)
470 if test "$found_liblpc10" = yes; then
471 AC_DEFINE(EXTERNAL_LPC10, 1, [Define if you are using an external LPC10 library])
473 LIBLPC10_LIBADD=../lpc10/liblpc10.la
475 AM_CONDITIONAL(EXTERNAL_LPC10, test x$found_liblpc10 = xyes)
476 AC_SUBST(LIBLPC10_LIBADD)
480 # Check for Ogg Vorbis
481 AC_OPTIONAL_FORMAT(oggvorbis, OGG_VORBIS, [AC_CHECK_HEADER(vorbis/codec.h,
482 [AC_CHECK_LIB(ogg, ogg_packet_clear, OGG_VORBIS_LIBS="$OGG_VORBIS_LIBS -logg", using_oggvorbis=no)
483 AC_CHECK_LIB(vorbis, vorbis_analysis_headerout, OGG_VORBIS_LIBS="-lvorbis $OGG_VORBIS_LIBS", using_oggvorbis=no, $OGG_VORBIS_LIBS)
484 AC_CHECK_LIB(vorbisfile, ov_clear, OGG_VORBIS_LIBS="-lvorbisfile $OGG_VORBIS_LIBS", using_oggvorbis=no, $OGG_VORBIS_LIBS)
485 AC_CHECK_LIB(vorbisenc, vorbis_encode_init_vbr, OGG_VORBIS_LIBS="-lvorbisenc $OGG_VORBIS_LIBS", using_oggvorbis=no, $OGG_VORBIS_LIBS)],
486 using_oggvorbis=no)])
489 AC_OPTIONAL_FORMAT(opus, OPUS,
490 [PKG_CHECK_MODULES(OPUS, [opusfile], [], using_opus=no)],
492 if test "$GCC" = "yes"; then
493 OPUS_CFLAGS="$OPUS_CFLAGS -Wno-long-long"
497 # Check for FLAC libraries
498 # Note passing in OGG_VORBIS_LIBS. That is because FLAC has optional
499 # support for OGG and if OGG libraries are found on this
500 # system then its highly likely to be compiled into FLAC
501 # and will require these at link time.
504 FLAC_LIBS="-lwsock32"
507 AC_OPTIONAL_FORMAT(flac, FLAC, [AC_CHECK_HEADER(FLAC/all.h, [AC_CHECK_DECL(FLAC_API_VERSION_CURRENT, [AC_CHECK_LIB(FLAC, FLAC__stream_encoder_new, FLAC_LIBS="-lFLAC $FLAC_LIBS $OGG_VORBIS_LIBS",using_flac=no, $FLAC_LIBS $OGG_VORBIS_LIBS)], using_flac=no, [#include <FLAC/all.h>])], using_flac=no)], using_flac=no)
510 dnl When enable_dl_amrbw, do not let add libraries to be linked in
511 dnl since they will be dlopen()'ed instead.
512 ac_sox_save_AMRWB_LIBS="$AMRWB_LIBS"
513 tmp_using_amrwb=$opt_default
514 AC_CHECK_HEADERS(opencore-amrwb/dec_if.h,
515 [AC_CHECK_LIB(opencore-amrwb, D_IF_init,
516 AMRWB_LIBS="$AMRWB_LIBS -lopencore-amrwb", tmp_using_amrwb=no)],
517 [AC_CHECK_HEADERS(amrwb/dec.h,
518 [AC_CHECK_LIB(amrwb, D_IF_init,
519 AMRWB_LIBS="$AMRWB_LIBS -lamrwb",tmp_using_amrwb=no)],
520 tmp_using_amrwb=no)])
521 AC_ARG_ENABLE(dl_amrwb,
522 AS_HELP_STRING([--enable-dl-amrwb],
523 [Dlopen amrbw instead of linking in.]),
524 enable_dl_amrwb=$enableval, enable_dl_amrwb=no)
525 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_amrwb" = "xyes"; then
526 AC_DEFINE(DL_AMRWB, 1, [Define to dlopen() amrwb.])
527 dnl When enable_dl_amrwb, do not let SOX_PATH_AMRWB add libraries
528 dnl to be linked in (since they will be dlopen()'ed instead).
529 AMRWB_LIBS="$ac_sox_save_AMRWB_LIBS"
530 dnl Force to using regardless if headers or libraries were found.
535 AC_OPTIONAL_FORMAT(amrwb, AMRWB, [using_amrwb=$tmp_using_amrwb])
537 dnl When enable_dl_amrnb, do not let add libraries to be linked in
538 dnl since they will be dlopen()'ed instead.
539 ac_sox_save_AMRNB_LIBS="$AMRNB_LIBS"
540 tmp_using_amrnb=$opt_default
541 AC_CHECK_HEADERS(opencore-amrnb/interf_dec.h,
542 [AC_CHECK_LIB(opencore-amrnb, Decoder_Interface_init,
543 AMRNB_LIBS="$AMRNB_LIBS -lopencore-amrnb", tmp_using_amrnb=no)],
544 [AC_CHECK_HEADER(amrnb/sp_dec.h,
545 [AC_CHECK_LIB(amrnb, Decoder_Interface_init,
546 AMRNB_LIBS="$AMRNB_LIBS -lamrnb", tmp_using_amrnb=no)],
547 tmp_using_amrnb=no)])
548 AC_ARG_ENABLE(dl_amrnb,
549 AS_HELP_STRING([--enable-dl-amrnb],
550 [Dlopen amrnb instead of linking in.]),
551 enable_dl_amrnb=$enableval, enable_dl_amrnb=no)
552 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_amrnb" = "xyes"; then
553 AC_DEFINE(DL_AMRNB, 1, [Define to dlopen() amrnb.])
554 dnl When enable_dl_amrnb, do not let SOX_PATH_AMRNB add libraries
555 dnl to be linked in (since they will be dlopen()'ed instead).
556 AMRNB_LIBS="$ac_sox_save_AMRNB_LIBS"
557 dnl Force to using regardless if headers or libraries were found.
562 AC_OPTIONAL_FORMAT(amrnb, AMRNB, [using_amrnb=$tmp_using_amrnb])
565 AC_OPTIONAL_FORMAT(wavpack, WAVPACK, [AC_CHECK_HEADER(wavpack/wavpack.h, [AC_CHECK_LIB(wavpack, WavpackGetSampleRate, WAVPACK_LIBS="$WAVPACK_LIBS -lwavpack",using_wavpack=no)], using_wavpack=no)])
569 AC_OPTIONAL_FORMAT(sndio, SNDIO, [AC_CHECK_HEADER(sndio.h, [AC_CHECK_LIB(sndio, sio_open, SNDIO_LIBS="$SNDIO_LIBS -lsndio",using_sndio=no)], using_sndio=no)])
573 AC_OPTIONAL_FORMAT(coreaudio, COREAUDIO, [AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [COREAUDIO_LIBS="$COREAUDIO_LIBS -Wl,-framework,CoreAudio"], using_coreaudio=no)])
577 AC_OPTIONAL_FORMAT(alsa, ALSA, [AC_CHECK_HEADER(alsa/asoundlib.h, [AC_CHECK_LIB(asound, snd_pcm_open, ALSA_LIBS="$ALSA_LIBS -lasound",using_alsa=no)], using_alsa=no)])
581 AC_OPTIONAL_FORMAT(ao, AO, [AC_CHECK_HEADER(ao/ao.h, [AC_CHECK_LIB(ao, ao_play, AO_LIBS="$AO_LIBS -lao",using_ao=no)], using_ao=no)])
585 AC_OPTIONAL_FORMAT(pulseaudio, PULSEAUDIO, [AC_CHECK_HEADER(pulse/simple.h, [AC_CHECK_LIB(pulse, pa_simple_new, PULSEAUDIO_LIBS="$PULSEAUDIO_LIBS -lpulse -lpulse-simple",using_pulseaudio=no,"-lpulse-simple")], using_pulseaudio=no)])
588 AC_OPTIONAL_FORMAT(waveaudio, WAVEAUDIO, [AC_CHECK_HEADER(mmsystem.h, [WAVEAUDIO_LIBS="$WAVEAUDIO_LIBS -lwinmm"], using_waveaudio=no, [[#include <windows.h>]])])
590 dnl When enable_dl_sndfile, do not let SOX_PATH_SNDFILE add libraries
591 dnl to be linked in (since they will be dlopen()'ed instead).
592 ac_sox_save_SNDFILE_LIBS="$SNDFILE_LIBS"
593 SOX_PATH_SNDFILE(tmp_using_sndfile=$opt_default, tmp_using_sndfile=no)
594 AC_ARG_ENABLE(dl_sndfile,
595 AS_HELP_STRING([--enable-dl-sndfile],
596 [Dlopen sndfile instead of linking in.]),
597 enable_dl_sndfile=$enableval, enable_dl_sndfile=no)
598 if test "x$using_sndfile" = "xyes"; then
599 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_sndfile" = "xyes"; then
600 AC_DEFINE(DL_SNDFILE, 1, [Define to dlopen() sndfile.])
601 dnl When enable_dl_sndfile, do not let SOX_PATH_SNDFILE add libraries
602 dnl to be linked in (since they will be dlopen()'ed instead).
603 SNDFILE_LIBS="$ac_sox_save_SNDFILE_LIBS"
605 enable_dl_sndfile="no"
608 AC_OPTIONAL_FORMAT(sndfile, SNDFILE, [using_sndfile=$tmp_using_sndfile])
612 AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, using_oss=no)])
616 AC_OPTIONAL_FORMAT(sunaudio, SUN_AUDIO, [AC_CHECK_HEADERS(sys/audioio.h,,
617 [AC_CHECK_HEADERS(sun/audioio.h,, using_sunaudio=no)])])
621 # MP2/MP3 format depends on libmad || LAME || twolame
622 AC_OPTIONAL_FORMAT(mp3, MP3, [
623 if test "$using_mad" != yes -a "$using_lame" != yes -a "$using_twolame" != yes; then
629 # GSM format depends on libgsm
630 # No need to check; GSM is always found
631 AC_OPTIONAL_FORMAT(gsm, GSM)
635 # LPC10 format depends on liblpc10
636 # No need to check; LPC10 is always found
637 AC_OPTIONAL_FORMAT(lpc10, LPC10)
641 dnl Check if we want to disable all symlinks
642 AC_MSG_CHECKING([whether to enable symlinks])
643 AC_ARG_ENABLE(symlinks,
644 AS_HELP_STRING([--disable-symlinks], [Don't make any symlinks to sox.]),,enable_symlinks=yes)
645 AC_MSG_RESULT($enable_symlinks)
647 enable_playrec_symlinks=no
648 if test "$enable_symlinks" = "yes"; then
651 -o "$using_alsa" = yes \
652 -o "$using_ao" = yes \
653 -o "$using_coreaudio" = yes \
654 -o "$using_oss" = yes \
655 -o "$using_pulseaudio" = yes \
656 -o "$using_sndio" = yes \
659 enable_playrec_symlinks=yes
663 AC_SUBST(PLAYRECLINKS)
665 AM_CONDITIONAL(STATIC_LIBSOX_ONLY, test "$enable_shared" = "no" -a "$enable_static" = "yes")
667 dnl Generate output files.
668 AC_CONFIG_FILES(Makefile src/Makefile libgsm/Makefile lpc10/Makefile sox.pc)
671 if test "$using_gsm" != "no"; then
672 if test "$found_libgsm" = "yes"; then
673 gsm_option="(external)"
675 gsm_option="(in-tree)"
679 if test "$using_lpc10" != "no"; then
680 if test "$found_liblpc10" = "yes"; then
681 lpc10_option="(external)"
683 lpc10_option="(in-tree)"
687 if test "$using_pkgconfig" = "no"; then
688 pkgconfig_option="disabled"
690 pkgconfig_option="$with_pkgconfigdir"
693 # Report configuration.
696 echo "Debugging build............$enable_debug"
697 echo "Distro name ...............$DISTRO"
698 echo "Dynamic loading support....$using_libltdl"
699 echo "Pkg-config location........$pkgconfig_option"
700 echo "Play and rec symlinks......$enable_playrec_symlinks"
701 echo "Symlinks enabled...........$enable_symlinks"
703 echo "OPTIONAL DEVICE DRIVERS"
704 echo "ao (Xiph)..................$using_ao"
705 echo "alsa (Linux)...............$using_alsa"
706 echo "coreaudio (Mac OS X).......$using_coreaudio"
707 echo "sndio (OpenBSD)............$using_sndio"
708 echo "oss........................$using_oss"
709 echo "pulseaudio.................$using_pulseaudio"
710 echo "sunaudio...................$using_sunaudio"
711 echo "waveaudio (MS-Windows).....$using_waveaudio"
713 echo "OPTIONAL FILE FORMATS"
714 echo "amrnb......................$using_amrnb"
715 if test "x$using_amrnb" = "xyes"; then
716 echo " dlopen amrnb..............$enable_dl_amrnb"
718 echo "amrwb......................$using_amrwb"
719 if test "x$using_amrwb" = "xyes"; then
720 echo " dlopen amrwb..............$enable_dl_amrwb"
722 echo "flac.......................$using_flac"
723 echo "gsm........................$using_gsm $gsm_option"
724 echo "lpc10......................$using_lpc10 $lpc10_option"
725 echo "mp2/mp3....................$using_mp3"
726 echo " id3tag....................$using_id3tag"
727 echo " lame......................$using_lame"
728 if test "x$using_lame" = "xyes"; then
729 if test "x$enable_dl_lame" != "xyes"; then
730 echo " lame id3tag...............$ac_cv_lib_mp3lame_id3tag_set_fieldvalue"
732 echo " dlopen lame...............$enable_dl_lame"
734 echo " mad.......................$using_mad"
735 if test "x$using_mad" = "xyes"; then
736 echo " dlopen mad................$enable_dl_mad"
738 echo " twolame...................$using_twolame"
739 if test "x$using_twolame" = "xyes"; then
740 echo " dlopen twolame............$enable_dl_twolame"
742 echo "oggvorbis..................$using_oggvorbis"
743 echo "opus.......................$using_opus"
744 echo "sndfile....................$using_sndfile"
745 if test "x$using_sndfile" = "xyes"; then
746 echo " dlopen sndfile............$enable_dl_sndfile"
748 echo "wavpack....................$using_wavpack"
751 echo "ladspa effects.............$using_ladspa"
752 echo "magic support..............$using_magic"
753 echo "png support................$using_png"
754 if test "x$OPENMP_CFLAGS" = "x"; then
755 echo "OpenMP support.............no"
757 echo "OpenMP support.............yes, $OPENMP_CFLAGS"
760 echo "Configure finished. Do 'make -s && make install' to compile and install SoX."