aboutsummaryrefslogtreecommitdiffstats
path: root/community/vlc/0001-configure-test-for-getaddrinfo_a-and-libanl.patch
blob: 0a4c267a8a08f84f53903d6e4ecf05dad31e97c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 1165e150d5867c3bbcae559c0d09076000b8cf9d Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 20 Dec 2017 12:00:57 +0000
Subject: [PATCH] configure: test for getaddrinfo_a and libanl

Test for the existence of the GNU extension getaddrinf_a and libanl
instead of assuming that every Linux has it. Fall back to posix variant
if they are missing.

This fixes build with musl libc which does not implement this GNU
extension.

Fixes #19320

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 configure.ac    | 5 +++++
 src/Makefile.am | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index acbee6c0b1..d3d9e20105 100644
--- a/configure.ac
+++ b/configure.ac
@@ -330,6 +330,7 @@ AM_CONDITIONAL(HAVE_OSX,     test "${HAVE_OSX}" = "1")
 AM_CONDITIONAL(HAVE_TVOS,    test "${HAVE_TVOS}" = "1")
 
 AM_CONDITIONAL(HAVE_NACL,    test "${SYS}" = "nacl")
+AM_CONDITIONAL(HAVE_LIBANL,  test "${HAVE_LIBANL}" = "1")
 
 AM_CONDITIONAL(HAVE_WIN32,   test "${SYS}" = "mingw32")
 AM_CONDITIONAL(HAVE_WIN64,   test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
@@ -759,6 +760,10 @@ dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
 dnl check for its availability explicitely
 AC_CHECK_HEADERS([threads.h])
 
+AC_CHECK_LIB([anl],[getaddrinfo_a],[
+  AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
+])
+
 dnl Check for dynamic plugins
 LIBDL=""
 have_dynamic_objects="no"
diff --git a/src/Makefile.am b/src/Makefile.am
index 096dfc2a24..b77ddf4132 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -429,8 +429,11 @@ if HAVE_LINUX
 libvlccore_la_SOURCES += \
 	linux/cpu.c \
 	linux/dirs.c \
-	linux/getaddrinfo.c \
 	linux/thread.c
+endif
+if HAVE_LIBANL
+libvlccore_la_SOURCES += \
+	linux/getaddrinfo.c
 libvlccore_la_LIBADD += -lanl
 else
 libvlccore_la_SOURCES += \
-- 
2.15.0