1 dnl Process this file with autoconf to produce a configure script.
6 AC_INIT(SoX, 14.4.3git, sox-devel@lists.sourceforge.net)
8 dnl Increase version when binary compatibility with previous version is broken
10 AC_SUBST(SHLIB_VERSION)
12 AC_CONFIG_MACRO_DIR([m4])
13 AC_CONFIG_SRCDIR(sox.1)
14 AC_CONFIG_HEADERS([src/soxconfig.h])
16 AM_INIT_AUTOMAKE([subdir-objects])
17 AM_SILENT_RULES([yes])
22 AS_HELP_STRING([--with-distro=name], [Provide distribution name]),
23 AC_DEFINE_UNQUOTED(DISTRO, ["$with_distro"], [Distribution name])
24 SOX_REPORT([build], [distro name], [${with_distro:-unspecified}]))
26 dnl Checks for programs.
35 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
36 AX_APPEND_COMPILE_FLAGS([-Wall -Wmissing-prototypes -Wstrict-prototypes])
37 AX_APPEND_LINK_FLAGS([-Wl,--as-needed])
39 dnl Check for system dependent features.
43 dnl Checks for header files.
45 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)
47 dnl Checks for library functions.
48 AC_CHECK_FUNCS(strcasecmp strdup popen vsnprintf gettimeofday mkstemp fmemopen sigaction)
50 dnl Check if math library is needed.
51 AC_SEARCH_LIBS([pow], [m])
52 AC_SEARCH_LIBS([lrint], [m])
53 AC_CHECK_FUNCS([lrint])
55 dnl Large File Support
61 CFLAGS="$CFLAGS $OPENMP_CFLAGS"
62 SOX_REPORT([other], [OpenMP], [${OPENMP_CFLAGS:-no}])
64 if test "$ac_cv_header_glob_h" != yes; then
65 AC_CHECK_FUNC([FindFirstFileA], [
66 AC_DEFINE([HAVE_GLOB_H], [1], [Define if glob.h exists])
69 AM_CONDITIONAL(HAVE_WIN32_GLOB, test "$HAVE_WIN32_GLOB" = yes)
71 SOX_WITH_LIB([libltdl], [ltdl.h], [ltdl], [lt_dlinit])
73 SOX_WITH([ladspa], [Enable LADSPA plugin support],
74 [SOX_NEED_DL([${with_ladspa:+dyn}], [--with-ladspa])],
75 [AC_DEFINE([HAVE_LADSPA_H], [1], [Define if LADSPA support is enabled])
76 AS_CASE([$HAVE_LADSPA], [yes], [LADSPA_PATH='${libdir}/ladspa'],
77 [LADSPA_PATH=$HAVE_LADSPA])], [], [], [*], [$HAVE_LIBLTDL])
78 AC_SUBST([LADSPA_PATH])
79 SOX_REPORT([other], [LADSPA effect plugins], [$HAVE_LADSPA])
83 SOX_WITH_LIB([magic], [magic.h], [magic], [magic_open])
84 SOX_CHECK_LIB([ZLIB], [zlib.h], [z], [uncompress])
85 SOX_WITH_LIB([png], [png.h], [png], [png_set_rows], [], [], [], [$ZLIB_LIBS])
86 SOX_WITH_LIB([id3tag], [id3tag.h], [id3tag], [id3_file_open])
87 SOX_WITH_LIB([libgsm], [gsm/gsm.h gsm.h], [gsm], [gsm_create])
91 SOX_ENABLE([formats], [Default setting for optional formats],
92 [SOX_NEED_DL([$HAVE_FORMATS], [--enable-formats=dyn])], [], [], [], [dyn])
94 SOX_DL_LIB([opencore-amrnb], [opencore-amrnb/interf_dec.h], [opencore-amrnb],
95 [Decoder_Interface_init])
96 SOX_FMT_REQ([amrnb], [OPENCORE_AMRNB])
98 SOX_DL_LIB([opencore-amrwb], [opencore-amrwb/dec_if.h], [opencore-amrwb],
100 SOX_DL_LIB([vo-amrwbenc], [vo-amrwbenc/enc_if.h], [vo-amrwbenc], [E_IF_init])
101 SOX_FMT_REQ([amrwb], [OPENCORE_AMRWB VO_AMRWBENC])
103 SOX_FMT_PKG([flac], [flac])
104 SOX_FMT_REQ([gsm], [LIBGSM])
106 SOX_CHECK_LIB([LIBLPC10], [lpc10.h], [lpc10], [create_lpc10_encoder_state],
107 [LPC10_LIBS="$LIBLPC10_LIBS"],
108 [LPC10_LIBS=../lpc10/liblpc10.la; LPC10_CFLAGS='-I${top_srcdir}/lpc10'])
109 AM_CONDITIONAL([HAVE_LIBLPC10], [test $HAVE_LIBLPC10 = yes])
112 SOX_DL_LIB([mad], [mad.h], [mad], [mad_stream_buffer])
113 SOX_DL_LIB([lame], [lame/lame.h lame.h], [mp3lame], [lame_init])
114 SOX_DL_LIB([twolame], [twolame.h], [twolame], [twolame_init])
115 SOX_FMT_REQ([mp3], [MAD LAME TWOLAME])
117 SOX_FMT_PKG([oggvorbis], [ogg vorbis vorbisenc vorbisfile])
118 SOX_FMT_PKG([opus], [opusfile])
120 SOX_DL_LIB([libsndfile], [sndfile.h], [sndfile], [sf_open_virtual])
121 SOX_FMT_REQ([sndfile], [LIBSNDFILE])
123 SOX_FMT_LIB([wavpack], [wavpack/wavpack.h], [wavpack], [WavpackGetSampleRate])
127 SOX_FMT_LIB([alsa], [alsa/asoundlib.h], [asound], [snd_pcm_open], [], [],
129 SOX_FMT_LIB([ao], [ao/ao.h], [ao], [ao_play], [], [], [devices])
130 SOX_FMT_LIB([coreaudio], [CoreAudio/CoreAudio.h], [], [AudioDeviceStart], [],
131 [[-Wl,-framework,CoreAudio]], [devices])
132 SOX_FMT_LIB([pulseaudio], [pulse/simple.h], [pulse], [pa_simple_new], [],
133 [-lpulse-simple], [devices])
134 SOX_FMT_HEADERS([oss], [sys/soundcard.h], [SOUND_MIXER_MUTE], [], [devices])
135 SOX_FMT_LIB([sndio], [sndio.h], [sndio], [sio_open], [], [], [devices])
136 SOX_FMT_HEADERS([sunaudio], [sys/audioio.h sun/audioio.h],
137 [AUDIO_GETINFO], [], [devices])
138 SOX_FMT_LIB([waveaudio], [mmsystem.h], [winmm], [waveOutOpen], [windows.h], [],
141 dnl Check if we want to create symlinks
142 AC_ARG_ENABLE([symlinks],
143 AS_HELP_STRING([--enable-symlinks], [Create soxi/play/rec links (YES/no)]))
144 AS_CASE([${enable_symlinks:=yes}], [yes], [
146 AS_IF([test -n "$sox_devices"], [SYMLINKS="$SYMLINKS play rec"])])
148 SOX_REPORT([build], [symlinks], [${SYMLINKS:-none}])
150 AM_CONDITIONAL(STATIC_LIBSOX_ONLY, test "$enable_shared" = "no")
152 dnl Generate output files.
153 AC_CONFIG_FILES(Makefile src/Makefile lpc10/Makefile sox.pc)
156 SOX_REPORT_SECTION([build], [Build options:])
157 SOX_REPORT_SECTION([with_libs], [Optional libraries:], [sort])
158 SOX_REPORT_SECTION([formats], [Optional formats:], [sort])
159 SOX_REPORT_SECTION([devices], [Audio devices:], [sort])
160 SOX_REPORT_SECTION([other], [Other options:])
164 echo "Configure finished. Run 'make' to compile SoX."