Commit 151015fa authored by Vincent Béron's avatar Vincent Béron Committed by Alexandre Julliard

Only use Alsa if 1.0 is detected.

parent ed3ad885
......@@ -11391,9 +11391,9 @@ done
if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes"
then
echo "$as_me:$LINENO: checking for snd_pcm_open in -lasound" >&5
echo $ECHO_N "checking for snd_pcm_open in -lasound... $ECHO_C" >&6
if test "${ac_cv_lib_asound_snd_pcm_open+set}" = set; then
echo "$as_me:$LINENO: checking for snd_pcm_hw_params_get_access in -lasound" >&5
echo $ECHO_N "checking for snd_pcm_hw_params_get_access in -lasound... $ECHO_C" >&6
if test "${ac_cv_lib_asound_snd_pcm_hw_params_get_access+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
......@@ -11411,11 +11411,11 @@ extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char snd_pcm_open ();
char snd_pcm_hw_params_get_access ();
int
main ()
{
snd_pcm_open ();
snd_pcm_hw_params_get_access ();
;
return 0;
}
......@@ -11441,26 +11441,72 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_asound_snd_pcm_open=yes
ac_cv_lib_asound_snd_pcm_hw_params_get_access=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_asound_snd_pcm_open=no
ac_cv_lib_asound_snd_pcm_hw_params_get_access=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_open" >&5
echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_open" >&6
if test $ac_cv_lib_asound_snd_pcm_open = yes; then
echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_hw_params_get_access" >&5
echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_hw_params_get_access" >&6
if test $ac_cv_lib_asound_snd_pcm_hw_params_get_access = yes; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_ALSA_ASOUNDLIB_H
#include <alsa/asoundlib.h>
#elif defined(HAVE_SYS_ASOUNDLIB_H)
#include <sys/asoundlib.h>
#endif
int
main ()
{
int ret = snd_pcm_hw_params_get_access(NULL, NULL)
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_ALSA 1
_ACEOF
ALSALIBS="-lasound"
ALSALIBS="-lasound"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
fi
......
......@@ -676,14 +676,20 @@ then
CFLAGS="$save_CFLAGS"
fi
dnl **** Check for ALSA ****
dnl **** Check for ALSA 1.x ****
AC_SUBST(ALSALIBS,"")
AC_CHECK_HEADERS(alsa/asoundlib.h sys/asoundlib.h, break)
if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes"
then
AC_CHECK_LIB(asound,snd_pcm_open,
AC_DEFINE(HAVE_ALSA,1,[Define if you have ALSA including devel headers])
ALSALIBS="-lasound")
AC_CHECK_LIB(asound,snd_pcm_hw_params_get_access,
[AC_TRY_COMPILE([#ifdef HAVE_ALSA_ASOUNDLIB_H
#include <alsa/asoundlib.h>
#elif defined(HAVE_SYS_ASOUNDLIB_H)
#include <sys/asoundlib.h>
#endif],
[int ret = snd_pcm_hw_params_get_access(NULL, NULL)],
[AC_DEFINE(HAVE_ALSA,1,[Define if you have ALSA 1.x including devel headers])
ALSALIBS="-lasound"])])
fi
dnl **** Check for libaudioio (which can be used to get solaris audio support) ****
......
......@@ -8,7 +8,6 @@ EXTRALIBS = -ldxguid -luuid @ALSALIBS@
C_SRCS = \
audio.c \
audio_05.c \
alsa.c \
midi.c
......
......@@ -68,7 +68,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(wave);
#if defined(HAVE_ALSA) && ((SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9) || SND_LIB_MAJOR >= 1)
#ifdef HAVE_ALSA
/* internal ALSALIB functions */
snd_pcm_uframes_t _snd_pcm_mmap_hw_ptr(snd_pcm_t *pcm);
......@@ -3580,9 +3580,7 @@ DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
return MMSYSERR_NOTSUPPORTED;
}
#endif
#if !(defined(HAVE_ALSA) && ((SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9) || SND_LIB_MAJOR >= 1))
#else
/**************************************************************************
* widMessage (WINEALSA.@)
......@@ -3594,10 +3592,6 @@ DWORD WINAPI ALSA_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
return MMSYSERR_NOTENABLED;
}
#endif
#ifndef HAVE_ALSA
/**************************************************************************
* wodMessage (WINEALSA.@)
*/
......
......@@ -48,14 +48,12 @@
#include "winuser.h"
#include "winnls.h"
#include "mmddk.h"
#ifdef HAVE_ALSA
# include "alsa.h"
#endif
#include "alsa.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(midi);
#if defined(HAVE_ALSA) && ((SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9) || SND_LIB_MAJOR >= 1)
#ifdef HAVE_ALSA
typedef struct {
int state; /* -1 disabled, 0 is no recording started, 1 in recording, bit 2 set if in sys exclusive recording */
......@@ -1186,7 +1184,7 @@ static void ALSA_AddMidiPort(snd_seq_client_info_t* cinfo, snd_seq_port_info_t*
}
}
#endif /* defined(HAVE_ALSA) && ((SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9) || SND_LIB_MAJOR >= 1) */
#endif /* HAVE_ALSA */
/*======================================================================*
......@@ -1200,7 +1198,7 @@ static void ALSA_AddMidiPort(snd_seq_client_info_t* cinfo, snd_seq_port_info_t*
*/
LONG ALSA_MidiInit(void)
{
#if defined(HAVE_ALSA) && ((SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9) || SND_LIB_MAJOR >= 1)
#ifdef HAVE_ALSA
static BOOL bInitDone = FALSE;
snd_seq_client_info_t *cinfo;
snd_seq_port_info_t *pinfo;
......@@ -1266,7 +1264,7 @@ DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch (wMsg) {
#if defined(HAVE_ALSA) && ((SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9) || SND_LIB_MAJOR >= 1)
#ifdef HAVE_ALSA
case DRVM_INIT:
case DRVM_EXIT:
case DRVM_ENABLE:
......@@ -1310,7 +1308,7 @@ DWORD WINAPI ALSA_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch (wMsg) {
#if defined(HAVE_ALSA) && ((SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9) || SND_LIB_MAJOR >= 1)
#ifdef HAVE_ALSA
case DRVM_INIT:
case DRVM_EXIT:
case DRVM_ENABLE:
......
......@@ -20,7 +20,7 @@
*/
#undef HAVE_ALLOCA_H
/* Define if you have ALSA including devel headers */
/* Define if you have ALSA 1.x including devel headers */
#undef HAVE_ALSA
/* Define to 1 if you have the <alsa/asoundlib.h> header file. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment