Changeset 678

Show
Ignore:
Timestamp:
12/20/09 13:17:53 (2 years ago)
Author:
erikd
Message:

configure.ac : Allow more than one device to be compiled in.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sweep/trunk/configure.ac

    r673 r678  
    3131 
    3232dnl Default audio handling to build in 
    33 sweep_config_driver=none 
     33sweep_config_driver="" 
    3434 
    3535dnl 
     
    322322 
    323323dnl 
    324 dnl Detect output driver to use 
    325 dnl 
    326  
    327 dnl Test for PulseAudio 
    328  
    329 ac_enable_pulseaudio=no 
     324dnl Detect output drivers. Enable as many as possible by default and 
     325dnl choose between them at runtime. 
     326dnl 
     327 
     328ac_enable_pulseaudio=yes 
    330329AC_ARG_ENABLE(pulseaudio, 
    331      [  --enable-pulseaudio     Enable PulseAudio driver], 
    332      [ ac_enable_pulseaudio=yes ]) 
     330     AC_HELP_STRING([--disable-pulseaudio],[Disable PulseAudio driver]), 
     331     [ ac_enable_pulseaudio=no ]) 
     332 
     333ac_enable_alsa=yes 
     334AC_ARG_ENABLE(alsa, 
     335     AC_HELP_STRING([--disable-alsa],[Disable ALSA driver]), 
     336     [ ac_enable_alsa=no ]) 
     337 
     338ac_enable_oss=yes 
     339AC_ARG_ENABLE(oss, 
     340     AC_HELP_STRING([--disable-oss],[Disable OSS driver]), 
     341     [ ac_enable_oss=no ]) 
    333342 
    334343if test "x${ac_enable_pulseaudio}" != xno ; then 
     
    338347  if test "x$HAVE_PULSEAUDIO" = xyes; then 
    339348    AC_DEFINE([DRIVER_PULSEAUDIO], [], [Define if we have and want pulseaudio.])  
    340     sweep_config_driver="PulseAudio" 
    341   fi 
    342 else 
    343   ac_enable_alsa=yes 
    344   AC_ARG_ENABLE(alsa, 
    345        [  --disable-alsa          Disable ALSA, and enable use of OSS], 
    346        [ ac_enable_alsa=no ]) 
    347  
    348   if test "x${ac_enable_alsa}" != xno ; then 
    349  
    350     PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0, 
     349    sweep_config_driver="$sweep_config_driver PulseAudio" 
     350    fi 
     351  fi 
     352 
     353if test "x${ac_enable_alsa}" != xno ; then 
     354  PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0, 
    351355                    HAVE_ALSA="yes", sweep_config_ok="no") 
    352     AC_SUBST(ALSA_CFLAGS) 
    353     AC_SUBST(ALSA_LIBS) 
    354     AC_DEFINE([DRIVER_ALSA], [], [Define if we have and want alsa.])  
    355     if test "x$HAVE_ALSA" != xyes ; then 
    356       AC_CHECK_LIB(asound, snd_seq_open, HAVE_ALSA="maybe", sweep_config_ok="no") 
     356  AC_SUBST(ALSA_CFLAGS) 
     357  AC_SUBST(ALSA_LIBS) 
     358  AC_DEFINE([DRIVER_ALSA], [], [Define if we have and want alsa.])  
     359  if test "x$HAVE_ALSA" == xyes ; then 
     360    AC_CHECK_LIB(asound, snd_seq_open, HAVE_ALSA="maybe", sweep_config_ok="no") 
     361    sweep_config_driver="$sweep_config_driver ALSA" 
    357362    fi   
    358     sweep_config_driver="ALSA" 
    359   fi 
    360  
     363  fi 
     364 
     365if test "x${ac_enable_oss}" != xno ; then 
    361366  dnl Test for OSS 
    362367  AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h) 
    363368  if test "x${ac_cv_header_sys_soundcard_h}" = xyes || \ 
    364369    test "x${ac_cv_header_machine_soundcard_h}" = xyes; then 
    365     if test "x$ac_enable_alsa" = xno ; then 
     370    if test "x$ac_enable_alsa" = xyes ; then 
    366371      AC_DEFINE([DRIVER_OSS], [], [Define if we have and want OSS.]) 
    367  
    368372      dnl Check for NetBSD's OSS compatability layer 
    369373      AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBS="$LIBS -lossaudio") 
    370  
    371       sweep_config_driver="OSS" 
     374      sweep_config_driver="$sweep_config_driver OSS" 
     375      fi 
    372376    fi 
    373377  fi 
    374378 
    375   dnl Test for Solaris audio 
    376   case $host in 
     379dnl Test for Solaris audio 
     380case $host in 
    377381  *-*-solaris*) 
    378382  AC_CHECK_HEADERS(sys/audioio.h) 
    379383  if test "x${ac_cv_header_sys_audioio_h}" = xyes; then 
    380384      AC_DEFINE([DRIVER_SOLARIS_AUDIO], [], [Define if we have and want the solaris audio driver.]) 
    381       sweep_config_driver="Solaris" 
     385      sweep_config_driver="$sweep_config_driver Solaris" 
    382386    fi 
    383387  ;; 
    384388  esac 
    385 fi 
    386389 
    387390dnl Set PACKAGE_LOCALE_DIR in config.h. 
     
    635638** 
    636639**     Experimental code: ....... ${ac_enable_experimental} 
    637 **     Audio device handling: ... $sweep_config_driver 
     640**     Audio devices: ...........$sweep_config_driver 
    638641**     PCM: libsndfile .......... $HAVE_LIBSNDFILE1 
    639642**     Ogg Vorbis support: ...... $HAVE_VORBIS