alsa-lib cross build against uclibc
I couldn't build the CVS sources against uclibc - the compile would not work at all.
But I have now been successfully able to patch and build the files. The patch is attached.
Apologies if the format is a bit messed up.
include/alsa-symbols.h +4 -0
@@ -26,8 +26,12 @@#define USE_VERSIONED_SYMBOLS #endif +#ifdef USE_VERSIONED_SYMBOLS #define INTERNAL_CONCAT2_2 (Pre, Post) Pre##Post#define INTERNAL (Name) INTERNAL_CONCAT2_2(__, Name) +#else +#define INTERNAL (Name) Name +#endif #ifdef __powerpc64__# define symbol_version (real, name, version) \
src/userfile.c +25 -2
@@ -20,7 +20,11 @@#include <string.h> #include <errno.h> +#ifdef HAS_WORDEXP #include <wordexp.h> +#else +#include <glob.h> +#endif #include <assert.h> /**
@@ -34,9 +38,9 @@*/ int snd_user_file (const char *file,char **result) { -wordexp_t we;int err; - +#ifdef HAS_WORDEXP +wordexp_t we;assert (file && result); err =wordexp (file, &we,WRDE_NOCMD );switch (err) {
@@ -54,5 +58,24 @@if (*result ==NULL )return -ENOMEM ;wordfree (&we); +#else +glob_t globbuf; + err =glob (file,0 ,NULL , &globbuf); +switch (err) { +case GLOB_NOSPACE : +return -ENOMEM ; +case 0 : +if (globbuf.gl_pathc ==1 ) +break ; +/* Fall through */ +default : +globfree (&globbuf); +return -EINVAL ; + } + *result =strdup (globbuf.gl_pathv[0 ]); +if (*result ==NULL ) +return -ENOMEM ; +globfree (&globbuf); +#endif return 0 ; }
include/alsa-symbols.h +4 -0
@@ -26,8 +26,12 @@#define USE_VERSIONED_SYMBOLS #endif +#ifdef USE_VERSIONED_SYMBOLS #define INTERNAL_CONCAT2_2 (Pre, Post) Pre##Post#define INTERNAL (Name) INTERNAL_CONCAT2_2(__, Name) +#else +#define INTERNAL (Name) Name +#endif #ifdef __powerpc64__# define symbol_version (real, name, version) \
home/adrian/alsa-lib-1.0.10/src/userfile.c renamed from userfile.c +25 -2
@@ -20,7 +20,11 @@#include <string.h> #include <errno.h> +#ifdef HAS_WORDEXP #include <wordexp.h> +#else +#include <glob.h> +#endif #include <assert.h> /**
@@ -34,9 +38,9 @@*/ int snd_user_file (const char *file,char **result) { -wordexp_t we;int err; - +#ifdef HAS_WORDEXP +wordexp_t we;assert (file && result); err =wordexp (file, &we,WRDE_NOCMD );switch (err) {
@@ -54,5 +58,24 @@if (*result ==NULL )return -ENOMEM ;wordfree (&we); +#else +glob_t globbuf; + err =glob (file,0 ,NULL , &globbuf); +switch (err) { +case GLOB_NOSPACE : +return -ENOMEM ; +case 0 : +if (globbuf.gl_pathc ==1 ) +break ; +/* Fall through */ +default : +globfree (&globbuf); +return -EINVAL ; + } + *result =strdup (globbuf.gl_pathv[0 ]); +if (*result ==NULL ) +return -ENOMEM ; +globfree (&globbuf); +#endif return 0 ; }
src/conf.c +4 -0
@@ -415,7 +415,11 @@#include <stdarg.h> +#ifdef HAS_WORDEXP #include <wordexp.h> +#else +#include <glob.h> +#endif #include <dlfcn.h> #include <limits.h> #include <sys/stat.h>
src/alisp/alisp.c +4 -0
@@ -30,7 +30,11 @@#include <ctype.h> #include <math.h> #include <err.h> +#ifdef HAS_WORDEXP #include <wordexp.h> +#else +#include <glob.h> +#endif #define alisp_seq_iterator alisp_object
src/pcm/pcm_ladspa.c +25 -1
@@ -28,7 +28,11 @@#include <dirent.h> #include <dlfcn.h> +#ifdef HAS_WORDEXP #include <wordexp.h> +#else +#include <glob.h> +#endif #include <locale.h> #include "pcm_local.h" #include "pcm_plugin.h"
@@ -815,13 +819,18 @@ {const char *c;size_t l; -wordexp_t we; +#ifdef HAS_WORDEXP +wordexp_t we; +#else +glob_t globbuf; +#endif int err;for (c = path; (l =strcspn (c,": " )) >0 ; ) {char name[l +1 ];memcpy (name, c, l); name[l] =0 ; +#ifdef HAS_WORDEXP err =wordexp (name, &we,WRDE_NOCMD );switch (err) {case WRDE_NOSPACE :
@@ -835,6 +844,21 @@ } err =snd_pcm_ladspa_check_dir (plugin, we.we_wordv[0 ], label, ladspa_id);wordfree (&we); +#else + err =glob (name,0 ,NULL , &globbuf); +switch (err) { +case GLOB_NOSPACE : +return -ENOMEM ; +case 0 : +if (globbuf.gl_pathc ==1 ) +break ; +/* Fall through */ +default : +return -EINVAL ; + } + err =snd_pcm_ladspa_check_dir (plugin, globbuf.gl_pathv[0 ], label, ladspa_id); +globfree (&globbuf); +#endif if (err <0 )return err;if (err >0 )
src/names.c +4 -0
@@ -31,7 +31,11 @@*/ #include <stdarg.h> +#ifdef HAS_WORDEXP #include <wordexp.h> +#else +#include <glob.h> +#endif #include <dlfcn.h> #include <limits.h> #include <sys/stat.h>