comparison configure.in @ 865:92615154bb68

Date: Sun, 29 Feb 2004 15:14:22 +0200 From: Martin_Storsj Subject: Dynamic loading of ALSA I recently discovered that SDL can dynamically load ESD and aRts, and made a patch which adds this same functionality to ALSA. The update for configure.in isn't too good (it should e.g. look for libasound.so in other directories than /usr/lib), because I'm not too good at shellscripting and autoconf. The reason for using dlfcn.h and dlopen instead of SDL_LoadLibrary and SDL_LoadFunction is that libasound uses versioned symbols, and it is necessary to load the correct version using dlvsym. This isn't probably any real portability issue, because ALSA is linux-only.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 02 Mar 2004 12:49:16 +0000
parents d3165b90ee42
children e805075f6d94
comparison
equal deleted inserted replaced
864:0c892e99b65b 865:92615154bb68
293 snd_pcm_t *pcm_handle; 293 snd_pcm_t *pcm_handle;
294 ],[ 294 ],[
295 AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes) 295 AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes)
296 ]) 296 ])
297 if test x$have_alsa = xyes; then 297 if test x$have_alsa = xyes; then
298 CFLAGS="$CFLAGS -DALSA_SUPPORT" 298 AC_ARG_ENABLE(alsa-shared,
299 SYSTEM_LIBS="$SYSTEM_LIBS -lasound" 299 [ --enable-alsa-shared dynamically load ALSA audio support [default=yes]],
300 , enable_alsa_shared=yes)
301 alsa_lib=`ls /usr/lib/libasound.so.* | head -1 | sed 's/.*\/\(.*\)/\1/'`
302 if test x$use_dlopen != xyes && \
303 test x$enable_alsa_shared = xyes; then
304 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
305 fi
306 if test x$use_dlopen = xyes && \
307 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
308 CFLAGS="$CFLAGS -DALSA_SUPPORT -DALSA_DYNAMIC=\$(alsa_lib)"
309 AC_SUBST(alsa_lib)
310 else
311 CFLAGS="$CFLAGS -DALSA_SUPPORT"
312 SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
313 fi
300 AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa" 314 AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
301 AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la" 315 AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
302 else 316 else
303 AC_MSG_RESULT($have_alsa) 317 AC_MSG_RESULT($have_alsa)
304 fi 318 fi