Date: Tue, 01 Jun 2004 15:27:44 +0300

From: Martin_Storsj
Subject: Update for dynamic loading of ALSA

I sent you a patch a few months ago which enables SDL to load ALSA
dynamically. Now I've finally got time to tweak this yet some more. I've
added code from alsa.m4 (from alsa's dev package) to acinclude.m4, and
made the detection of the alsa library name a bit better. I've also
fixed up the loading versioned symbols with dlvsym, so that it falls
back to dlsym.

I wouldn't say the configure script is complete yet, but this is how far
I've come this time, and I'm no expert at those things.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40940
This commit is contained in:
Sam Lantinga 2004-08-21 04:20:00 +00:00
parent 1d9ee0370f
commit b3fa599851
3 changed files with 184 additions and 17 deletions

View file

@ -42,7 +42,9 @@
#include "SDL_alsa_audio.h"
#ifdef ALSA_DYNAMIC
#ifdef USE_DLVSYM
#define __USE_GNU
#endif
#include <dlfcn.h>
#include "SDL_name.h"
#include "SDL_loadso.h"
@ -134,7 +136,11 @@ static int LoadALSALibrary(void) {
retval = 0;
for (i = 0; i < SDL_TABLESIZE(alsa_functions); i++) {
/* *alsa_functions[i].func = SDL_LoadFunction(alsa_handle,alsa_functions[i].name);*/
#ifdef USE_DLVSYM
*alsa_functions[i].func = dlvsym(alsa_handle,alsa_functions[i].name,"ALSA_0.9");
if (!*alsa_functions[i].func)
#endif
*alsa_functions[i].func = dlsym(alsa_handle,alsa_functions[i].name);
if (!*alsa_functions[i].func) {
retval = -1;
UnloadALSALibrary();