dnl Initialize the autoconf settings AC_INIT(esd.h) ESD_MAJOR_VERSION=0 ESD_MINOR_VERSION=2 ESD_MICRO_VERSION=8 ESD_VERSION=$ESD_MAJOR_VERSION.$ESD_MINOR_VERSION.$ESD_MICRO_VERSION dnl set version info for libesd.so to package rev - $MAJOR + $MINOR : $MICRO : $MINOR ESD_VERSION_INFO=2:8:2 AC_SUBST(ESD_MAJOR_VERSION) AC_SUBST(ESD_MINOR_VERSION) AC_SUBST(ESD_MICRO_VERSION) AC_SUBST(ESD_VERSION) AC_SUBST(ESD_VERSION_INFO) VERSION=$ESD_VERSION PACKAGE=esound AM_INIT_AUTOMAKE($PACKAGE, $VERSION) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl Check for tools AC_CANONICAL_HOST AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_CPP AM_PROG_LIBTOOL AC_PROG_INSTALL dnl Check for compiler environment AC_C_CONST dnl Check for system libs needed AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)]) AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)]) AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(posix4,nanosleep)]) AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)]) if test x$ac_cv_func_nanosleep = xno && test x$ac_cv_lib_posix4_nanosleep = xno then : else AC_DEFINE(HAVE_NANOSLEEP) fi if test x$ac_cv_func_inet_aton = xno && test x$ac_cv_lib_resolv_inet_aton = xno then : else AC_DEFINE(HAVE_INET_ATON) fi dnl check for getopt_long, substitute the distributed versions if not AC_CHECK_FUNC(getopt_long,,[LIBOBJS="$LIBOBJS getopt.o getopt1.o"]) AC_SUBST(LIBOBJS) dnl Needed for FIONBIO on Solaris at least AC_CHECK_HEADERS(sys/filio.h sys/ioctl.h) dnl see if we want to enable insanely verbose debugging AC_ARG_ENABLE(debugging,[ --enable-debugging enable verbose diagnostic info [default=no]], , ) if test "x$enable_debugging" = "xyes"; then AC_DEFINE(ESDBG) fi dnl see if we intentionally want to disable local sound AC_ARG_ENABLE(local_sound,[ --enable-local-sound turn on local sound playing [default=yes]], , enable_local_sound=yes) if test "x$enable_local_sound" = "xyes"; then found_sound=no dnl Check for audio header files needed echo "---------------------------------------------------------------------" echo "--- Checking to see which audio header files your system uses."; echo "--- Most of these checks should fail. Do not be alarmed."; AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h) AC_CHECK_HEADERS(sys/audioio.h sys/audio.io.h sun/audioio.h) AC_CHECK_HEADERS(dmedia/audio.h sys/soundlib.h sys/asoundlib.h) dnl Define the driver needed based on the first header file found if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \ test "${ac_cv_header_soundcard_h}" = "yes" || \ test "${ac_cv_header_machine_soundcard_h}" = "yes"; then dnl Platform mklinux/powerpc needs special care and feeding if test "${host_cpu}" = "powerpc"; then found_sound=yes AC_DEFINE(DRIVER_MKLINUX) else found_sound=yes AC_DEFINE(DRIVER_OSS) fi fi if test "${ac_cv_header_sys_audio_h}" = "yes"; then case ${host_os} in hpux*) found_sound=yes AC_DEFINE(DRIVER_HPUX) ;; aix*) found_sound=yes AC_DEFINE(DRIVER_AIX) esac fi if test "${ac_cv_header_sys_audioio_h}" = "yes" || \ test "${ac_cv_header_sys_audio_io_h}" = "yes" || \ test "${ac_cv_header_sun_audioio_h}" = "yes"; then case ${host_os} in solaris*) found_sound=yes AC_DEFINE(DRIVER_SOLARIS) esac fi if test "${ac_cv_header_dmedia_audio_h}" = "yes"; then case ${host_os} in irix*) found_sound=yes AC_DEFINE(DRIVER_IRIX) esac fi AC_ARG_ENABLE(alsa,[ --enable-alsa use alsa if available [default=yes]], , enable_alsa=yes) if test "x$enable_alsa" = "xyes"; then if test "${ac_cv_header_sys_soundlib_h}" = "yes"; then found_sound=yes AC_DEFINE(DRIVER_ALSA) fi if test "${ac_cv_header_sys_asoundlib_h}" = "yes"; then found_sound=yes AC_DEFINE(DRIVER_NEWALSA) fi fi if test "$found_sound" = "no"; then AC_MSG_ERROR([Could not find a support sound driver]) fi dnl Check for additional audio libs needed echo "---------------------------------------------------------------------" echo "--- Checking to see which audio libraries are required for linking."; echo "--- Most of these checks should also fail. Do not be alarmed."; AC_CHECK_FUNC(_oss_ioctl,,[AC_CHECK_LIB(ossaudio,_oss_ioctl)]) AC_CHECK_FUNC(ALnewconfig,,[AC_CHECK_LIB(audio,ALnewconfig)]) if test "x$enable_alsa" = "xyes"; then AC_CHECK_FUNC(snd_cards,,[AC_CHECK_LIB(sound,snd_cards)]) AC_CHECK_FUNC(snd_cards,,[AC_CHECK_LIB(asound,snd_cards)]) fi else AC_DEFINE(DRIVER_NONE) fi dnl make sure we have the library, -laudiofile ESDPLAY= AC_ARG_WITH(audiofile, [ --with-audiofile include support for audiofile related utilities and functions ARG = { yes | no | check } [default=check]]) if test xno != x$with_audiofile ; then echo "---------------------------------------------------------------------" echo "--- Checking for the audiofile library. NOTE: This library is now" echo "REQUIRED from proper compilation of the esound package." AM_PATH_AUDIOFILE(0.1.5, [ ESDPLAY=esdplay echo "--- libaudiofile found. Building esound with audiofile support" ],[ echo "--- ERROR: The audiofile library was not found on your system." echo "--- The audiofile library may be obtained from your favourite" echo "--- gnome distribution center, or check the audiofile web page at:" echo "--- http://www.68k.org/~michael/audiofile/" echo "--- NOTE: The audiofile library is now REQUIRED for esound." ]) else echo "---------------------------------------------------------------------" echo "--- WARNING: Per configuration request, the audiofile library support" echo "--- not be included. This may result in errors using some programs" echo "--- designed to operate with esd." echo "--- The audiofile library may be obtained from your favourite" echo "--- gnome distribution center, or check the audiofile web page at:" echo "--- http://www.68k.org/~michael/audiofile/" echo "--- NOTE: The audiofile library is now REQUIRED for esound." fi echo "---------------------------------------------------------------------" AC_ARG_WITH(libwrap,[ --with-libwrap use tcp wrappers]) WRAP_LIB= if test "x$with_libwrap" = "xyes"; then esound_save_LIBS="$LIBS" LIBS="$LIBS -lwrap" AC_MSG_CHECKING([for tcp_wrapper library and headers]) wrap_ok=no AC_TRY_LINK( [#include #include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING;], [struct request_info *request; return hosts_access (request);], [AC_DEFINE(USE_LIBWRAP) WRAP_LIB="-lwrap" wrap_ok=yes], [LIBS="$LIBS -lnsl" AC_TRY_LINK( [#include #include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING;], [struct request_info *request; return hosts_access (request);], [AC_DEFINE(USE_LIBWRAP) WRAP_LIB="-lwrap -lnsl" wrap_ok=yes])]) AC_MSG_RESULT($wrap_ok) LIBS="$esound_save_LIBS" fi dnl build the esddsp wrapper for Linux/FreeBSD only dsp_ok=no ESDDSP= LIBESDDSP= DL_LIB= AC_MSG_CHECKING([if your platform supports esddsp]) case "$host_os" in linux* | freebsd* ) dsp_ok=yes ;; esac AC_MSG_RESULT($dsp_ok) if test "$dsp_ok" = "yes"; then AC_CHECK_FUNC(dlopen, dsp_ok=yes, AC_CHECK_LIB(dl, dlopen, dsp_ok=yes DL_LIB=-ldl)) ESDDSP=esddsp LIBESDDSP=libesddsp.la fi # set | sort; # just for double checking the script... AC_SUBST(WRAP_LIB) AC_SUBST(AUDIOFILE_LIBS) AC_SUBST(ESDPLAY) AC_SUBST(LIBESDDSP) AC_SUBST(ESDDSP) AC_SUBST(DL_LIB) AC_OUTPUT([ Makefile esd-config esound.spec esddsp ]) dnl , [case "$CONFIG_FILES" in *esd-config*) chmod +x esd-config;; esac])