-# Checks for library functions.
-AC_FUNC_FORK
-AC_PROG_GCC_TRADITIONAL
-AC_FUNC_MALLOC
-AC_FUNC_MEMCMP
-AC_FUNC_MKTIME
-AC_FUNC_MMAP
-AC_FUNC_REALLOC
-AC_FUNC_SELECT_ARGTYPES
-AC_FUNC_STAT
-AC_FUNC_STRFTIME
-AC_FUNC_VPRINTF
-AC_FUNC_CLOSEDIR_VOID
-AC_FUNC_LSTAT
-
-AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
- regcomp select strchr strdup strerror strstr strtol uname \
- fchdir gettimeofday localtime_r munmap strcasecmp strcspn \
- strncasecmp strrchr strspn alarm mkdir inet_ntoa socket], [],
- [AC_MSG_ERROR([function not found, cannot live without it])])
-
-AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
-
-
-all_errlist_objs="mp3_afh afh_common net string signal time daemon
- stat afh amp_filter fd ringbuffer sched audiod
- grab_client filter_common wav_filter compress_filter http_recv
- dccp_recv recv_common write_common file_write audiod_command
- client_common recv stdout filter stdin audioc write client
- exec send_common ggo udp_recv color fec fecdec_filter
- prebuffer_filter bitstream imdct check_wav
- wma_afh wma_common wmadec_filter buffer_tree crypt_common
- gui gui_theme sideband afh_recv play"
-
-executables="recv filter audioc write client afh audiod play"
-
-recv_cmdline_objs="add_cmdline(recv http_recv dccp_recv udp_recv afh_recv)"
-
-recv_errlist_objs="
- http_recv recv_common recv time string net dccp_recv fd
- sched stdout ggo udp_recv buffer_tree afh_recv afh_common
- wma_afh wma_common mp3_afh
-"
-
-recv_ldflags=""
-
-filter_cmdline_objs="add_cmdline(filter compress_filter amp_filter prebuffer_filter)"
-filter_errlist_objs="filter_common wav_filter compress_filter filter string
- stdin stdout sched fd amp_filter ggo fecdec_filter fec
- prebuffer_filter time bitstream imdct wma_common wmadec_filter buffer_tree"
-filter_ldflags="-lm"
-filters=" compress wav amp fecdec wmadec prebuffer"
-
-audioc_cmdline_objs="add_cmdline(audioc)"
-audioc_errlist_objs="audioc string net fd"
-audioc_ldflags=""
-
-audiod_cmdline_objs="add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
-audiod_errlist_objs="audiod signal string daemon stat net crypt_common sideband
- time grab_client filter_common wav_filter compress_filter amp_filter http_recv dccp_recv
- recv_common fd sched write_common file_write audiod_command fecdec_filter
- client_common ggo udp_recv color fec prebuffer_filter
- bitstream imdct wma_common wmadec_filter buffer_tree"
-audiod_ldflags="-lm"
-audiod_audio_formats="wma"
-
-afh_cmdline_objs="add_cmdline(afh)"
-afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common"
-afh_ldflags=""
-
-write_cmdline_objs="add_cmdline(write file_write)"
-write_errlist_objs="write write_common file_write time fd string sched stdin
- buffer_tree ggo check_wav"
-write_ldflags=""
-writers=" file"
-default_writer="FILE_WRITE"
-
-client_cmdline_objs="add_cmdline(client)"
-client_errlist_objs="client net string fd sched stdin stdout time sideband
- client_common buffer_tree crypt_common"
-client_ldflags=""
-
-gui_cmdline_objs="add_cmdline(gui)"
-gui_errlist_objs="exec signal string stat ringbuffer fd gui gui_theme time"
-gui_objs="$gui_cmdline_objs $gui_errlist_objs"
-play_errlist_objs="play fd sched ggo buffer_tree time string net
- afh_recv afh_common
- wma_afh wma_common mp3_afh
- recv_common udp_recv http_recv dccp_recv
- filter_common fec bitstream imdct
- wav_filter compress_filter amp_filter prebuffer_filter fecdec_filter
- wmadec_filter
- write_common file_write
-"
-play_cmdline_objs="add_cmdline(http_recv dccp_recv udp_recv afh_recv compress_filter amp_filter prebuffer_filter file_write play)"
-play_ldflags="-lm"
-########################################################################### snprintf
-# ===========================================================================
-# http://www.nongnu.org/autoconf-archive/ax_func_snprintf.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_FUNC_SNPRINTF
-#
-# DESCRIPTION
-#
-# Checks for a fully C99 compliant snprintf, in particular checks whether
-# it does bounds checking and returns the correct string length; does the
-# same check for vsnprintf. If no working snprintf or vsnprintf is found,
-# it prints an error message and aborts.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Ruediger Kuhlmann <info@ruediger-kuhlmann.de>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved.
-
-AU_ALIAS([AC_FUNC_SNPRINTF], [AX_FUNC_SNPRINTF])
-AC_DEFUN([AX_FUNC_SNPRINTF],
-[AC_CHECK_FUNCS(snprintf vsnprintf)
-AC_MSG_CHECKING(for working snprintf)
-AC_CACHE_VAL(ac_cv_have_working_snprintf,
-[AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <stdio.h>
-
-int main(void)
-{
- char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
- char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
- int i;
- i = snprintf (bufs, 2, "%s", "111");
- if (strcmp (bufs, "1")) exit (1);
- if (i != 3) exit (1);
- i = snprintf (bufd, 2, "%d", 111);
- if (strcmp (bufd, "1")) exit (1);
- if (i != 3) exit (1);
- exit(0);
-}]])],[ac_cv_have_working_snprintf=yes],
-[ac_cv_have_working_snprintf=no],[ac_cv_have_working_snprintf=cross])])
-AC_MSG_RESULT([$ac_cv_have_working_snprintf])
-AC_MSG_CHECKING(for working vsnprintf)
-AC_CACHE_VAL(ac_cv_have_working_vsnprintf,
-[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
-#include <stdarg.h>
-
-int my_vsnprintf (char *buf, const char *tmpl, ...)
-{
- int i;
- va_list args;
- va_start (args, tmpl);
- i = vsnprintf (buf, 2, tmpl, args);
- va_end (args);
- return i;
-}
-
-int main(void)
-{
- char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
- char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
- int i;
- i = my_vsnprintf (bufs, "%s", "111");
- if (strcmp (bufs, "1")) exit (1);
- if (i != 3) exit (1);
- i = my_vsnprintf (bufd, "%d", 111);
- if (strcmp (bufd, "1")) exit (1);
- if (i != 3) exit (1);
- exit(0);
-}]])],[ac_cv_have_working_vsnprintf=yes],
-[ac_cv_have_working_vsnprintf=no],[ac_cv_have_working_vsnprintf=cross])])
-AC_MSG_RESULT([$ac_cv_have_working_vsnprintf])
-if test x$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf != "xyesyes"; then
-AC_MSG_ERROR([fatal: buggy snprintf() detected])
-fi])
-AX_FUNC_SNPRINTF()
-########################################################################### osl
-have_osl=yes
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LD_FLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-AC_ARG_WITH(osl_headers, [AS_HELP_STRING(--with-osl-headers=dir,
- [look for osl.h also in dir])])
-if test -n "$with_osl_headers"; then
- osl_cppflags="-I$with_osl_headers"
- CPPFLAGS="$CPPFLAGS $osl_cppflags"