build: simplify DISTRO definition
[sox.git] / configure.ac
blob84f251fecc3f4c86fed9649d395d3454a1716800
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.62)
4 LT_PREREQ(2.4)
6 AC_INIT(SoX, 14.4.3git, sox-devel@lists.sourceforge.net)
8 AC_CONFIG_MACRO_DIR([m4])
10 dnl Find target architecture
11 AC_CANONICAL_TARGET
13 AM_INIT_AUTOMAKE
14 AM_SILENT_RULES([yes])
16 dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
17 AC_CONFIG_HEADERS([src/soxconfig.h])
19 dnl Check we have the right srcdir
20 AC_CONFIG_SRCDIR(sox.1)
22 dnl Checks for programs.
23 AC_PROG_CC
24 AM_PROG_CC_C_O
25 AC_PROG_INSTALL
26 AC_PROG_LN_S
28 AX_APPEND_LINK_FLAGS([-Wl,--as-needed])
30 dnl Increase version when binary compatibility with previous version is broken
31 SHLIB_VERSION=3:0:0
32 AC_SUBST(SHLIB_VERSION)
34 AC_ARG_WITH(libltdl,
35     AS_HELP_STRING([--without-libltdl],
36         [Don't try to use libltdl for external dynamic library support]),
37     with_libltdl=$withval, with_libltdl=default)
39 if test "$with_libltdl" = "default"; then
40     dnl Default to no libltdl support when building only static libraries
41     if test "$enable_shared" != "no"; then
42         using_libltdl=yes
43     else
44         using_libltdl=no
45     fi
46     with_libltdl="yes"
47 else
48     using_libltdl=$with_libltdl
51 LT_INIT([dlopen win32-dll])
52 AC_SUBST(LIBTOOL_DEPS)
54 AC_ARG_WITH(dyn-default,AS_HELP_STRING([--with-dyn-default],[Default to loading optional formats dynamically]),opt_default=dyn,opt_default=yes)
56 PKG_PROG_PKG_CONFIG
57 PKG_INSTALLDIR
59 using_win32_glob="no"
60 case $target in
61   *mingw*)
62   using_win32_glob="yes"
63    ;;
64 esac
65 if test "$using_win32_glob" = yes; then
66    AC_DEFINE([HAVE_WIN32_GLOB_H], 1, [Define to 1 to use win32 glob])
68 AM_CONDITIONAL(HAVE_WIN32_GLOB, test x$using_win32_glob = xyes)
70 dnl Debugging
71 AC_MSG_CHECKING([whether to make a debug build])
72 AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [make a debug build]))
73 AC_MSG_RESULT($enable_debug)
74 if test "$enable_debug" = "yes"; then
75     CFLAGS="-g"
76     if test "$GCC" = "yes"; then
77         CFLAGS="$CFLAGS -ggdb"
78     fi
79 else
80     enable_debug=no
83 # -fstack-protector
84 AC_ARG_ENABLE([stack-protector],
85     [AS_HELP_STRING([--disable-stack-protector],
86         [Disable GCC's/libc's stack-smashing protection])],
87     [case "${enableval}" in
88          yes) enable_ssp=yes ;;
89           no) enable_ssp=no ;;
90            *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
91      esac],
92     [enable_ssp=yes])
94 if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
95     AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
96     enable_ssp=no
99 if test x"$enable_ssp" = x"yes"; then
100     # Check for broken ssp in libc: http://www.avahi.org/ticket/105
101     # libc's brokenness will get in the way regardless of whether -lssp is
102     # provided, but provide it anyway (otherwise non-libc ssp would wrongly
103     # break here)
105     # Get -lssp if it exists
106     GCC_STACK_PROTECT_LIB
108     AC_MSG_CHECKING([whether stack-smashing protection is available])
109     ssp_old_cflags="$CFLAGS"
110     ssp_old_ldflags="$LDFLAGS"
111     CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
112     LDFLAGS="$LDFLAGS -Wl,-z,defs"
113     cat confdefs.h > conftest.c
114     cat >>conftest.c <<_ACEOF
115 void test_broken_ssp(c)
116     const char *c;
118     char arr[[123]], *p; /* beware of possible double-braces if copying this */
119     for (p = arr; *c; ++p) {
120         *p = *c;
121         ++c;
122     }
124 _ACEOF
125     rm -f conftest.o
127     if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
128         AC_MSG_RESULT([yes])
129         AC_MSG_CHECKING([whether stack-smashing protection is buggy])
130         if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
131             AC_MSG_RESULT([no])
132         else
133             AC_MSG_RESULT([yes])
134             enable_ssp=no
135         fi
136     else
137         AC_MSG_RESULT([no])
138     fi
140     rm -f conftest.c conftest.o conftest.so
142     CFLAGS="$ssp_old_cflags"
143     LDFLAGS="$ssp_old_ldflags"
146 if test x"$enable_ssp" = x"yes"; then
147     # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
148     GCC_STACK_PROTECT_CC
150     # XXX: Update the enable_ssp value now for output later?
153 dnl Extra CFLAGS if we have gcc
154 if test "$GCC" = "yes"; then
155     CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes"
157     dnl Define stricter policy on GNU/Linux, all symbols must be resolved
158     case $target in
159       *linux* | *solaris*)
160         LDFLAGS="$LDFLAGS -Wl,-z,defs"
161         ;;
162       *os2* | *cygwin* | *mingw*)
163         APP_LDFLAGS="-no-undefined"
164         ;;
165     esac
167 AC_SUBST(APP_LDFLAGS)
169 AC_ARG_WITH(distro,
170     AS_HELP_STRING([--with-distro=name], [Provide distribution name]),
171     AC_DEFINE_UNQUOTED(DISTRO, ["$with_distro"], [Distribution name]))
173 dnl Check for system dependent features.
174 AC_C_BIGENDIAN
175 AC_C_INLINE
177 dnl Checks for header files.
178 AC_HEADER_STDC
179 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)
181 dnl Checks for library functions.
182 AC_CHECK_FUNCS(strcasecmp strdup popen vsnprintf gettimeofday mkstemp fmemopen sigaction)
184 dnl Check if math library is needed.
185 AC_SEARCH_LIBS([pow], [m])
186 AC_SEARCH_LIBS([lrint], [m])
187 AC_CHECK_FUNCS([lrint])
189 dnl Large File Support
190 AC_SYS_LARGEFILE
191 AC_FUNC_FSEEKO
193 dnl Allow libtool to be silenced
194 AC_MSG_CHECKING([whether libtool should be silenced])
195 AC_ARG_ENABLE(silent-libtool,
196     AS_HELP_STRING([--disable-silent-libtool], [Verbose libtool]),,enable_silent_libtool=yes)
197 AC_MSG_RESULT($enable_silent_libtool)
198 if test "$enable_silent_libtool" = "yes"; then
199     LIBTOOLFLAGS=--silent
201 AC_SUBST(LIBTOOLFLAGS)
203 dnl Check if ltdl should be enabled.
204 if test "$using_libltdl" != "no"; then
205     AC_CHECK_HEADERS(ltdl.h,
206                      AC_CHECK_LIB(ltdl, lt_dlinit, LIBLTDL="$LIBLTDL -lltdl",
207                                   using_libltdl=no), using_libltdl=no)
209 if test "$using_libltdl" = yes; then
210   AC_DEFINE([HAVE_LIBLTDL], 1, [Define to 1 if you have libltdl])
212 AM_CONDITIONAL(HAVE_LIBLTDL, test x$using_libltdl = xyes)
213 AC_SUBST(LIBLTDL)
216 dnl Check for OpenMP
217 AC_OPENMP
218 CFLAGS="$CFLAGS $OPENMP_CFLAGS"
221 dnl Check for magic library
222 AC_ARG_WITH(magic,
223     AS_HELP_STRING([--without-magic],
224         [Don't try to use magic]))
225 using_magic=no
226 if test "$with_magic" != "no"; then
227     using_magic=yes
228     AC_CHECK_HEADER(magic.h,
229         [AC_CHECK_LIB(magic, magic_open, MAGIC_LIBS="-lmagic",using_magic=no)],
230         using_magic=no)
231     if test "$with_magic" = "yes" -a "$using_magic" = "no"; then
232         AC_MSG_FAILURE([cannot find magic])
233     fi
235 if test "$using_magic" = yes; then
236    AC_DEFINE(HAVE_MAGIC, 1, [Define to 1 if you have magic.])
238 AM_CONDITIONAL(HAVE_MAGIC, test x$using_magic = xyes)
239 AC_SUBST(MAGIC_LIBS)
243 dnl Check for png libraries
244 AC_ARG_WITH(png,
245     AS_HELP_STRING([--without-png],
246         [Don't try to use png]))
247 using_png=no
248 if test "$with_png" != "no"; then
249     AC_CHECK_HEADERS(png.h libpng/png.h,using_png=yes)
250     if test "$using_png" = "yes"; then
251         AC_CHECK_LIB(png, png_set_rows, PNG_LIBS="$PNG_LIBS -lpng -lz", 
252                      [AC_CHECK_LIB(png12, png_set_rows, 
253                       PNG_LIBS="$PNG_LIBS -lpng12 -lz", 
254                       using_png=no, -lz)], -lz)
255     fi
256     if test "$with_png" = "yes" -a "$using_png" = "no"; then
257         AC_MSG_FAILURE([cannot find png])
258     fi
260 if test "$using_png" = yes; then
261    AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have PNG.])
263 AM_CONDITIONAL(HAVE_PNG, test x$using_png = xyes)
264 AC_SUBST(PNG_LIBS)
268 dnl Test for LADSPA
269 AC_ARG_WITH(ladspa,
270     AS_HELP_STRING([--without-ladspa], [Don't try to use LADSPA]))
271 using_ladspa=no
272 if test "$with_ladspa" != "no" -a "$using_libltdl" = "yes"; then
273     using_ladspa=yes
274     AC_DEFINE(HAVE_LADSPA_H, 1, [1 if should enable LADSPA])
276 LADSPA_PATH=${libdir}/ladspa
277 AC_ARG_WITH(ladspa-path,
278     AS_HELP_STRING([--with-ladspa-path], [Default search path for LADSPA plugins]))
279 AC_SUBST(LADSPA_PATH)
283 dnl Check for MAD libraries
284 AC_ARG_WITH(mad,
285     AS_HELP_STRING([--without-mad],
286         [Don't try to use MAD (MP3 Audio Decoder)]))
287 using_mad=no
288 if test "$with_mad" != "no"; then
289     using_mad=yes
290     AC_CHECK_HEADERS(mad.h,, using_mad=no)
291     AC_MSG_CHECKING([whether to dlopen mad])
292     AC_ARG_ENABLE(dl_mad,
293       AS_HELP_STRING([--enable-dl-mad], [Dlopen mad instead of linking in.]),
294       enable_dl_mad=$enableval, enable_dl_mad=no)
295     AC_MSG_RESULT($enable_dl_mad)
296     if test "x$using_libltdl" = "xyes" -a "x$enable_dl_mad" = "xyes"; then
297       AC_DEFINE(DL_MAD, 1, [Define to dlopen() mad.])
298     else
299       enable_dl_mad="no"
300       AC_CHECK_LIB(mad, mad_stream_buffer, MP3_LIBS="$MP3_LIBS -lmad",using_mad=no)
301       if test "$with_mad" = "yes" -a "$using_mad" = "no"; then
302         AC_MSG_FAILURE([cannot find libmad])
303       fi
304     fi
309 dnl Check for id3tag libraries
310 AC_ARG_WITH(id3tag,
311     AS_HELP_STRING([--without-id3tag],
312         [Don't try to use id3tag]))
313 using_id3tag=no
314 if test "$with_id3tag" != "no"; then
315     using_id3tag=yes
316     AC_CHECK_HEADER(id3tag.h,
317         [AC_CHECK_LIB(id3tag, id3_file_open, MP3_LIBS="$MP3_LIBS -lid3tag -lz",using_id3tag=no, -lz)],
318         using_id3tag=no)
319     if test "$with_id3tag" = "yes" -a "$using_id3tag" = "no"; then
320         AC_MSG_FAILURE([cannot find id3tag])
321     fi
323 if test "$using_id3tag" = yes; then
324    AC_DEFINE(HAVE_ID3TAG, 1, [Define to 1 if you have id3tag.])
326 AM_CONDITIONAL(HAVE_ID3TAG, test x$using_id3tag = xyes)
330 dnl Check for LAME library.
331 AC_ARG_WITH(lame,
332     AS_HELP_STRING([--without-lame],
333         [Don't try to use LAME (LAME Ain't an MP3 Encoder)]))
334 using_lame=no
335 if test "$with_lame" != "no"; then
336     using_lame=yes
337     AC_MSG_CHECKING([whether to dlopen lame])
338     AC_ARG_ENABLE(dl_lame,
339       AS_HELP_STRING([--enable-dl-lame], [Dlopen lame instead of linking in.]),
340       enable_dl_lame=$enableval, enable_dl_lame=no)
341     AC_MSG_RESULT($enable_dl_lame)
342     if test "x$using_libltdl" = "xyes" -a "x$enable_dl_lame" = "xyes"; then
343       AC_DEFINE(DL_LAME, 1, [Define to dlopen() lame.])
344     else
345       enable_dl_lame="no"
346       AC_CHECK_HEADERS(lame/lame.h,,
347         [AC_CHECK_HEADERS(lame.h, [], using_lame=no)])
348       AC_CHECK_LIB(mp3lame, lame_get_lametag_frame, MP3_LIBS="$MP3_LIBS -lmp3lame", using_lame=no)
349       if test "$with_lame" = "yes" -a "$using_lame" = "no"; then
350         AC_MSG_FAILURE([cannot find LAME])
351       fi
352     fi
357 dnl Check for Twolame library
358 AC_ARG_WITH(twolame,
359     AS_HELP_STRING([--without-twolame],
360         [Don't try to use Twolame (MP2 Audio Encoder)]))
361 using_twolame=no
362 if test "$with_twolame" != "no"; then
363     using_twolame=yes
364     AC_CHECK_HEADERS(twolame.h,, using_twolame=no)
365     AC_MSG_CHECKING([whether to dlopen twolame])
366     AC_ARG_ENABLE(dl_twolame,
367       AS_HELP_STRING([--enable-dl-twolame], [Dlopen twolame instead of linking in.]),
368       enable_dl_twolame=$enableval, enable_dl_twolame=no)
369     AC_MSG_RESULT($enable_dl_twolame)
370     if test "x$using_libltdl" = "xyes" -a "x$enable_dl_twolame" = "xyes"; then
371       AC_DEFINE(DL_TWOLAME, 1, [Define to dlopen() libtwolame.])
372     else
373       enable_dl_twolame="no"
374       AC_CHECK_LIB(twolame, twolame_init, MP3_LIBS="$MP3_LIBS -ltwolame",using_twolame=no)
375       if test "$with_twolame" = "yes" -a "$using_twolame" = "no"; then
376         AC_MSG_FAILURE([cannot find libtwolame])
377       fi
378     fi
381 # Check for libgsm
382 HAVE_LIBGSM=yes
383 AC_CHECK_HEADERS(gsm/gsm.h, ,
384     [AC_CHECK_HEADERS(gsm.h, , HAVE_LIBGSM=no)])
385     AC_CHECK_LIB(gsm, gsm_create, [
386         AC_DEFINE(HAVE_LIBGSM, 1, [Define if libgsm is available])
387         LIBGSM_LIBS="$LIBGSM_LIBS -lgsm"], HAVE_LIBGSM=no)
388 AC_SUBST(LIBGSM_LIBS)
392 # Check for liblpc10
393 found_liblpc10=yes
394 AC_CHECK_HEADERS(lpc10.h, ,
395     [AC_CHECK_HEADERS(lpc10.h, ,found_liblpc10=no)])
396     AC_CHECK_LIB(lpc10, create_lpc10_encoder_state, LPC10_LIBS="$LPC10_LIBS -llpc10", found_liblpc10=no)
397 if test "$found_liblpc10" = yes; then
398     AC_DEFINE(HAVE_LIBLPC10, 1, [Define if you are using an external liblpc10])
399 else
400     LPC10_CFLAGS='-I${top_srcdir}/lpc10'
401     LPC10_LIBS=../lpc10/liblpc10.la
403 AM_CONDITIONAL(HAVE_LIBLPC10, test x$found_liblpc10 = xyes)
407 # Check for Ogg Vorbis
408 AC_OPTIONAL_FORMAT(oggvorbis, OGGVORBIS, [AC_CHECK_HEADER(vorbis/codec.h,
409   [AC_CHECK_LIB(ogg, ogg_packet_clear, OGGVORBIS_LIBS="$OGGVORBIS_LIBS -logg", using_oggvorbis=no)
410   AC_CHECK_LIB(vorbis, vorbis_analysis_headerout, OGGVORBIS_LIBS="-lvorbis $OGGVORBIS_LIBS", using_oggvorbis=no, $OGGVORBIS_LIBS)
411   AC_CHECK_LIB(vorbisfile, ov_clear, OGGVORBIS_LIBS="-lvorbisfile $OGGVORBIS_LIBS", using_oggvorbis=no, $OGGVORBIS_LIBS)
412   AC_CHECK_LIB(vorbisenc, vorbis_encode_init_vbr, OGGVORBIS_LIBS="-lvorbisenc $OGGVORBIS_LIBS", using_oggvorbis=no, $OGGVORBIS_LIBS)],
413   using_oggvorbis=no)])
415 # Check for Opus
416 AC_OPTIONAL_FORMAT(opus, OPUS,
417   [PKG_CHECK_MODULES(OPUS, [opusfile], [], using_opus=no)],
418   using_opus=no)
421 dnl Check for FLAC library
422 AC_OPTIONAL_FORMAT(flac, FLAC,
423     [PKG_CHECK_MODULES([FLAC], [flac], [], [using_flac=no])])
426 tmp_using_amrwb=no
427 AC_CHECK_HEADERS(opencore-amrwb/dec_if.h,
428     [AC_CHECK_LIB(opencore-amrwb, D_IF_init,
429         [OPENCORE_AMRWB_LIBS="$OPENCORE_AMRWB_LIBS -lopencore-amrwb"; tmp_using_amrwb=$opt_default])])
430 AC_CHECK_HEADERS(vo-amrwbenc/enc_if.h,
431     [AC_CHECK_LIB(vo-amrwbenc, E_IF_init,
432         [VO_AMRWBENC_LIBS="$VO_AMRWBENC_LIBS -lvo-amrwbenc"; tmp_using_amrwb=$opt_default])])
433 AC_ARG_ENABLE(dl_opencore_amrwb,
434               AS_HELP_STRING([--enable-dl-opencore-amrwb],
435                              [Dlopen opencore-amrbw instead of linking in.]))
436 AC_ARG_ENABLE(dl_vo_amrwbenc,
437               AS_HELP_STRING([--enable-dl-vo-amrwbenc],
438                              [Dlopen vo-amrbwenc instead of linking in.]))
439 if test "$using_libltdl" != "yes"; then
440   enable_dl_opencore_amrwb=no
441   enable_dl_vo_amrwbenc=no
443 if test "$enable_dl_opencore_amrwb" = "yes"; then
444   AC_DEFINE(DL_OPENCORE_AMRWB, 1, [Define to dlopen() opencore-amrwb.])
445 else
446   AMRWB_LIBS="$AMRWB_LIBS $OPENCORE_AMRWB_LIBS"
448 if test "$enable_dl_vo_amrwbenc" = "yes"; then
449   AC_DEFINE(DL_VO_AMRWBENC, 1, [Define to dlopen() vo-amrwbenc.])
450 else
451   AMRWB_LIBS="$AMRWB_LIBS $VO_AMRWBENC_LIBS"
453 AC_OPTIONAL_FORMAT(amrwb, AMRWB, [using_amrwb=$tmp_using_amrwb])
455 dnl When enable_dl_amrnb, do not let add libraries to be linked in
456 dnl since they will be dlopen()'ed instead.
457 ac_sox_save_AMRNB_LIBS="$AMRNB_LIBS"
458 tmp_using_amrnb=$opt_default
459 AC_CHECK_HEADERS(opencore-amrnb/interf_dec.h, 
460                  [AC_CHECK_LIB(opencore-amrnb, Decoder_Interface_init, 
461                   AMRNB_LIBS="$AMRNB_LIBS -lopencore-amrnb", tmp_using_amrnb=no)],
462                   [tmp_using_amrnb=no])
463 AC_ARG_ENABLE(dl_opencore_amrnb,
464               AS_HELP_STRING([--enable-dl-opencore-amrnb],
465                              [Dlopen opencore-amrnb instead of linking in.]))
466 if test "$using_libltdl" = "yes" -a "$enable_dl_opencore_amrnb" = "yes"; then
467   AC_DEFINE(DL_OPENCORE_AMRNB, 1, [Define to dlopen() opencore-amrnb.])
468   dnl When enable_dl_amrnb, do not let SOX_PATH_AMRNB add libraries
469   dnl to be linked in (since they will be dlopen()'ed instead).
470   AMRNB_LIBS="$ac_sox_save_AMRNB_LIBS"
471   dnl Force to using regardless if headers or libraries were found.
472   tmp_using_amrnb=yes
473 else
474   enable_dl_opencore_amrnb="no"
476 AC_OPTIONAL_FORMAT(amrnb, AMRNB, [using_amrnb=$tmp_using_amrnb])
479 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)])
483 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)])
487 AC_OPTIONAL_FORMAT(coreaudio, COREAUDIO, [AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [COREAUDIO_LIBS="$COREAUDIO_LIBS -Wl,-framework,CoreAudio"], using_coreaudio=no)])
491 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)])
495 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)])
499 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)])
502 AC_OPTIONAL_FORMAT(waveaudio, WAVEAUDIO, [AC_CHECK_HEADER(mmsystem.h, [WAVEAUDIO_LIBS="$WAVEAUDIO_LIBS -lwinmm"], using_waveaudio=no, [[#include <windows.h>]])])
504 dnl When enable_dl_sndfile, do not let SOX_PATH_SNDFILE add libraries
505 dnl to be linked in (since they will be dlopen()'ed instead).
506 ac_sox_save_SNDFILE_LIBS="$LIBSNDFILE_LIBS"
507 SOX_PATH_SNDFILE(tmp_using_sndfile=$opt_default, tmp_using_sndfile=no)
508 AC_ARG_ENABLE(dl_sndfile,
509               AS_HELP_STRING([--enable-dl-sndfile], 
510                              [Dlopen sndfile instead of linking in.]),
511                              enable_dl_sndfile=$enableval, enable_dl_sndfile=no)
512 if test "x$tmp_using_sndfile" = "xyes"; then
513   if test "x$using_libltdl" = "xyes" -a "x$enable_dl_sndfile" = "xyes"; then
514     AC_DEFINE(DL_LIBSNDFILE, 1, [Define to dlopen() sndfile.])
515     dnl When enable_dl_sndfile, do not let SOX_PATH_SNDFILE add libraries
516     dnl to be linked in (since they will be dlopen()'ed instead).
517     LIBSNDFILE_LIBS="$ac_sox_save_SNDFILE_LIBS"
518   else
519     enable_dl_sndfile="no"
520   fi
522 AC_OPTIONAL_FORMAT(sndfile, SNDFILE, [using_sndfile=$tmp_using_sndfile])
526 AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, using_oss=no)])
530 AC_OPTIONAL_FORMAT(sunaudio, SUNAUDIO, [AC_CHECK_HEADERS(sys/audioio.h,,
531       [AC_CHECK_HEADERS(sun/audioio.h,, using_sunaudio=no)])])
535 # MP2/MP3 format depends on libmad || LAME || twolame
536 AC_OPTIONAL_FORMAT(mp3, MP3, [
537   if test "$using_mad" != yes -a "$using_lame" != yes -a "$using_twolame" != yes; then
538     using_mp3=no
539   fi])
543 # GSM format depends on libgsm
544 AC_OPTIONAL_FORMAT(gsm, GSM, [using_gsm=$HAVE_LIBGSM])
548 # LPC10 format depends on liblpc10
549 # No need to check; LPC10 is always found
550 AC_OPTIONAL_FORMAT(lpc10, LPC10)
554 dnl Check if we want to disable all symlinks
555 AC_MSG_CHECKING([whether to enable symlinks])
556 AC_ARG_ENABLE(symlinks,
557     AS_HELP_STRING([--disable-symlinks], [Don't make any symlinks to sox.]),,enable_symlinks=yes)
558 AC_MSG_RESULT($enable_symlinks)
560 if test "$enable_symlinks" = "yes"; then
561   SYMLINKS=soxi
562   if test "" \
563       -o "$using_alsa" = yes \
564       -o "$using_ao" = yes \
565       -o "$using_coreaudio" = yes \
566       -o "$using_oss" = yes \
567       -o "$using_pulseaudio" = yes \
568       -o "$using_sndio" = yes \
569       -o "$using_sunaudio" = yes \
570       -o "$using_waveaudio" = yes \
571     ; then
572     SYMLINKS="$SYMLINKS play rec"
573   fi
575 AC_SUBST(SYMLINKS)
577 AM_CONDITIONAL(STATIC_LIBSOX_ONLY, test "$enable_shared" = "no" -a "$enable_static" = "yes")
579 dnl Generate output files.
580 AC_CONFIG_FILES(Makefile src/Makefile lpc10/Makefile sox.pc)
581 AC_OUTPUT
583 if test "$using_lpc10" != "no"; then
584   if test "$found_liblpc10" = "yes"; then
585     lpc10_option="(external)"
586   else
587     lpc10_option="(in-tree)"
588   fi
591 # Report configuration.
592 echo
593 echo "BUILD OPTIONS"
594 echo "Debugging build............$enable_debug"
595 echo "Distro name ...............${with_distro:-unspecified}"
596 echo "Dynamic loading support....$using_libltdl"
597 echo "Pkg-config location........$pkgconfigdir"
598 echo "Symlinks enabled...........${SYMLINKS:-no}"
599 echo
600 echo "OPTIONAL DEVICE DRIVERS"
601 echo "ao (Xiph)..................$using_ao"
602 echo "alsa (Linux)...............$using_alsa"
603 echo "coreaudio (Mac OS X).......$using_coreaudio"
604 echo "sndio (OpenBSD)............$using_sndio"
605 echo "oss........................$using_oss"
606 echo "pulseaudio.................$using_pulseaudio"
607 echo "sunaudio...................$using_sunaudio"
608 echo "waveaudio (MS-Windows).....$using_waveaudio"
609 echo
610 echo "OPTIONAL FILE FORMATS"
611 echo "amrnb......................$using_amrnb"
612 if test "x$using_amrnb" = "xyes"; then
613 echo " dlopen amrnb..............${enable_dl_opencore_amrnb:-no}"
615 echo "amrwb......................$using_amrwb"
616 if test "x$using_amrwb" = "xyes"; then
617 echo " dlopen opencore-amrwb.....${enable_dl_opencore_amrwb:-no}"
618 echo " dlopen vo-amrwbenc........${enable_dl_vo_amrwbenc:-no}"
620 echo "flac.......................$using_flac"
621 echo "gsm........................$using_gsm"
622 echo "lpc10......................$using_lpc10 $lpc10_option"
623 echo "mp2/mp3....................$using_mp3"
624 echo " id3tag....................$using_id3tag"
625 echo " lame......................$using_lame"
626 if test "x$using_lame" = "xyes"; then
627 echo " dlopen lame...............$enable_dl_lame"
629 echo " mad.......................$using_mad"
630 if test "x$using_mad" = "xyes"; then
631 echo " dlopen mad................$enable_dl_mad"
633 echo " twolame...................$using_twolame"
634 if test "x$using_twolame" = "xyes"; then
635 echo " dlopen twolame............$enable_dl_twolame"
637 echo "oggvorbis..................$using_oggvorbis"
638 echo "opus.......................$using_opus"
639 echo "sndfile....................$using_sndfile"
640 if test "x$using_sndfile" = "xyes"; then
641 echo " dlopen sndfile............$enable_dl_sndfile"
643 echo "wavpack....................$using_wavpack"
644 echo
645 echo "OTHER OPTIONS"
646 echo "ladspa effects.............$using_ladspa"
647 echo "magic support..............$using_magic"
648 echo "png support................$using_png"
649 if test "x$OPENMP_CFLAGS" = "x"; then
650 echo "OpenMP support.............no"
651 else
652 echo "OpenMP support.............yes, $OPENMP_CFLAGS"
654 echo
655 echo "Configure finished.  Do 'make -s && make install' to compile and install SoX."
656 echo