1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-24 20:48:52 +02:00

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>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
This commit is contained in:
Natanael Copa 2017-12-20 12:21:02 +00:00 committed by Jean-Baptiste Kempf
parent 250e44ff9d
commit 01fd9fe4c7
2 changed files with 9 additions and 1 deletions

View File

@ -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"

View File

@ -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 += \