Commit dd8f3a51 authored by Natanael Copa's avatar Natanael Copa Committed by Jean-Baptiste Kempf

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: default avatarNatanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 01fd9fe4)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 52be7faf
......@@ -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"
......
......@@ -430,8 +430,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 += \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment