mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
Changes for static build.
This commit is contained in:
parent
caa8d5372e
commit
27472b56a6
44 changed files with 362 additions and 158 deletions
|
|
@ -1,6 +1,7 @@
|
|||
EXTRA_LTLIBRARIES=libtimer.la
|
||||
|
||||
libtimer_la_SOURCES = timer.c timer_hw.c timer_query.c timer_query_hw.c
|
||||
libtimer_la_SOURCES = timer.c timer_hw.c timer_query.c timer_query_hw.c \
|
||||
timer_symbols.c
|
||||
noinst_HEADERS = timer_local.h
|
||||
all: libtimer.la
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ static int snd_timer_open_conf(snd_timer_t **timer,
|
|||
snd_config_iterator_t i, next;
|
||||
const char *lib = NULL, *open_name = NULL;
|
||||
int (*open_func)(snd_timer_t **, const char *, snd_config_t *, snd_config_t *, int) = NULL;
|
||||
#ifndef PIC
|
||||
extern void *snd_timer_open_symbols(void);
|
||||
#endif
|
||||
void *h;
|
||||
if (snd_config_get_type(timer_conf) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
if (name)
|
||||
|
|
@ -101,20 +104,19 @@ static int snd_timer_open_conf(snd_timer_t **timer,
|
|||
open_name = buf;
|
||||
snprintf(buf, sizeof(buf), "_snd_timer_%s_open", str);
|
||||
}
|
||||
h = dlopen(lib, RTLD_NOW);
|
||||
if (h) {
|
||||
if ((err = snd_dlsym_verify(h, open_name, SND_DLSYM_VERSION(SND_TIMER_DLSYM_VERSION))) < 0) {
|
||||
dlclose(h);
|
||||
goto _err;
|
||||
}
|
||||
open_func = dlsym(h, open_name);
|
||||
}
|
||||
#ifndef PIC
|
||||
snd_timer_open_symbols();
|
||||
#endif
|
||||
h = snd_dlopen(lib, RTLD_NOW);
|
||||
if (h)
|
||||
open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_TIMER_DLSYM_VERSION));
|
||||
err = 0;
|
||||
if (!h) {
|
||||
SNDERR("Cannot open shared library %s", lib);
|
||||
err = -ENOENT;
|
||||
} else if (!open_func) {
|
||||
SNDERR("symbol %s is not defined inside %s", open_name, lib);
|
||||
dlclose(h);
|
||||
snd_dlclose(h);
|
||||
err = -ENXIO;
|
||||
}
|
||||
_err:
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include "timer_local.h"
|
||||
|
||||
#ifndef PIC
|
||||
/* entry for static linking */
|
||||
const char *_snd_module_timer_hw = "";
|
||||
#endif
|
||||
|
||||
#define SNDRV_FILE_TIMER "/dev/snd/timer"
|
||||
#define SNDRV_TIMER_VERSION_MAX SNDRV_PROTOCOL_VERSION(2, 0, 0)
|
||||
|
||||
|
|
@ -200,7 +205,6 @@ int snd_timer_hw_open(snd_timer_t **handle, const char *name, int dev_class, int
|
|||
return 0;
|
||||
}
|
||||
|
||||
SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION);
|
||||
int _snd_timer_hw_open(snd_timer_t **timer, char *name,
|
||||
snd_config_t *root ATTRIBUTE_UNUSED,
|
||||
snd_config_t *conf, int mode)
|
||||
|
|
@ -260,3 +264,4 @@ int _snd_timer_hw_open(snd_timer_t **timer, char *name,
|
|||
return -EINVAL;
|
||||
return snd_timer_hw_open(timer, name, dev_class, dev_sclass, card, device, subdevice, mode);
|
||||
}
|
||||
SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ static int snd_timer_query_open_conf(snd_timer_query_t **timer,
|
|||
snd_config_iterator_t i, next;
|
||||
const char *lib = NULL, *open_name = NULL;
|
||||
int (*open_func)(snd_timer_query_t **, const char *, snd_config_t *, snd_config_t *, int) = NULL;
|
||||
#ifndef PIC
|
||||
extern void *snd_timer_query_open_symbols(void);
|
||||
#endif
|
||||
void *h;
|
||||
if (snd_config_get_type(timer_conf) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
if (name)
|
||||
|
|
@ -100,20 +103,18 @@ static int snd_timer_query_open_conf(snd_timer_query_t **timer,
|
|||
open_name = buf;
|
||||
snprintf(buf, sizeof(buf), "_snd_timer_query_%s_open", str);
|
||||
}
|
||||
h = dlopen(lib, RTLD_NOW);
|
||||
if (h) {
|
||||
if ((err = snd_dlsym_verify(h, open_name, SND_DLSYM_VERSION(SND_TIMER_QUERY_DLSYM_VERSION))) < 0) {
|
||||
dlclose(h);
|
||||
goto _err;
|
||||
}
|
||||
open_func = dlsym(h, open_name);
|
||||
}
|
||||
#ifndef PIC
|
||||
snd_timer_query_open_symbols();
|
||||
#endif
|
||||
h = snd_dlopen(lib, RTLD_NOW);
|
||||
if (h)
|
||||
open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_TIMER_QUERY_DLSYM_VERSION));
|
||||
if (!h) {
|
||||
SNDERR("Cannot open shared library %s", lib);
|
||||
err = -ENOENT;
|
||||
} else if (!open_func) {
|
||||
SNDERR("symbol %s is not defined inside %s", open_name, lib);
|
||||
dlclose(h);
|
||||
snd_dlclose(h);
|
||||
err = -ENXIO;
|
||||
}
|
||||
_err:
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include "timer_local.h"
|
||||
|
||||
#ifndef PIC
|
||||
/* entry for static linking */
|
||||
const char *_snd_module_timer_query_hw = "";
|
||||
#endif
|
||||
|
||||
#define SNDRV_FILE_TIMER "/dev/snd/timer"
|
||||
#define SNDRV_TIMER_VERSION_MAX SNDRV_PROTOCOL_VERSION(2, 0, 0)
|
||||
|
||||
|
|
@ -88,7 +93,6 @@ int snd_timer_query_hw_open(snd_timer_query_t **handle, const char *name, int mo
|
|||
return 0;
|
||||
}
|
||||
|
||||
SND_DLSYM_BUILD_VERSION(_snd_timer_query_hw_open, SND_TIMER_QUERY_DLSYM_VERSION);
|
||||
int _snd_timer_query_hw_open(snd_timer_query_t **timer, char *name,
|
||||
snd_config_t *root ATTRIBUTE_UNUSED,
|
||||
snd_config_t *conf, int mode)
|
||||
|
|
@ -106,3 +110,4 @@ int _snd_timer_query_hw_open(snd_timer_query_t **timer, char *name,
|
|||
}
|
||||
return snd_timer_query_hw_open(timer, name, mode);
|
||||
}
|
||||
SND_DLSYM_BUILD_VERSION(_snd_timer_query_hw_open, SND_TIMER_QUERY_DLSYM_VERSION);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue