[vlc-devel] IPv6 not detected on Solaris
Alexander Gall
gall at switch.ch
Wed Mar 1 11:05:18 CET 2006
Solaris requires -lnsl -lsocket where most other platforms require
-lresolv. The current checks for IPv6 don't work on Solaris. The
attached patch fixes this (I tried to figure out the proper calls to
VLC_ADD_LDFLAGS). The patch works at least on Solaris Express.
--
Alex
diff -Naur vlc-0.8.5-20060226.orig/configure.ac vlc-0.8.5-20060226/configure.ac
--- vlc-0.8.5-20060226.orig/configure.ac 2006-02-26 00:00:35.000000000 +0100
+++ vlc-0.8.5-20060226/configure.ac 2006-02-28 11:33:38.044743000 +0100
@@ -481,9 +481,23 @@
fi
dnl getaddrinfo, getnameinfo and gai_strerror check
-dnl -lresolv is NOT needed on Solaris
+dnl -lresolv is NOT needed on Solaris, but -lnsl -lsocket is
dnl we purposedly make the test fail on Windows
-AC_CHECK_FUNCS([getaddrinfo getnameinfo gai_strerror])
+case ${target_os} in
+ solaris*)
+ AC_CHECK_LIB(socket,getaddrinfo,[
+ LIBS_save=${LIBS}
+ LIBS="${LIBS} -lnsl -lsocket"
+ AC_CHECK_FUNCS([getaddrinfo getnameinfo gai_strerror],[
+ VLC_ADD_LDFLAGS([vlc],[-lnsl -lsocket])
+ ])
+ LIBS=${LIBS_save}
+ ])
+ ;;
+ *)
+ AC_CHECK_FUNCS([getaddrinfo getnameinfo gai_strerror])
+ ;;
+esac
AH_TEMPLATE(HAVE_ADDRINFO, [Define to `1' if <netdb.h> defines struct addrinfo.])
AC_CHECK_TYPES([struct addrinfo],[AC_DEFINE(HAVE_ADDRINFO)],,
[#include <sys/types.h>
@@ -2176,9 +2190,18 @@
dnl
have_ipv6=no
AC_CHECK_FUNCS(inet_pton,[have_ipv6=yes],[
- AC_CHECK_LIB(resolv,inet_pton,
- [have_ipv6=yes
- VLC_ADD_LDFLAGS([ipv6 vlc],[-lresolv])])
+ case "${target_os}" in
+ solaris*)
+ AC_CHECK_LIB(nsl,inet_pton,
+ [have_ipv6=yes
+ VLC_ADD_LDFLAGS([ipv6 vlc],[-lnsl -lsocket])])
+ ;;
+ *)
+ AC_CHECK_LIB(resolv,inet_pton,
+ [have_ipv6=yes
+ VLC_ADD_LDFLAGS([ipv6 vlc],[-lresolv])])
+ ;;
+ esac
])
AS_IF([test "${have_ipv6}" = "yes"], [
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
More information about the vlc-devel
mailing list