ALSA fixes, MIDI fixes and some new features, misc fixes and a
[terminatorX.git] / configure.in
index c06885cf34a8c87cdae89d61cbfa71ec79df42e3..95650cb26510736389113da1cfbcb9576ff6c71d 100644 (file)
@@ -13,6 +13,7 @@ dnl AC_ARG_ENABLE(benchmark,[  --enable-benchmark      creates a non-functional
 AC_ARG_ENABLE(wav,          [  --enable-wav            enables the builtin wav-loader (default=yes) ])
 AC_ARG_ENABLE(xsetpointer,  [  --enable-xsetpointer    enables executing of xsetpointer (default=auto) ])
 AC_ARG_ENABLE(alsa,         [  --enable-alsa           use ALSA for sound output (default=auto) ])
+AC_ARG_ENABLE(jack,         [  --enable-jack           use JACK for sound output (default=auto) ])
 AC_ARG_ENABLE(oss,          [  --enable-oss            use OSS for sound output (default=auto) ])
 dnl AC_ARG_ENABLE(dga2,     [  --enable-dga2           use DGA2 instead of DGA1. (experimental) (default=no) ])
 AC_ARG_ENABLE(libxml2,     [  --disable-libxml2       use libxml even if verion 2 detected (default=auto) ])
@@ -33,6 +34,9 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_RANLIB
 
+OPTION_OSS="no"
+OPTION_ALSA="no"
+OPTION_JACK="no"
 OPTION_SOX="no"
 OPTION_MPG123="no"
 OPTION_MAD="no"
@@ -275,6 +279,7 @@ fi
 
 using_alsa=no
 using_oss=no
+using_jack=no
 
 if test "$enable_alsa" != "no"; then
     AC_CHECK_LIB(asound, snd_pcm_writei,alsalib=yes,alsalib=no)
@@ -282,9 +287,10 @@ if test "$enable_alsa" != "no"; then
 
     if test "$alsalib" = "yes"; then
            if test "$alsaheader" = "yes"; then
-                   AC_DEFINE_UNQUOTED([USE_ALSA], 1, [ Define to use ALSA audio backend instead of OSS.])
+                   AC_DEFINE_UNQUOTED([USE_ALSA], 1, [ Define to enable ALSA audio backend. ])
                    LIBS="$LIBS -lasound"
-                   using_alsa=yes;
+                   using_alsa=yes
+                   OPTION_ALSA=yes
            else 
                    if test "$enable_alsa" = "yes"; then
                            AC_MSG_ERROR([** Coulnd't find ALSA header file sys/asoundlib.h **])
@@ -297,11 +303,35 @@ if test "$enable_alsa" != "no"; then
     fi
 fi
 
+if test "$enable_jack" != "no"; then
+    AC_CHECK_LIB(jack,jack_activate,jacklib=yes,jacklib=no)
+    AC_CHECK_HEADERS(jack/jack.h,jackheader=yes,jackheader=no)
+
+    if test "$jacklib" = "yes"; then
+           if test "$jackheader" = "yes"; then
+                   AC_DEFINE_UNQUOTED([USE_JACK], 1, [ Define to enable JACK audio backend.])
+                   LIBS="$LIBS -ljack"
+                   using_jack=yes
+                   OPTION_JACK=yes
+           else 
+                   if test "$enable_jack" = "yes"; then
+                           AC_MSG_ERROR([** Coulnd't find JACK header file jack/jack.h **])
+                   fi
+           fi
+    else
+           if test "$enable_jack" = "yes"; then
+                   AC_MSG_ERROR([** Coulnd'f find JACK library libjack. **])
+           fi
+    fi
+fi
+
+
 if test "$enable_oss" != "no"; then
        AC_CHECK_HEADERS(sys/ioctl.h sys/soundcard.h,oss=yes,oss=no)
        
        if test "$oss" = "yes"; then
                AC_DEFINE_UNQUOTED([USE_OSS], 1, [Use OSS])
+               OPTION_OSS=yes
                using_oss=yes;
        else
                if test "$enable_oss" = "yes"; then
@@ -336,18 +366,11 @@ if test "$enable_alsamidi" != "no"; then
        fi
 fi
 
-if test "$using_alsa" = "yes"; then
-       AC_MSG_RESULT([termnatorX audiodevice: using ALSA.])
-       AC_DEFINE_UNQUOTED([USE_ALSA], 1, [Define for ALSA pcm output])
-else 
-       if test "$using_oss" = "yes"; then
-               AC_MSG_RESULT([termnatorX audiodevice: using OSS.])
-       fi
-fi
-
 if test "$using_alsa" != "yes"; then
        if test "$using_oss" != "yes"; then
-               AC_MSG_ERROR([** Found neither OSS nor ALSA! **])
+               if test "$using_jack" != "yes"; then
+                       AC_MSG_ERROR([** Found neither OSS, ALSA nor JACK - no output device! **])
+               fi
        fi
 fi     
        
@@ -564,6 +587,16 @@ echo "     -       http://www.mpg123.de/"
 echo " - and reconfigure terminatorX"
 fi
 
+
+option=oss; option_val=$OPTION_OSS; option_url=http://www.kernel.org
+option_info;
+
+option=alsa; option_val=$OPTION_ALSA; option_url=http://www.alsa-project.org
+option_info;
+
+option=jack; option_val=$OPTION_JACK; option_url=http://jackit.sourceforge.net
+option_info;
+
 option=mad; option_val=$OPTION_MAD; option_url=http://www.mars.org/home/rob/proj/mpeg/
 option_info;
 
@@ -587,9 +620,10 @@ if test "$OPTION_SUIDROOT" = "yes"; then
        option_info;
 fi
 
-echo "legacy files supprt: $OPTION_LEGACY"
+echo "legacy files support: $OPTION_LEGACY"
 echo "builtin-wav support: $OPTION_WAV"
 echo "enhanced scheduling support: $OPTION_SCHEDULER"
+echo "suid-root support: $OPTION_SUIDROOT"
 echo "GNOME support: $OPTION_GNOME"
 echo
 echo You can now run \'make\' to compile terminatorX