From a7dd995f4c336251841143f56ef14450ce04f491 Mon Sep 17 00:00:00 2001 From: Henri Fallon Date: Mon, 20 Nov 2000 03:31:45 +0000 Subject: [PATCH] Added : alsa support Todo : - test it on several cards - support more than Stereo s16 - make configure check for alsa --- AUTHORS | 1 + ChangeLog | 1 + INSTALL | 2 +- Makefile.in | 10 +- TODO | 2 +- configure | 290 +++++++++++++++++----------------- configure.in | 3 + plugins/alsa/alsa.c | 108 +++++++++++++ plugins/alsa/aout_alsa.c | 328 +++++++++++++++++++++++++++++++++++++++ src/misc/plugins.c | 1 + 10 files changed, 602 insertions(+), 144 deletions(-) create mode 100644 plugins/alsa/alsa.c create mode 100644 plugins/alsa/aout_alsa.c diff --git a/AUTHORS b/AUTHORS index ae27f66211..17f3bfa2b6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,4 +18,5 @@ Stéphane Borel Renaud Dartus + Henri Fallon diff --git a/ChangeLog b/ChangeLog index eb8c109718..06a6b0c595 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ advantage of the SMP machines. * Added --enable-debug, --enable-stats, and --disable-optims in the GNU configure stuff. + * Added alsa audio support (plugin) Mon, 28 Aug 2000 02:34:18 +0200 0.1.99i : diff --git a/INSTALL b/INSTALL index de9ee2cf3c..50090e968a 100644 --- a/INSTALL +++ b/INSTALL @@ -11,7 +11,7 @@ A typical way to configure the vlc is : For a full compilation, you may try : ./configure --prefix=/usr --enable-mmx --enable-gnome --enable-fb \ - --enable-glide --enable-ggi --enable-mga --enable-esd + --enable-glide --enable-ggi --enable-mga --enable-esd --enable-alsa See `./configure --help' for more information. diff --git a/Makefile.in b/Makefile.in index fc1a9d2b6e..b28ad739d2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -339,10 +339,13 @@ PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \ plugins/yuvmmx/video_yuv24.o \ plugins/yuvmmx/video_yuv32.o +PLUGIN_ALSA = plugins/alsa/alsa.o \ + plugins/alsa/aout_alsa.o + PLUGIN_OBJ = $(PLUGIN_BEOS) $(PLUGIN_DSP) $(PLUGIN_DUMMY) $(PLUGIN_ESD) \ $(PLUGIN_FB) $(PLUGIN_GGI) $(PLUGIN_GLIDE) $(PLUGIN_GNOME) \ $(PLUGIN_MGA) $(PLUGIN_X11) $(PLUGIN_YUV) $(PLUGIN_YUVMMX) \ - $(PLUGIN_SDL) + $(PLUGIN_SDL) $(PLUGIN_ALSA) # # Other lists of files # @@ -475,6 +478,11 @@ lib/dsp.so: $(PLUGIN_DSP) $(PLUGIN_DSP): %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< +lib/alsa.so: $(PLUGIN_ALSA) + ld -shared -o $@ $^ +$(PLUGIN_ALSA): %.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + lib/dummy.so: $(PLUGIN_DUMMY) ld -shared -o $@ $^ $(PLUGIN_DUMMY): %.o: %.c diff --git a/TODO b/TODO index 954f1e21dd..761290e77d 100644 --- a/TODO +++ b/TODO @@ -157,7 +157,7 @@ Urgency: Normal Description: ALSA audio output support ALSA is the Advanced Linux Sound Architecture and is believed to be technically superior to the usual OSS support found in the Linux kernel. -Status: Todo +Status: Done ( henri ) Task: 0x28 Difficulty: Guru diff --git a/configure b/configure index a7d641f8e0..9224c9dab7 100755 --- a/configure +++ b/configure @@ -37,6 +37,8 @@ ac_help="$ac_help --enable-glide Glide (3dfx) support (default disabled)" ac_help="$ac_help --enable-gnome Gnome support (default disabled)" +ac_help="$ac_help + --enable-alsa Alsa sound drivers supprt (default disabled)" ac_help="$ac_help --enable-x11 X11 support (default enabled)" @@ -577,7 +579,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:575: checking host system type" >&5 +echo "configure:577: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -604,7 +606,7 @@ VLC_CODENAME=Onatopp echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:602: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:604: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -634,7 +636,7 @@ if test -z "$CC"; then # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:632: checking for $ac_word" >&5 +echo "configure:634: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -664,7 +666,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:662: checking for $ac_word" >&5 +echo "configure:664: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -715,7 +717,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:713: checking for $ac_word" >&5 +echo "configure:715: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -747,7 +749,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:745: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:747: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -758,12 +760,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 756 "configure" +#line 758 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -789,12 +791,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:787: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:789: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:792: checking whether we are using GNU C" >&5 +echo "configure:794: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -803,7 +805,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -822,7 +824,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:820: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:822: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -856,7 +858,7 @@ fi fi if test -z "$CPP"; then echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:854: checking how to run the C preprocessor" >&5 +echo "configure:856: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -871,13 +873,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:875: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -888,13 +890,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -905,13 +907,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -949,7 +951,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:947: checking for a BSD compatible install" >&5 +echo "configure:949: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1003,12 +1005,12 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1001: checking for working const" >&5 +echo "configure:1003: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1078,14 +1080,14 @@ EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1076: checking whether byte ordering is bigendian" >&5 +echo "configure:1078: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1096,11 +1098,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1111,7 +1113,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1131,7 +1133,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1171,12 +1173,12 @@ fi for ac_func in gettimeofday select strerror strtod strtol do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1169: checking for $ac_func" >&5 +echo "configure:1171: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1226,12 +1228,12 @@ done for ac_func in setenv putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1224: checking for $ac_func" >&5 +echo "configure:1226: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1279,12 +1281,12 @@ fi done echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1277: checking for connect" >&5 +echo "configure:1279: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -1325,7 +1327,7 @@ if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:1323: checking for connect in -lsocket" >&5 +echo "configure:1325: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1333,7 +1335,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1374,12 +1376,12 @@ fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1372: checking for gethostbyname" >&5 +echo "configure:1374: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1420,7 +1422,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1418: checking for gethostbyname in -lnsl" >&5 +echo "configure:1420: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1428,7 +1430,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1469,12 +1471,12 @@ fi fi echo $ac_n "checking for nanosleep""... $ac_c" 1>&6 -echo "configure:1467: checking for nanosleep" >&5 +echo "configure:1469: checking for nanosleep" >&5 if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_nanosleep=yes" else @@ -1515,7 +1517,7 @@ if eval "test \"`echo '$ac_cv_func_'nanosleep`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6 -echo "configure:1513: checking for nanosleep in -lrt" >&5 +echo "configure:1515: checking for nanosleep in -lrt" >&5 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1523,7 +1525,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1560,7 +1562,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6 -echo "configure:1558: checking for nanosleep in -lposix4" >&5 +echo "configure:1560: checking for nanosleep in -lposix4" >&5 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1568,7 +1570,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1613,12 +1615,12 @@ fi for ac_func in usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1611: checking for $ac_func" >&5 +echo "configure:1613: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1666,12 +1668,12 @@ fi done echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:1664: checking for inet_aton" >&5 +echo "configure:1666: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else @@ -1712,7 +1714,7 @@ if eval "test \"`echo '$ac_cv_func_'inet_aton`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:1710: checking for inet_aton in -lresolv" >&5 +echo "configure:1712: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1720,7 +1722,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1764,17 +1766,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1762: checking for $ac_hdr" >&5 +echo "configure:1764: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1803,12 +1805,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1801: checking for $ac_func" >&5 +echo "configure:1803: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1856,7 +1858,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1854: checking for working mmap" >&5 +echo "configure:1856: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1864,7 +1866,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2030,12 +2032,12 @@ EOF fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2028: checking for vprintf" >&5 +echo "configure:2030: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2082,12 +2084,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2080: checking for _doprnt" >&5 +echo "configure:2082: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2135,12 +2137,12 @@ fi fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2133: checking return type of signal handlers" >&5 +echo "configure:2135: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2157,7 +2159,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2176,7 +2178,7 @@ EOF echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2174: checking for dlopen in -ldl" >&5 +echo "configure:2176: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2184,7 +2186,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2223,7 +2225,7 @@ else fi echo $ac_n "checking for optarg in -lgnugetopt""... $ac_c" 1>&6 -echo "configure:2221: checking for optarg in -lgnugetopt" >&5 +echo "configure:2223: checking for optarg in -lgnugetopt" >&5 ac_lib_var=`echo gnugetopt'_'optarg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2231,7 +2233,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnugetopt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2270,7 +2272,7 @@ else fi echo $ac_n "checking for _ in -lbe""... $ac_c" 1>&6 -echo "configure:2268: checking for _ in -lbe" >&5 +echo "configure:2270: checking for _ in -lbe" >&5 ac_lib_var=`echo be'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2278,7 +2280,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbe $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2317,7 +2319,7 @@ else fi echo $ac_n "checking for _ in -lgame""... $ac_c" 1>&6 -echo "configure:2315: checking for _ in -lgame" >&5 +echo "configure:2317: checking for _ in -lgame" >&5 ac_lib_var=`echo game'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2325,7 +2327,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgame $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2364,7 +2366,7 @@ else fi echo $ac_n "checking for _ in -lroot""... $ac_c" 1>&6 -echo "configure:2362: checking for _ in -lroot" >&5 +echo "configure:2364: checking for _ in -lroot" >&5 ac_lib_var=`echo root'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2372,7 +2374,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lroot $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2411,7 +2413,7 @@ else fi echo $ac_n "checking for powl in -lm""... $ac_c" 1>&6 -echo "configure:2409: checking for powl in -lm" >&5 +echo "configure:2411: checking for powl in -lm" >&5 ac_lib_var=`echo m'_'powl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2419,7 +2421,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2458,7 +2460,7 @@ else fi echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:2456: checking for pthread_create in -lpthread" >&5 +echo "configure:2458: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2466,7 +2468,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2505,7 +2507,7 @@ else fi echo $ac_n "checking for thread_create in -lthreads""... $ac_c" 1>&6 -echo "configure:2503: checking for thread_create in -lthreads" >&5 +echo "configure:2505: checking for thread_create in -lthreads" >&5 ac_lib_var=`echo threads'_'thread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2513,7 +2515,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2553,12 +2555,12 @@ fi echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 -echo "configure:2551: checking for getopt_long" >&5 +echo "configure:2553: checking for getopt_long" >&5 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getopt_long=yes" else @@ -2607,17 +2609,17 @@ for ac_hdr in fcntl.h sys/ioctl.h sys/time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2605: checking for $ac_hdr" >&5 +echo "configure:2607: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2647,17 +2649,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2645: checking for $ac_hdr" >&5 +echo "configure:2647: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2687,17 +2689,17 @@ for ac_hdr in dlfcn.h image.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2685: checking for $ac_hdr" >&5 +echo "configure:2687: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2727,17 +2729,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2725: checking for $ac_hdr" >&5 +echo "configure:2727: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2768,17 +2770,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2766: checking for $ac_hdr" >&5 +echo "configure:2768: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2806,12 +2808,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2804: checking for working const" >&5 +echo "configure:2806: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2881,12 +2883,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2879: checking for ANSI C header files" >&5 +echo "configure:2881: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2894,7 +2896,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2911,7 +2913,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2929,7 +2931,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2950,7 +2952,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2961,7 +2963,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2985,12 +2987,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2983: checking for size_t" >&5 +echo "configure:2985: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3018,12 +3020,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3016: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3018: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3032,7 +3034,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3145,6 +3147,12 @@ if test "${enable_gnome+set}" = set; then if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi fi +# Check whether --enable-alsa or --disable-alsa was given. +if test "${enable_alsa+set}" = set; then + enableval="$enable_alsa" + if test x$enable_alsa = xyes; then PLUGINS=${PLUGINS}"alsa "; fi +fi + # Check whether --enable-x11 or --disable-x11 was given. if test "${enable_x11+set}" = set; then enableval="$enable_x11" diff --git a/configure.in b/configure.in index 1e6ee23b98..d0de2b8144 100644 --- a/configure.in +++ b/configure.in @@ -115,6 +115,9 @@ AC_ARG_ENABLE(glide, AC_ARG_ENABLE(gnome, [ --enable-gnome Gnome support (default disabled)], [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi]) +AC_ARG_ENABLE(alsa, + [ --enable-alsa Alsa sound drivers supprt (default disabled)], + [if test x$enable_alsa = xyes; then PLUGINS=${PLUGINS}"alsa "; fi]) AC_ARG_ENABLE(x11, [ --enable-x11 X11 support (default enabled)]) if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c new file mode 100644 index 0000000000..d2240b8dd4 --- /dev/null +++ b/plugins/alsa/alsa.c @@ -0,0 +1,108 @@ +/***************************************************************************** + * dsp.c : OSS /dev/dsp plugin for vlc + ***************************************************************************** + * Copyright (C) 2000 VideoLAN + * + * Authors: + * Henri Fallon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +#include "defs.h" + +#include +#include +#include /* for alsa :) */ +#include +#include /* malloc(), free() */ +// #include /* close() */ + +#include "config.h" +#include "common.h" /* boolean_t, byte_t */ +#include "threads.h" +#include "mtime.h" +#include "tests.h" +#include "plugins.h" + +#include "interface.h" +#include "audio_output.h" +#include "video.h" +#include "video_output.h" + +#include "main.h" + + +/***************************************************************************** + * Exported prototypes + *****************************************************************************/ +static void aout_GetPlugin( p_aout_thread_t p_aout ); + +/* Audio output */ +int aout_AlsaOpen ( aout_thread_t *p_aout ); +int aout_AlsaReset ( aout_thread_t *p_aout ); +int aout_AlsaSetFormat ( aout_thread_t *p_aout ); +int aout_AlsaSetChannels ( aout_thread_t *p_aout ); +int aout_AlsaSetRate ( aout_thread_t *p_aout ); +long aout_AlsaGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info ); +void aout_AlsaPlaySamples ( aout_thread_t *p_aout, byte_t *buffer, + int i_size ); +void aout_AlsaClose ( aout_thread_t *p_aout ); + +/***************************************************************************** + * GetConfig: get the plugin structure and configuration + *****************************************************************************/ +plugin_info_t * GetConfig( void ) +{ + int i_fd; + plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) ); + + p_info->psz_name = "Alsa plugin"; + p_info->psz_version = VERSION; + p_info->psz_author = "the VideoLAN team "; + + p_info->aout_GetPlugin = aout_GetPlugin; + p_info->vout_GetPlugin = NULL; + p_info->intf_GetPlugin = NULL; + p_info->yuv_GetPlugin = NULL; + + + /* TODO : test if alsa is available */ + p_info->i_score = 0x100; + + /* If this plugin was requested, score it higher */ + if( TestMethod( AOUT_METHOD_VAR, "alsa" ) ) + { + p_info->i_score += 0x200; + } + + return( p_info ); +} + +/***************************************************************************** + * Following functions are only called through the p_info structure + *****************************************************************************/ + +static void aout_GetPlugin( p_aout_thread_t p_aout ) +{ + p_aout->p_sys_open = aout_AlsaOpen; + p_aout->p_sys_reset = aout_AlsaReset; + p_aout->p_sys_setformat = aout_AlsaSetFormat; + p_aout->p_sys_setchannels = aout_AlsaSetChannels; + p_aout->p_sys_setrate = aout_AlsaSetRate; + p_aout->p_sys_getbufinfo = aout_AlsaGetBufInfo; + p_aout->p_sys_playsamples = aout_AlsaPlaySamples; + p_aout->p_sys_close = aout_AlsaClose; +} diff --git a/plugins/alsa/aout_alsa.c b/plugins/alsa/aout_alsa.c new file mode 100644 index 0000000000..7847511b74 --- /dev/null +++ b/plugins/alsa/aout_alsa.c @@ -0,0 +1,328 @@ +/***************************************************************************** + * aout_alsa.c : Alsa functions library + ***************************************************************************** + * Copyright (C) 2000 VideoLAN + * + * Authors: + * Henri Fallon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +/***************************************************************************** + * Preamble + *****************************************************************************/ + +#include "defs.h" + +#include /* ENOMEM */ +#include /* open(), O_WRONLY */ +#include /* ioctl() */ +#include /* strerror() */ +#include /* write(), close() */ +#include /* "intf_msg.h" */ +#include /* calloc(), malloc(), free() */ + +#include +#include + +#include "config.h" +#include "common.h" /* boolean_t, byte_t */ +#include "threads.h" +#include "mtime.h" +#include "plugins.h" + +#include "audio_output.h" /* aout_thread_t */ + +#include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */ +#include "main.h" + + + + +typedef struct alsa_device_s +{ + int i_num; +} alsa_device_t; + +typedef struct alsa_card_s +{ + int i_num; +} alsa_card_t; + +/* here we store plugin dependant informations */ + +typedef struct aout_sys_s +{ + snd_pcm_t * p_alsa_handle; + alsa_device_t * p_alsa_device; + alsa_card_t * p_alsa_card; + snd_pcm_channel_params_t s_alsa_channel_params; + snd_pcm_format_t s_alsa_format; +} aout_sys_t; + + + +/***************************************************************************** + * aout_AlsaOpen : creates a handle and opens an alsa device + *****************************************************************************/ + +int aout_AlsaOpen( aout_thread_t *p_aout ) +{ + + int i_open_returns; + + /* Allocate structures */ + p_aout->p_sys = malloc( sizeof( aout_sys_t ) ); + if( p_aout->p_sys == NULL ) + { + intf_ErrMsg("error: %s\n", strerror(ENOMEM) ); + return( 1 ); + } + + p_aout->p_sys->p_alsa_device = malloc( sizeof( alsa_device_t) ); + p_aout->p_sys->p_alsa_card = malloc( sizeof( alsa_device_t ) ); + if( ( p_aout->p_sys->p_alsa_device == NULL ) || + ( p_aout->p_sys->p_alsa_card == NULL ) ) + { + intf_ErrMsg ( "error: %s\n", strerror(ENOMEM) ); + return ( 1 ); + } + + /* Initialize */ + p_aout->p_sys->p_alsa_device->i_num = 0; + p_aout->p_sys->p_alsa_card->i_num = 0; + /* FIXME : why not other format ? */ + p_aout->i_format = AOUT_FMT_S16_LE; + /* FIXME : why always 2 channels ?*/ + p_aout->i_channels = 2; + p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT ); + + /* Open device */ + if ( ( i_open_returns = snd_pcm_open( &(p_aout->p_sys->p_alsa_handle), + p_aout->p_sys->p_alsa_card->i_num, + p_aout->p_sys->p_alsa_device->i_num, + SND_PCM_OPEN_PLAYBACK ) ) ) + { + intf_ErrMsg ( "could not open alsa device; error code : %i\n", + i_open_returns ); + return ( 1 ); + } + + return ( 0 ); + + intf_ErrMsg("Alsa device open \n\n"); +} + + +/***************************************************************************** + * aout_AlsaSetFormat : sets the alsa output format + *****************************************************************************/ + +int aout_AlsaSetFormat ( aout_thread_t *p_aout ) +{ + + int i_set_param_returns; + int i_prepare_playback_returns; + int i_playback_go_returns; + + /* Fill with zeros */ + memset(&p_aout->p_sys->s_alsa_channel_params,0, + sizeof(p_aout->p_sys->s_alsa_channel_params)); + + /* Fill the s_alsa_channel_params structure */ + + /* Tranfer mode and direction*/ + p_aout->p_sys->s_alsa_channel_params.channel = SND_PCM_CHANNEL_PLAYBACK ; + p_aout->p_sys->s_alsa_channel_params.mode = SND_PCM_MODE_STREAM; + + /* Format and rate */ + p_aout->p_sys->s_alsa_channel_params.format.interleave = 1; + if ( p_aout->i_format == AOUT_FMT_S16_LE ) + p_aout->p_sys->s_alsa_channel_params.format.format = + SND_PCM_SFMT_S16_LE; + else + p_aout->p_sys->s_alsa_channel_params.format.format = + SND_PCM_SFMT_S16_BE; + + p_aout->p_sys->s_alsa_channel_params.format.rate = p_aout->l_rate; + p_aout->p_sys->s_alsa_channel_params.format.voices = p_aout->i_channels ; + + /* When to start playing and when to stop */ + p_aout->p_sys->s_alsa_channel_params.start_mode = SND_PCM_START_DATA; + p_aout->p_sys->s_alsa_channel_params.stop_mode = SND_PCM_STOP_STOP; + + /* Buffer information . I have chosen the stream mode here + * instead of the block mode. I don't know whether i'm wrong + * but it seemed more logical */ + p_aout->p_sys->s_alsa_channel_params.buf.stream.queue_size = 131072; + /* Fill with silence */ + p_aout->p_sys->s_alsa_channel_params.buf.stream.fill = SND_PCM_FILL_NONE ; + p_aout->p_sys->s_alsa_channel_params.buf.stream.max_fill = 0 ; + + /* Now we pass this to the driver */ + i_set_param_returns = snd_pcm_channel_params ( + p_aout->p_sys->p_alsa_handle, + &(p_aout->p_sys->s_alsa_channel_params) ); + + if ( i_set_param_returns ) + { + intf_ErrMsg ( "ALSA_PLUGIN : Unable to set parameters; exit = %i\n", + i_set_param_returns ); + intf_ErrMsg( "This means : %s\n\n", + snd_strerror( i_set_param_returns ) ); + return ( 1 ); + } + + /* we shall now prepare the channel */ + i_prepare_playback_returns = + snd_pcm_playback_prepare ( p_aout->p_sys->p_alsa_handle ); + + if ( i_prepare_playback_returns ) + { + intf_ErrMsg ( "ALSA_PLUGIN : Unable to prepare channel : exit = %i\n", + i_prepare_playback_returns ); + intf_ErrMsg( "This means : %s\n\n", + snd_strerror( i_set_param_returns ) ); + + return ( 1 ); + } + + /* then we may go */ + i_playback_go_returns = + snd_pcm_playback_go ( p_aout->p_sys->p_alsa_handle ); + if ( i_playback_go_returns ) + { + intf_ErrMsg ( "ALSA_PLUGIN : Unable to prepare channel (bis) : + exit = %i\n", i_playback_go_returns ); + intf_ErrMsg( "This means : %s\n\n", + snd_strerror( i_set_param_returns ) ); + return ( 1 ); + } + return ( 0 ); +} + +/***************************************************************************** + * aout_AlsaReset: resets the dsp + *****************************************************************************/ +int aout_AlsaReset ( aout_thread_t *p_aout ) +{ + /* TODO : put something in here, such as close and open again + * or check status, drain, flush, .... */ + return ( 0 ); +} + +/***************************************************************************** + * aout_AlsaSetChannels: sets mono, stereo and other modes + *****************************************************************************/ +int aout_AlsaSetChannels ( aout_thread_t *p_aout ) +{ + /* TODO : normally, nothing + * everything should be done in the AlsaSetFormat, as far a I understand + * the alsa documentation + */ + return ( 0 ); +} + +/***************************************************************************** + * aout_AlsaSetRate: sets the audio output rate + ***************************************************************************** + * As in the previous function, the rate is supposed to be set in the + * AlsaSetFormat function + *****************************************************************************/ +int aout_AlsaSetRate ( aout_thread_t *p_aout ) +{ + return ( 0 ); +} + +/***************************************************************************** + * aout_AlsaGetBufInfo: buffer status query + *****************************************************************************/ +long aout_AlsaGetBufInfo ( aout_thread_t *p_aout, long l_buffer_limit ) +{ + snd_pcm_channel_status_t alsa_channel_status; + int i_alsa_get_status_returns; + + memset (&alsa_channel_status, 0, sizeof(alsa_channel_status)); + i_alsa_get_status_returns = snd_pcm_channel_status ( + p_aout->p_sys->p_alsa_handle, &alsa_channel_status ); + + if ( i_alsa_get_status_returns ) + { + intf_ErrMsg ( "Error getting alsa buffer info; exit=%i\n", + i_alsa_get_status_returns ); + intf_ErrMsg ( "This means : %s \n\n", + snd_strerror ( i_alsa_get_status_returns ) ); + return ( 1 ); + } + + switch (alsa_channel_status.status) + { + case SND_PCM_STATUS_NOTREADY : intf_ErrMsg("Status NOT READY \n \n"); + break; + case SND_PCM_STATUS_UNDERRUN : { + int i_drain_returns; + intf_ErrMsg( + "Status UNDERRUN ... draining \n \n"); + i_drain_returns = + snd_pcm_playback_prepare( + p_aout->p_sys->p_alsa_handle ); + if ( i_drain_returns ) + { + intf_ErrMsg( + "Error : could not flush : %i\n", + i_drain_returns); + intf_ErrMsg( + "This means : %s\n", + snd_strerror(i_drain_returns)); + } + break; + } + } + return ( alsa_channel_status.count ); +} + +/***************************************************************************** + * aout_AlsaPlaySamples + *****************************************************************************/ +void aout_AlsaPlaySamples ( aout_thread_t *p_aout, byte_t *buffer, int i_size ) +{ + int i_write_returns; + + i_write_returns = (int) snd_pcm_write ( + p_aout->p_sys->p_alsa_handle, (void *)buffer, (size_t) i_size ); + + if ( i_write_returns <= 0 ) + { + intf_ErrMsg ( "Error writing blocks; exit=%i\n", i_write_returns ); + intf_ErrMsg ( "This means : %s\n", snd_strerror( i_write_returns ) ); + } +} + +/***************************************************************************** + * aout_AlsaClose : close the Alsa device + *****************************************************************************/ +void aout_AlsaClose ( aout_thread_t *p_aout ) +{ + int i_close_returns; + + i_close_returns = snd_pcm_close ( p_aout->p_sys->p_alsa_handle ); + + if ( i_close_returns ) + { + intf_ErrMsg( "Error closing alsa device; exit=%i\n",i_close_returns ); + intf_ErrMsg( "This means : %s\n\n",snd_strerror( i_close_returns ) ); + } +} diff --git a/src/misc/plugins.c b/src/misc/plugins.c index 1b2778e275..ccb34a6a75 100644 --- a/src/misc/plugins.c +++ b/src/misc/plugins.c @@ -107,6 +107,7 @@ void bank_Init( plugin_bank_t * p_bank ) /* Audio pluins */ SEEK_PLUGIN( "dsp" ); SEEK_PLUGIN( "esd" ); + SEEK_PLUGIN( "alsa" ); /* Dummy plugin */ SEEK_PLUGIN( "dummy" ); -- 2.39.2