From a87a386e3a5ef715fc65affe9dfa9eae09d13270 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 5 Jul 2019 04:42:52 -0700 Subject: alsa-lib: Detect whether TLS is available --- pkg/alsa-lib/config.h | 5 ++++- pkg/alsa-lib/gen.lua | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'pkg/alsa-lib') diff --git a/pkg/alsa-lib/config.h b/pkg/alsa-lib/config.h index 50b3568b..bf340d4d 100644 --- a/pkg/alsa-lib/config.h +++ b/pkg/alsa-lib/config.h @@ -40,7 +40,10 @@ #define HAVE_UNISTD_H 1 #define HAVE_USELOCALE 1 /* #undef HAVE_WORDEXP */ -#define HAVE___THREAD 1 +#ifdef HAVE__THREAD_LOCAL +# define HAVE___THREAD 1 +# define __thread _Thread_local +#endif #define LT_OBJDIR ".libs/" /* #undef NDEBUG */ #define PACKAGE "alsa-lib" diff --git a/pkg/alsa-lib/gen.lua b/pkg/alsa-lib/gen.lua index d8dd8a82..f5e375d5 100644 --- a/pkg/alsa-lib/gen.lua +++ b/pkg/alsa-lib/gen.lua @@ -1,9 +1,15 @@ cflags{ + '-I $outdir', '-I $dir', '-I $dir/alsa', '-I $srcdir/include', } +build('cat', '$outdir/config.h', { + '$builddir/probe/HAVE__THREAD_LOCAL', + '$dir/config.h', +}) + pkg.hdrs = { copy('$outdir/include/alsa', '$srcdir/include/alsa', { 'asoundef.h', @@ -30,6 +36,7 @@ pkg.hdrs = { }), copy('$outdir/include/alsa', '$dir/alsa', {'asoundlib.h', 'version.h'}), } +pkg.deps = {'$outdir/config.h'} cc('src/pcm/pcm.c') build('objcopy', '$outdir/src/pcm/pcm.nowarn.c.o', '$outdir/src/pcm/pcm.c.o', { -- cgit v1.2.3