Allow build without libdl and libpthread

Allow building alsa-lib without libdl and libpthread.
Added new options to configure, --with-libdl and --with-pthread.
This commit is contained in:
Takashi Iwai 2007-03-22 00:48:18 +01:00
parent 9a75eec664
commit 70e4ec9d08
21 changed files with 118 additions and 25 deletions

View file

@ -415,12 +415,13 @@ beginning:</P>
#include <stdarg.h>
#include <dlfcn.h>
#include <limits.h>
#include <sys/stat.h>
#include <pthread.h>
#include <locale.h>
#include "local.h"
#ifdef HAVE_LIBPTHREAD
#include <pthread.h>
#endif
#ifndef DOC_HIDDEN
@ -3080,7 +3081,9 @@ int snd_config_update_r(snd_config_t **_top, snd_config_update_t **_update, cons
return 1;
}
#ifdef HAVE_LIBPTHREAD
static pthread_mutex_t snd_config_update_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
/**
* \brief Updates #snd_config by rereading the global configuration files (if needed).
@ -3099,9 +3102,13 @@ int snd_config_update(void)
{
int err;
#ifdef HAVE_LIBPTHREAD
pthread_mutex_lock(&snd_config_update_mutex);
#endif
err = snd_config_update_r(&snd_config, &snd_config_global_update, NULL);
#ifdef HAVE_LIBPTHREAD
pthread_mutex_unlock(&snd_config_update_mutex);
#endif
return err;
}
@ -3128,15 +3135,18 @@ int snd_config_update_free(snd_config_update_t *update)
*/
int snd_config_update_free_global(void)
{
#ifdef HAVE_LIBPTHREAD
pthread_mutex_lock(&snd_config_update_mutex);
#endif
if (snd_config)
snd_config_delete(snd_config);
snd_config = NULL;
if (snd_config_global_update)
snd_config_update_free(snd_config_global_update);
snd_config_global_update = NULL;
#ifdef HAVE_LIBPTHREAD
pthread_mutex_unlock(&snd_config_update_mutex);
#endif
/* FIXME: better to place this in another place... */
snd_dlobj_cache_cleanup();