1dnl Process this file with autoconf to produce a configure script. 2 3AC_PREREQ(2.62) 4 5AC_INIT(SoX, 14.4.2, sox-devel@lists.sourceforge.net) 6 7AC_CONFIG_MACRO_DIR([m4]) 8 9dnl Find target architecture 10AC_CANONICAL_TARGET 11 12AM_INIT_AUTOMAKE 13AM_SILENT_RULES([yes]) 14 15dnl create a config.h file (Automake will add -DHAVE_CONFIG_H) 16AC_CONFIG_HEADERS([src/soxconfig.h]) 17 18dnl Check we have the right srcdir 19AC_CONFIG_SRCDIR(sox.1) 20 21dnl Checks for programs. 22AC_PROG_CC 23AM_PROG_CC_C_O 24AC_PROG_INSTALL 25AC_PROG_LN_S 26 27dnl Increase version when binary compatibility with previous version is broken 28SHLIB_VERSION=3:0:0 29AC_SUBST(SHLIB_VERSION) 30 31AC_ARG_WITH(libltdl, 32 AS_HELP_STRING([--without-libltdl], 33 [Don't try to use libltdl for external dynamic library support]), 34 with_libltdl=$withval, with_libltdl=default) 35 36if test "$with_libltdl" = "default"; then 37 dnl Default to no libltdl support when building only static libraries 38 if test "$enable_shared" != "no"; then 39 using_libltdl=yes 40 else 41 using_libltdl=no 42 fi 43 with_libltdl="yes" 44else 45 using_libltdl=$with_libltdl 46fi 47 48LT_INIT([dlopen win32-dll]) 49AC_SUBST(LIBTOOL_DEPS) 50 51AC_ARG_WITH(dyn-default,AS_HELP_STRING([--with-dyn-default],[Default to loading optional formats dynamically]),opt_default=dyn,opt_default=yes) 52 53AC_ARG_WITH(pkgconfigdir, 54 AS_HELP_STRING([--with-pkgconfigdir], 55 [location to install .pc files or "no" to disable (default=$(libdir)/pkgconfig)])) 56 57m4_ifndef([PKG_PROG_PKG_CONFIG], with_pkgconfigdir="no") 58 59using_pkgconfig=no 60if test "$with_pkgconfigdir" != "no"; then 61 if test "$with_pkgconfigdir" = ""; then 62 with_pkgconfigdir="\$(libdir)/pkgconfig" 63 fi 64 using_pkgconfig="yes" 65 PKG_PROG_PKG_CONFIG 66fi 67AM_CONDITIONAL(HAVE_PKGCONFIG, test x$using_pkgconfig = xyes) 68AC_SUBST(PKGCONFIGDIR, $with_pkgconfigdir) 69 70using_win32_glob="no" 71case $target in 72 *mingw*) 73 using_win32_glob="yes" 74 ;; 75esac 76if test "$using_win32_glob" = yes; then 77 AC_DEFINE([HAVE_WIN32_GLOB_H], 1, [Define to 1 to use win32 glob]) 78fi 79AM_CONDITIONAL(HAVE_WIN32_GLOB, test x$using_win32_glob = xyes) 80 81dnl Debugging 82AC_MSG_CHECKING([whether to make a debug build]) 83AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [make a debug build])) 84AC_MSG_RESULT($enable_debug) 85if test "$enable_debug" = "yes"; then 86 CFLAGS="-g" 87 if test "$GCC" = "yes"; then 88 CFLAGS="$CFLAGS -ggdb" 89 fi 90else 91 enable_debug=no 92fi 93 94# -fstack-protector 95AC_ARG_ENABLE([stack-protector], 96 [AS_HELP_STRING([--disable-stack-protector], 97 [Disable GCC's/libc's stack-smashing protection])], 98 [case "${enableval}" in 99 yes) enable_ssp=yes ;; 100 no) enable_ssp=no ;; 101 *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;; 102 esac], 103 [enable_ssp=yes]) 104 105if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then 106 AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC]) 107 enable_ssp=no 108fi 109 110if test x"$enable_ssp" = x"yes"; then 111 # Check for broken ssp in libc: http://www.avahi.org/ticket/105 112 # libc's brokenness will get in the way regardless of whether -lssp is 113 # provided, but provide it anyway (otherwise non-libc ssp would wrongly 114 # break here) 115 116 # Get -lssp if it exists 117 GCC_STACK_PROTECT_LIB 118 119 AC_MSG_CHECKING([whether stack-smashing protection is available]) 120 ssp_old_cflags="$CFLAGS" 121 ssp_old_ldflags="$LDFLAGS" 122 CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC" 123 LDFLAGS="$LDFLAGS -Wl,-z,defs" 124 cat confdefs.h > conftest.c 125 cat >>conftest.c <<_ACEOF 126void test_broken_ssp(c) 127 const char *c; 128{ 129 char arr[[123]], *p; /* beware of possible double-braces if copying this */ 130 for (p = arr; *c; ++p) { 131 *p = *c; 132 ++c; 133 } 134} 135_ACEOF 136 rm -f conftest.o 137 138 if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then 139 AC_MSG_RESULT([yes]) 140 AC_MSG_CHECKING([whether stack-smashing protection is buggy]) 141 if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then 142 AC_MSG_RESULT([no]) 143 else 144 AC_MSG_RESULT([yes]) 145 enable_ssp=no 146 fi 147 else 148 AC_MSG_RESULT([no]) 149 fi 150 151 rm -f conftest.c conftest.o conftest.so 152 153 CFLAGS="$ssp_old_cflags" 154 LDFLAGS="$ssp_old_ldflags" 155fi 156 157if test x"$enable_ssp" = x"yes"; then 158 # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice 159 GCC_STACK_PROTECT_CC 160 161 # XXX: Update the enable_ssp value now for output later? 162fi 163 164dnl Extra CFLAGS if we have gcc 165if test "$GCC" = "yes"; then 166 167 AC_MSG_CHECKING([gcc version]) 168 gccver=`$CC -dumpversion` 169 AC_MSG_RESULT($gccver) 170 171 CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic" 172 173 AS_VERSION_COMPARE([$gccver], [4.3], 174 [WARN_CFLAGS="-Wconversion"], 175 [WARN_CFLAGS="-Wtraditional-conversion"], 176 [WARN_CFLAGS="-Wtraditional-conversion"]) 177 dnl Define stricter policy on GNU/Linux, all symbols must be resolved 178 case $target in 179 *linux* | *solaris*) 180 LDFLAGS="$LDFLAGS -Wl,-z,defs" 181 ;; 182 *os2* | *cygwin* | *mingw*) 183 APP_LDFLAGS="-no-undefined" 184 ;; 185 esac 186fi 187AC_SUBST(APP_LDFLAGS) 188AC_SUBST(WARN_CFLAGS) 189 190AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=distro], [Provide distribution name])) 191if test "x$with_distro" != "x"; then 192 DISTRO="$with_distro" 193 AC_SUBST(DISTRO) 194 AC_DEFINE(HAVE_DISTRO, 1, [1 if DISTRO is defined]) 195 have_distro=yes 196else 197 DISTRO="not specified!" 198fi 199AM_CONDITIONAL(HAVE_DISTRO, test x$have_distro = xyes) 200 201dnl Check for system dependent features. 202AC_C_BIGENDIAN 203AC_C_INLINE 204 205dnl Checks for header files. 206AC_HEADER_STDC 207AC_CHECK_HEADERS(fcntl.h unistd.h byteswap.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/utsname.h termios.h glob.h fenv.h) 208 209dnl Checks for library functions. 210AC_CHECK_FUNCS(strcasecmp strdup popen vsnprintf gettimeofday mkstemp fmemopen) 211 212dnl Check if math library is needed. 213AC_SEARCH_LIBS([pow], [m]) 214AC_SEARCH_LIBS([lrint], [m]) 215AC_CHECK_FUNCS([lrint]) 216 217dnl Large File Support 218AC_SYS_LARGEFILE 219AC_FUNC_FSEEKO 220if test "$ac_cv_sys_file_offset_bits" = "64"; then 221 dnl This is either a 64-bit platform or a 32-bit platform 222 dnl that supports large files. 223 dnl There are to many broken glibc+kernel's out there that 224 dnl detect 64-bit off_t on 32-bit system and require 225 dnl _LARGEFILE_SOURCE to make fseeko() go into 64-bit mode. 226 dnl Force defining _LARGEFILE_SOURCE always. My assumption 227 dnl is its harmlessly ignored on 64-bit platforms and platforms 228 dnl that chose other solutions. 229 AC_MSG_NOTICE(Forcing _LARGEFILE_SOURCE to be safe since off_t is 64 bits) 230 AC_DEFINE(_LARGEFILE_SOURCE, 1) 231fi 232 233dnl Allow libtool to be silenced 234AC_MSG_CHECKING([whether libtool should be silenced]) 235AC_ARG_ENABLE(silent-libtool, 236 AS_HELP_STRING([--disable-silent-libtool], [Verbose libtool]),,enable_silent_libtool=yes) 237AC_MSG_RESULT($enable_silent_libtool) 238if test "$enable_silent_libtool" = "yes"; then 239 LIBTOOLFLAGS=--silent 240fi 241AC_SUBST(LIBTOOLFLAGS) 242 243dnl Check if ltdl should be enabled. 244using_win32_ltdl="no" 245if test "$using_libltdl" != "no"; then 246 case $target in 247 *mingw*) 248 AC_DEFINE([HAVE_WIN32_LTDL_H], 1, [Define to 1 to use internal win32 ltdl]) 249 LIBLTDL="" 250 using_win32_ltdl="yes" 251 ;; 252 *) 253 AC_CHECK_HEADERS(ltdl.h, 254 AC_CHECK_LIB(ltdl, lt_dlinit, LIBLTDL="$LIBLTDL -lltdl", 255 using_libltdl=no), using_libltdl=no) 256 ;; 257 esac 258fi 259if test "$using_libltdl" = yes; then 260 AC_DEFINE([HAVE_LIBLTDL], 1, [Define to 1 if you have libltdl]) 261fi 262AM_CONDITIONAL(HAVE_LIBLTDL, test x$using_libltdl = xyes -a x$using_win32_ltdl = xno) 263AM_CONDITIONAL(HAVE_WIN32_LTDL, test x$using_win32_ltdl = xyes) 264AC_SUBST(LIBLTDL) 265 266 267dnl Check for OpenMP 268AC_OPENMP 269if test "x$OPENMP_CFLAGS" != "x"; then dnl Old libtool workaround start 270 AC_MSG_CHECKING([for libtool version]) 271 lt_version="`grep '^VERSION' $srcdir/ltmain.sh | sed -e 's/VERSION\=//g;s/ .*//g;s/"//g'`" 272 AS_VERSION_COMPARE([$lt_version], [2.4], 273 [AS_IF([test "$GCC" = "yes"], 274 [AC_MSG_RESULT([$lt_version, needs OpenMP linker workaround]) 275 GOMP_LIBS="-lgomp"], 276 [AC_MSG_RESULT([$lt_version and not GCC, deactivating OpenMP]) 277 OPENMP_CFLAGS=""])], 278 [AC_MSG_RESULT([$lt_version, OK])], 279 [AC_MSG_RESULT([$lt_version, OK])]) 280fi 281AC_SUBST(GOMP_LIBS) dnl Old libtool workaround end. 282 dnl Only necessary if libtool version < 2.4, as older 283 dnl versions don't pass on "-fopenmp" to the linker. 284 dnl One day, replace with LT_PREREQ([2.4]) above. 285CFLAGS="$CFLAGS $OPENMP_CFLAGS" 286 287 288dnl Check for magic library 289AC_ARG_WITH(magic, 290 AS_HELP_STRING([--without-magic], 291 [Don't try to use magic])) 292using_magic=no 293if test "$with_magic" != "no"; then 294 using_magic=yes 295 AC_CHECK_HEADER(magic.h, 296 [AC_CHECK_LIB(magic, magic_open, MAGIC_LIBS="-lmagic",using_magic=no)], 297 using_magic=no) 298 if test "$with_magic" = "yes" -a "$using_magic" = "no"; then 299 AC_MSG_FAILURE([cannot find magic]) 300 fi 301fi 302if test "$using_magic" = yes; then 303 AC_DEFINE(HAVE_MAGIC, 1, [Define to 1 if you have magic.]) 304fi 305AM_CONDITIONAL(HAVE_MAGIC, test x$using_magic = xyes) 306AC_SUBST(MAGIC_LIBS) 307 308 309 310dnl Check for png libraries 311AC_ARG_WITH(png, 312 AS_HELP_STRING([--without-png], 313 [Don't try to use png])) 314using_png=no 315if test "$with_png" != "no"; then 316 AC_CHECK_HEADERS(png.h libpng/png.h,using_png=yes) 317 if test "$using_png" = "yes"; then 318 AC_CHECK_LIB(png, png_set_rows, PNG_LIBS="$PNG_LIBS -lpng -lz", 319 [AC_CHECK_LIB(png12, png_set_rows, 320 PNG_LIBS="$PNG_LIBS -lpng12 -lz", 321 using_png=no, -lz)], -lz) 322 fi 323 if test "$with_png" = "yes" -a "$using_png" = "no"; then 324 AC_MSG_FAILURE([cannot find png]) 325 fi 326fi 327if test "$using_png" = yes; then 328 AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have PNG.]) 329fi 330AM_CONDITIONAL(HAVE_PNG, test x$using_png = xyes) 331AC_SUBST(PNG_LIBS) 332 333 334 335dnl Test for LADSPA 336AC_ARG_WITH(ladspa, 337 AS_HELP_STRING([--without-ladspa], [Don't try to use LADSPA])) 338using_ladspa=no 339if test "$with_ladspa" != "no" -a "$using_libltdl" = "yes"; then 340 using_ladspa=yes 341 AC_DEFINE(HAVE_LADSPA_H, 1, [1 if should enable LADSPA]) 342fi 343LADSPA_PATH=${libdir}/ladspa 344AC_ARG_WITH(ladspa-path, 345 AS_HELP_STRING([--with-ladspa-path], [Default search path for LADSPA plugins])) 346AC_SUBST(LADSPA_PATH) 347 348 349 350dnl Check for MAD libraries 351AC_ARG_WITH(mad, 352 AS_HELP_STRING([--without-mad], 353 [Don't try to use MAD (MP3 Audio Decoder)])) 354using_mad=no 355if test "$with_mad" != "no"; then 356 using_mad=yes 357 AC_CHECK_HEADERS(mad.h,, using_mad=no) 358 AC_MSG_CHECKING([whether to dlopen mad]) 359 AC_ARG_ENABLE(dl_mad, 360 AS_HELP_STRING([--enable-dl-mad], [Dlopen mad instead of linking in.]), 361 enable_dl_mad=$enableval, enable_dl_mad=no) 362 AC_MSG_RESULT($enable_dl_mad) 363 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_mad" = "xyes"; then 364 AC_DEFINE(DL_MAD, 1, [Define to dlopen() mad.]) 365 else 366 enable_dl_mad="no" 367 AC_CHECK_LIB(mad, mad_stream_buffer, MP3_LIBS="$MP3_LIBS -lmad",using_mad=no) 368 if test "$with_mad" = "yes" -a "$using_mad" = "no"; then 369 AC_MSG_FAILURE([cannot find libmad]) 370 fi 371 fi 372fi 373 374 375 376dnl Check for id3tag libraries 377AC_ARG_WITH(id3tag, 378 AS_HELP_STRING([--without-id3tag], 379 [Don't try to use id3tag])) 380using_id3tag=no 381if test "$with_id3tag" != "no"; then 382 using_id3tag=yes 383 AC_CHECK_HEADER(id3tag.h, 384 [AC_CHECK_LIB(id3tag, id3_file_open, MP3_LIBS="$MP3_LIBS -lid3tag -lz",using_id3tag=no, -lz)], 385 using_id3tag=no) 386 if test "$with_id3tag" = "yes" -a "$using_id3tag" = "no"; then 387 AC_MSG_FAILURE([cannot find id3tag]) 388 fi 389fi 390if test "$using_id3tag" = yes; then 391 AC_DEFINE(HAVE_ID3TAG, 1, [Define to 1 if you have id3tag.]) 392fi 393AM_CONDITIONAL(HAVE_ID3TAG, test x$using_id3tag = xyes) 394 395 396 397dnl Check for LAME library. 398AC_ARG_WITH(lame, 399 AS_HELP_STRING([--without-lame], 400 [Don't try to use LAME (LAME Ain't an MP3 Encoder)])) 401using_lame=no 402if test "$with_lame" != "no"; then 403 using_lame=yes 404 AC_MSG_CHECKING([whether to dlopen lame]) 405 AC_ARG_ENABLE(dl_lame, 406 AS_HELP_STRING([--enable-dl-lame], [Dlopen lame instead of linking in.]), 407 enable_dl_lame=$enableval, enable_dl_lame=no) 408 AC_MSG_RESULT($enable_dl_lame) 409 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_lame" = "xyes"; then 410 AC_DEFINE(DL_LAME, 1, [Define to dlopen() lame.]) 411 else 412 enable_dl_lame="no" 413 AC_CHECK_HEADERS(lame/lame.h,, 414 [AC_CHECK_HEADERS(lame.h, [], using_lame=no)]) 415 AC_CHECK_LIB(mp3lame, lame_get_lametag_frame, MP3_LIBS="$MP3_LIBS -lmp3lame", using_lame=no) 416 AC_CHECK_LIB(mp3lame, id3tag_set_fieldvalue, using_lame=$using_lame) 417 if test "$ac_cv_lib_mp3lame_id3tag_set_fieldvalue" = yes; then 418 AC_DEFINE(HAVE_LAME_ID3TAG, 1, [Define to 1 if lame supports optional ID3 tags.]) 419 fi 420 if test "$with_lame" = "yes" -a "$using_lame" = "no"; then 421 AC_MSG_FAILURE([cannot find LAME]) 422 fi 423 fi 424fi 425 426 427 428dnl Check for Twolame library 429AC_ARG_WITH(twolame, 430 AS_HELP_STRING([--without-twolame], 431 [Don't try to use Twolame (MP2 Audio Encoder)])) 432using_twolame=no 433if test "$with_twolame" != "no"; then 434 using_twolame=yes 435 AC_CHECK_HEADERS(twolame.h,, using_twolame=no) 436 AC_MSG_CHECKING([whether to dlopen twolame]) 437 AC_ARG_ENABLE(dl_twolame, 438 AS_HELP_STRING([--enable-dl-twolame], [Dlopen twolame instead of linking in.]), 439 enable_dl_twolame=$enableval, enable_dl_twolame=no) 440 AC_MSG_RESULT($enable_dl_twolame) 441 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_twolame" = "xyes"; then 442 AC_DEFINE(DL_TWOLAME, 1, [Define to dlopen() libtwolame.]) 443 else 444 enable_dl_twolame="no" 445 AC_CHECK_LIB(twolame, twolame_init, MP3_LIBS="$MP3_LIBS -ltwolame",using_twolame=no) 446 if test "$with_twolame" = "yes" -a "$using_twolame" = "no"; then 447 AC_MSG_FAILURE([cannot find libtwolame]) 448 fi 449 fi 450fi 451 452# Check for libgsm 453found_libgsm=yes 454AC_CHECK_HEADERS(gsm/gsm.h, , 455 [AC_CHECK_HEADERS(gsm.h, ,found_libgsm=no)]) 456 AC_CHECK_LIB(gsm, gsm_create, GSM_LIBS="$GSM_LIBS -lgsm", found_libgsm=no) 457if test "$found_libgsm" = yes; then 458 AC_DEFINE(EXTERNAL_GSM, 1, [Define if you are using an external GSM library]) 459else 460 LIBGSM_LIBADD=../libgsm/libgsm.la 461fi 462AM_CONDITIONAL(EXTERNAL_GSM, test x$found_libgsm = xyes) 463AC_SUBST(LIBGSM_LIBADD) 464 465 466 467# Check for liblpc10 468found_liblpc10=yes 469AC_CHECK_HEADERS(lpc10.h, , 470 [AC_CHECK_HEADERS(lpc10.h, ,found_liblpc10=no)]) 471 AC_CHECK_LIB(lpc10, create_lpc10_encoder_state, LPC10_LIBS="$LPC10_LIBS -llpc10", found_liblpc10=no) 472if test "$found_liblpc10" = yes; then 473 AC_DEFINE(EXTERNAL_LPC10, 1, [Define if you are using an external LPC10 library]) 474else 475 LIBLPC10_LIBADD=../lpc10/liblpc10.la 476fi 477AM_CONDITIONAL(EXTERNAL_LPC10, test x$found_liblpc10 = xyes) 478AC_SUBST(LIBLPC10_LIBADD) 479 480 481 482# Check for Ogg Vorbis 483AC_OPTIONAL_FORMAT(oggvorbis, OGG_VORBIS, [AC_CHECK_HEADER(vorbis/codec.h, 484 [AC_CHECK_LIB(ogg, ogg_packet_clear, OGG_VORBIS_LIBS="$OGG_VORBIS_LIBS -logg", using_oggvorbis=no) 485 AC_CHECK_LIB(vorbis, vorbis_analysis_headerout, OGG_VORBIS_LIBS="-lvorbis $OGG_VORBIS_LIBS", using_oggvorbis=no, $OGG_VORBIS_LIBS) 486 AC_CHECK_LIB(vorbisfile, ov_clear, OGG_VORBIS_LIBS="-lvorbisfile $OGG_VORBIS_LIBS", using_oggvorbis=no, $OGG_VORBIS_LIBS) 487 AC_CHECK_LIB(vorbisenc, vorbis_encode_init_vbr, OGG_VORBIS_LIBS="-lvorbisenc $OGG_VORBIS_LIBS", using_oggvorbis=no, $OGG_VORBIS_LIBS)], 488 using_oggvorbis=no)]) 489 490# Check for Opus 491AC_OPTIONAL_FORMAT(opus, OPUS, 492 [PKG_CHECK_MODULES(OPUS, [opusfile], [], using_opus=no)], 493 using_opus=no) 494if test "$GCC" = "yes"; then 495 OPUS_CFLAGS="$OPUS_CFLAGS -Wno-long-long" 496fi 497 498 499# Check for FLAC libraries 500# Note passing in OGG_VORBIS_LIBS. That is because FLAC has optional 501# support for OGG and if OGG libraries are found on this 502# system then its highly likely to be compiled into FLAC 503# and will require these at link time. 504case $target in 505 *mingw*) 506 FLAC_LIBS="-lwsock32" 507 ;; 508esac 509AC_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 511 512dnl When enable_dl_amrbw, do not let add libraries to be linked in 513dnl since they will be dlopen()'ed instead. 514ac_sox_save_AMRWB_LIBS="$AMRWB_LIBS" 515tmp_using_amrwb=$opt_default 516AC_CHECK_HEADERS(opencore-amrwb/dec_if.h, 517 [AC_CHECK_LIB(opencore-amrwb, D_IF_init, 518 AMRWB_LIBS="$AMRWB_LIBS -lopencore-amrwb", tmp_using_amrwb=no)], 519 [AC_CHECK_HEADERS(amrwb/dec.h, 520 [AC_CHECK_LIB(amrwb, D_IF_init, 521 AMRWB_LIBS="$AMRWB_LIBS -lamrwb",tmp_using_amrwb=no)], 522 tmp_using_amrwb=no)]) 523AC_ARG_ENABLE(dl_amrwb, 524 AS_HELP_STRING([--enable-dl-amrwb], 525 [Dlopen amrbw instead of linking in.]), 526 enable_dl_amrwb=$enableval, enable_dl_amrwb=no) 527if test "x$using_libltdl" = "xyes" -a "x$enable_dl_amrwb" = "xyes"; then 528 AC_DEFINE(DL_AMRWB, 1, [Define to dlopen() amrwb.]) 529 dnl When enable_dl_amrwb, do not let SOX_PATH_AMRWB add libraries 530 dnl to be linked in (since they will be dlopen()'ed instead). 531 AMRWB_LIBS="$ac_sox_save_AMRWB_LIBS" 532 dnl Force to using regardless if headers or libraries were found. 533 tmp_using_amrwb=yes 534else 535 enable_dl_amrwb="no" 536fi 537AC_OPTIONAL_FORMAT(amrwb, AMRWB, [using_amrwb=$tmp_using_amrwb]) 538 539dnl When enable_dl_amrnb, do not let add libraries to be linked in 540dnl since they will be dlopen()'ed instead. 541ac_sox_save_AMRNB_LIBS="$AMRNB_LIBS" 542tmp_using_amrnb=$opt_default 543AC_CHECK_HEADERS(opencore-amrnb/interf_dec.h, 544 [AC_CHECK_LIB(opencore-amrnb, Decoder_Interface_init, 545 AMRNB_LIBS="$AMRNB_LIBS -lopencore-amrnb", tmp_using_amrnb=no)], 546 [AC_CHECK_HEADER(amrnb/sp_dec.h, 547 [AC_CHECK_LIB(amrnb, Decoder_Interface_init, 548 AMRNB_LIBS="$AMRNB_LIBS -lamrnb", tmp_using_amrnb=no)], 549 tmp_using_amrnb=no)]) 550AC_ARG_ENABLE(dl_amrnb, 551 AS_HELP_STRING([--enable-dl-amrnb], 552 [Dlopen amrnb instead of linking in.]), 553 enable_dl_amrnb=$enableval, enable_dl_amrnb=no) 554if test "x$using_libltdl" = "xyes" -a "x$enable_dl_amrnb" = "xyes"; then 555 AC_DEFINE(DL_AMRNB, 1, [Define to dlopen() amrnb.]) 556 dnl When enable_dl_amrnb, do not let SOX_PATH_AMRNB add libraries 557 dnl to be linked in (since they will be dlopen()'ed instead). 558 AMRNB_LIBS="$ac_sox_save_AMRNB_LIBS" 559 dnl Force to using regardless if headers or libraries were found. 560 tmp_using_amrnb=yes 561else 562 enable_dl_amrnb="no" 563fi 564AC_OPTIONAL_FORMAT(amrnb, AMRNB, [using_amrnb=$tmp_using_amrnb]) 565 566 567AC_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)]) 568 569 570 571AC_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)]) 572 573 574 575AC_OPTIONAL_FORMAT(coreaudio, COREAUDIO, [AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [COREAUDIO_LIBS="$COREAUDIO_LIBS -Wl,-framework,CoreAudio"], using_coreaudio=no)]) 576 577 578 579AC_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)]) 580 581 582 583AC_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)]) 584 585 586 587AC_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 589 590AC_OPTIONAL_FORMAT(waveaudio, WAVEAUDIO, [AC_CHECK_HEADER(mmsystem.h, [WAVEAUDIO_LIBS="$WAVEAUDIO_LIBS -lwinmm"], using_waveaudio=no, [[#include <windows.h>]])]) 591 592dnl When enable_dl_sndfile, do not let SOX_PATH_SNDFILE add libraries 593dnl to be linked in (since they will be dlopen()'ed instead). 594ac_sox_save_SNDFILE_LIBS="$SNDFILE_LIBS" 595SOX_PATH_SNDFILE(tmp_using_sndfile=$opt_default, tmp_using_sndfile=no) 596AC_ARG_ENABLE(dl_sndfile, 597 AS_HELP_STRING([--enable-dl-sndfile], 598 [Dlopen sndfile instead of linking in.]), 599 enable_dl_sndfile=$enableval, enable_dl_sndfile=no) 600if test "x$using_sndfile" = "xyes"; then 601 if test "x$using_libltdl" = "xyes" -a "x$enable_dl_sndfile" = "xyes"; then 602 AC_DEFINE(DL_SNDFILE, 1, [Define to dlopen() sndfile.]) 603 dnl When enable_dl_sndfile, do not let SOX_PATH_SNDFILE add libraries 604 dnl to be linked in (since they will be dlopen()'ed instead). 605 SNDFILE_LIBS="$ac_sox_save_SNDFILE_LIBS" 606 else 607 enable_dl_sndfile="no" 608 fi 609fi 610AC_OPTIONAL_FORMAT(sndfile, SNDFILE, [using_sndfile=$tmp_using_sndfile]) 611 612 613 614AC_OPTIONAL_FORMAT(oss, OSS, [AC_CHECK_HEADERS(sys/soundcard.h,, 615 [AC_CHECK_HEADERS(machine/soundcard.h, 616 [AC_CHECK_LIB(ossaudio, _oss_ioctl, OSS_LIBS="$OSS_LIBS -lossaudio")], 617 using_oss=no)])]) 618 619 620 621AC_OPTIONAL_FORMAT(sunaudio, SUN_AUDIO, [AC_CHECK_HEADERS(sys/audioio.h,, 622 [AC_CHECK_HEADERS(sun/audioio.h,, using_sunaudio=no)])]) 623 624 625 626# MP2/MP3 format depends on libmad || LAME || twolame 627AC_OPTIONAL_FORMAT(mp3, MP3, [ 628 if test "$using_mad" != yes -a "$using_lame" != yes -a "$using_twolame" != yes; then 629 using_mp3=no 630 fi]) 631 632 633 634# GSM format depends on libgsm 635# No need to check; GSM is always found 636AC_OPTIONAL_FORMAT(gsm, GSM) 637 638 639 640# LPC10 format depends on liblpc10 641# No need to check; LPC10 is always found 642AC_OPTIONAL_FORMAT(lpc10, LPC10) 643 644 645 646dnl Check if we want to disable all symlinks 647AC_MSG_CHECKING([whether to enable symlinks]) 648AC_ARG_ENABLE(symlinks, 649 AS_HELP_STRING([--disable-symlinks], [Don't make any symlinks to sox.]),,enable_symlinks=yes) 650AC_MSG_RESULT($enable_symlinks) 651 652enable_playrec_symlinks=no 653if test "$enable_symlinks" = "yes"; then 654 SYMLINKS=yes 655 if test false \ 656 -o "$enable_alsa" = yes \ 657 -o "$enable_ao" = yes \ 658 -o "$enable_coreaudio" = yes \ 659 -o "$enable_oss" = yes \ 660 -o "$enable_pulseaudio" = yes \ 661 -o "$enable_sndio" = yes \ 662 ; then 663 PLAYRECLINKS=yes 664 enable_playrec_symlinks=yes 665 fi 666fi 667AC_SUBST(SYMLINKS) 668AC_SUBST(PLAYRECLINKS) 669 670AM_CONDITIONAL(STATIC_LIBSOX_ONLY, test "$enable_shared" = "no" -a "$enable_static" = "yes") 671 672dnl Generate output files. 673AC_CONFIG_FILES(Makefile src/Makefile libgsm/Makefile lpc10/Makefile msvc9/Makefile msvc10/Makefile sox.pc) 674AC_OUTPUT 675 676if test "$using_gsm" != "no"; then 677 if test "$found_libgsm" = "yes"; then 678 gsm_option="(external)" 679 else 680 gsm_option="(in-tree)" 681 fi 682fi 683 684if test "$using_lpc10" != "no"; then 685 if test "$found_liblpc10" = "yes"; then 686 lpc10_option="(external)" 687 else 688 lpc10_option="(in-tree)" 689 fi 690fi 691 692if test "$using_pkgconfig" = "no"; then 693 pkgconfig_option="disabled" 694else 695 pkgconfig_option="$with_pkgconfigdir" 696fi 697 698# Report configuration. 699echo 700echo "BUILD OPTIONS" 701echo "Debugging build............$enable_debug" 702echo "Distro name ...............$DISTRO" 703echo "Dynamic loading support....$using_libltdl" 704echo "Pkg-config location........$pkgconfig_option" 705echo "Play and rec symlinks......$enable_playrec_symlinks" 706echo "Symlinks enabled...........$enable_symlinks" 707echo 708echo "OPTIONAL DEVICE DRIVERS" 709echo "ao (Xiph)..................$using_ao" 710echo "alsa (Linux)...............$using_alsa" 711echo "coreaudio (Mac OS X).......$using_coreaudio" 712echo "sndio (OpenBSD)............$using_sndio" 713echo "oss........................$using_oss" 714echo "pulseaudio.................$using_pulseaudio" 715echo "sunaudio...................$using_sunaudio" 716echo "waveaudio (MS-Windows).....$using_waveaudio" 717echo 718echo "OPTIONAL FILE FORMATS" 719echo "amrnb......................$using_amrnb" 720if test "x$using_amrnb" = "xyes"; then 721echo " dlopen amrnb..............$enable_dl_amrnb" 722fi 723echo "amrwb......................$using_amrwb" 724if test "x$using_amrwb" = "xyes"; then 725echo " dlopen amrwb..............$enable_dl_amrwb" 726fi 727echo "flac.......................$using_flac" 728echo "gsm........................$using_gsm $gsm_option" 729echo "lpc10......................$using_lpc10 $lpc10_option" 730echo "mp2/mp3....................$using_mp3" 731echo " id3tag....................$using_id3tag" 732echo " lame......................$using_lame" 733if test "x$using_lame" = "xyes"; then 734if test "x$enable_dl_lame" != "xyes"; then 735echo " lame id3tag...............$ac_cv_lib_mp3lame_id3tag_set_fieldvalue" 736fi 737echo " dlopen lame...............$enable_dl_lame" 738fi 739echo " mad.......................$using_mad" 740if test "x$using_mad" = "xyes"; then 741echo " dlopen mad................$enable_dl_mad" 742fi 743echo " twolame...................$using_twolame" 744if test "x$using_twolame" = "xyes"; then 745echo " dlopen twolame............$enable_dl_twolame" 746fi 747echo "oggvorbis..................$using_oggvorbis" 748echo "opus.......................$using_opus" 749echo "sndfile....................$using_sndfile" 750if test "x$using_sndfile" = "xyes"; then 751echo " dlopen sndfile............$enable_dl_sndfile" 752fi 753echo "wavpack....................$using_wavpack" 754echo 755echo "OTHER OPTIONS" 756echo "ladspa effects.............$using_ladspa" 757echo "magic support..............$using_magic" 758echo "png support................$using_png" 759if test "x$OPENMP_CFLAGS" = "x"; then 760echo "OpenMP support.............no" 761else 762echo "OpenMP support.............yes, $OPENMP_CFLAGS" 763fi 764echo 765echo "Configure finished. Do 'make -s && make install' to compile and install SoX." 766echo 767