dnl ----------------------------------------------------------------------- dnl configure.in for xmp dnl dnl Process this file with autoconf to produce a configure script. dnl $Id: configure.in,v 1.43 2007/12/02 01:19:45 cmatsuoka Exp $ dnl ----------------------------------------------------------------------- AC_INIT AC_CONFIG_SRCDIR([src/include/xmp.h]) AC_CONFIG_HEADER(src/include/config.h) AC_CONFIG_AUX_DIR(./scripts) AC_CANONICAL_HOST AC_SUBST(CINCS) CINCS="${CPPFLAGS}" AC_SUBST(PLUGINS) PLUGINS="" AC_SUBST(LDFLAGS) LDFLAGS="" AC_SUBST(DRIVERS) DRIVERS="" AC_SUBST(MIXER) MIXER="mix_all.o" AC_SUBST(LIBM) LIBM="-lm" dnl ----------------------------------------------------------------------- dnl Config arguments dnl ----------------------------------------------------------------------- AC_ARG_ENABLE(oss, [ --disable-oss Don't compile OSS support]) AC_ARG_ENABLE(alsa, [ --disable-alsa Don't compile ALSA support]) AC_ARG_ENABLE(arts, [ --enable-arts Compile aRts support]) AC_ARG_ENABLE(nas, [ --enable-nas Compile NAS support]) AC_ARG_ENABLE(pulseaudio, [ --enable-pulseaudio Compile PulseAudio support]) AC_ARG_ENABLE(xmms-plugin, [ --enable-xmms-plugin Compile the XMMS plugin]) AC_ARG_ENABLE(bmp-plugin, [ --enable-bmp-plugin Compile the Beep Media Player plugin]) AC_ARG_ENABLE(audacious-plugin, [ --enable-audacious-plugin Compile the Audacious plugin]) AC_ARG_ENABLE(winamp-plugin, [ --enable-winamp-plugin Compile the Winamp plugin]) AC_ARG_ENABLE(esd, [ --enable-esd Compile ESD support]) AC_ARG_WITH(oss, [ --with-oss= OSS prefix (optional)], oss_path="$withval", oss_path="/usr/lib/oss") AC_ARG_WITH(esd, [ --with-esd= ESD prefix (optional)], esd_path="$withval") AC_ARG_WITH(nas, [ --with-nas= NAS prefix (optional)], nas_path="$withval") dnl ----------------------------------------------------------------------- dnl Sanitize prefixes dnl ----------------------------------------------------------------------- dnl Don't use things like /usr/etc or /usr/var fix_prefix=no if test "x$prefix" = xNONE; then fix_prefix=yes elif test "x$prefix" = x/usr -o "x$prefix" = x/usr/local; then fix_prefix=yes fi if test $fix_prefix = yes -a $sysconfdir = '${prefix}/etc'; then sysconfdir=/etc localstatedir=/var fi dnl ----------------------------------------------------------------------- dnl Check platform. dnl ----------------------------------------------------------------------- if test -z "${target}"; then target=${host} target_cpu=${host_cpu} target_vendor=${host_vendor} target_os=${host_os} fi AC_SUBST(PLATFORM) PLATFORM="${target}" case ${target_cpu} in powerpc64) CFLAGS="${CFLAGS} -m64" LDFLAGS="${LDFLAGS} -m64" ;; esac case ${target_os} in cygwin* | mingw*) is_win32=yes CFLAGS="${CFLAGS}" enable_arts=no enable_xmms_plugin=no enable_bmp_plugin=no enable_audacious_plugin=no ;; esac dnl ----------------------------------------------------------------------- dnl Check for programs. dnl ----------------------------------------------------------------------- AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB AC_HEADER_STDC dnl XMP_CACHED_TEST(,,,,) define(XMP_CACHED_TEST,[ AC_CACHE_CHECK([$1],[$2],[ if test [$3]; then $2=yes else $2=no fi]) if test "x$$2" = xyes; then true $4 else true $5 fi]) dnl ----------------------------------------------------------------------- dnl Check for OSS dnl ----------------------------------------------------------------------- XMP_CACHED_TEST(for ${oss_path},ac_cv_dir_usr_lib_oss,-d /usr/lib/oss, CINCS="${CINCS} -I/usr/lib/oss/include", XMP_CACHED_TEST(for /usr/src/sys/i386/isa/sound, ac_cv_dir_usr_src_sys_i386_isa_sound, -d /usr/src/sys/i386/isa/sound, CINCS="${CINCS} -I/usr/src/sys/i386/isa/sound",)) dnl ----------------------------------------------------------------------- dnl Check for XMMS dnl ----------------------------------------------------------------------- if test "${enable_xmms_plugin}" = "yes"; then xmms_cflags="`xmms-config --cflags 2>/dev/null`" if test ! -z "${xmms_cflags}"; then AS_MESSAGE(checking for XMMS flags... ${xmms_cflags}...) else if test "${enable_xmms_plugin}" = "yes"; then AC_MSG_ERROR(Can't find XMMS files) fi AC_MSG_WARN(not found) enable_xmms_plugin="no" fi fi if test "${enable_xmms_plugin}" = "yes"; then CPPFLAGS="${CINCS} `xmms-config --cflags`" AC_CHECK_HEADERS(xmms/plugin.h) if test "${ac_cv_header_xmms_plugin_h}" = "yes"; then PLUGINS="$PLUGINS xmms" fi fi dnl ----------------------------------------------------------------------- dnl Check for Beep Media Player dnl ----------------------------------------------------------------------- if test "${enable_bmp_plugin}" = "yes"; then bmp_cflags="`pkg-config --cflags bmp 2>/dev/null`" if test ! -z "${bmp_cflags}"; then AS_MESSAGE(checking for Beep Media Player flags... ${bmp_cflags}...) else if test "${enable_bmp_plugin}" = "yes"; then AC_MSG_ERROR(Can't find Beep Media Player files) fi AC_MSG_WARN(not found) enable_bmp_plugin="no" fi fi if test "${enable_bmp_plugin}" = "yes"; then CPPFLAGS="${CINCS} `pkg-config --cflags bmp`" AC_CHECK_HEADERS(bmp/plugin.h) if test "${ac_cv_header_bmp_plugin_h}" = "yes"; then PLUGINS="$PLUGINS bmp" fi fi dnl ----------------------------------------------------------------------- dnl Check for Audacious dnl ----------------------------------------------------------------------- if test "${enable_audacious_plugin}" = "yes"; then audacious_cflags="`pkg-config --cflags audacious 2>/dev/null`" if test ! -z "${audacious_cflags}"; then AS_MESSAGE(checking for Audacious flags... ${audacious_cflags}...) else if test "${enable_audacious_plugin}" = "yes"; then AC_MSG_ERROR(Can't find Audacious files) fi AC_MSG_WARN(not found) enable_audacious_plugin="no" fi fi if test "${enable_audacious_plugin}" = "yes"; then CPPFLAGS="${CINCS} `pkg-config --cflags audacious`" AC_CHECK_HEADERS(audacious/plugin.h) if test "${ac_cv_header_audacious_plugin_h}" = "yes"; then PLUGINS="$PLUGINS audacious" fi fi dnl ----------------------------------------------------------------------- dnl Check for Winamp SDK dnl ----------------------------------------------------------------------- if test "${enable_winamp_plugin}" = "yes"; then PLUGINS="$PLUGINS winamp" fi dnl ----------------------------------------------------------------------- dnl Check for aRts dnl ----------------------------------------------------------------------- if test "${enable_arts}" = "yes"; then arts_cflags="`artsc-config --cflags 2>/dev/null`" if test ! -z "${arts_cflags}"; then AS_MESSAGE(checking for aRts flags... ${arts_cflags}...) else if test "${enable_arts}" = "yes"; then AC_MSG_ERROR(Can't find aRts files (is artsc-config in PATH?)) fi AC_MSG_WARN(artsc-config not found) enable_arts="no" fi fi if test "${enable_arts}" = "yes"; then CPPFLAGS="${CINCS} `artsc-config --cflags`" AC_CHECK_HEADERS(artsc.h) fi dnl ----------------------------------------------------------------------- dnl Check for header files dnl ----------------------------------------------------------------------- if test "$esd_path" != ""; then CINCS="${CINCS} -I${esd_path}/include" fi if test "$nas_path" != ""; then CINCS="${CINCS} -I${nas_path}/include" fi CPPFLAGS="${CINCS}" AC_CHECK_HEADERS(strings.h getopt.h sys/select.h sys/param.h \ termios.h sys/shm.h sys/soundcard.h machine/soundcard.h \ sys/ultrasound.h linux/ultrasound.h machine/ultrasound.h \ awe_voice.h sys/awe_voice.h linux/awe_voice.h \ alsa/asoundlib.h esd.h pulse/simple.h) AC_CHECK_HEADERS(audio/audiolib.h audio/soundlib.h,,, [[#if HAVE_AUDIO_AUDIOLIB_H #include