[vlc-devel] [PATCH] Look for inet_ntop/inet_pton in ws2_32

Rafaël Carré funman at videolan.org
Mon Mar 18 17:49:41 CET 2013


---
 configure.ac                          |   12 +++++++++++-
 modules/services_discovery/Modules.am |    5 ++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 20daefe..317f8e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -514,7 +514,7 @@ need_libc=false
 dnl Check for usual libc functions
 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
 AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
-AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
+AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])
@@ -590,6 +590,16 @@ AC_SEARCH_LIBS([getaddrinfo], [nsl], [
   ])
 ],, [${SOCKET_LIBS}])
 
+LIBS="${LIBS} ${SOCKET_LIBS}"
+AC_LINK_IFELSE([
+    AC_LANG_PROGRAM([#ifdef WIN32
+        #include <ws2tcpip.h>
+        #else
+        #include <arpa/inet.h>
+        #endif], [
+        char dst[[sizeof(struct in_addr)]];
+        inet_pton(AF_INET, "127.0.0.1", dst);
+    ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
 VLC_RESTORE_FLAGS
 
diff --git a/modules/services_discovery/Modules.am b/modules/services_discovery/Modules.am
index b4f3050..241eb68 100644
--- a/modules/services_discovery/Modules.am
+++ b/modules/services_discovery/Modules.am
@@ -1,10 +1,13 @@
-SOURCES_sap = sap.c
 SOURCES_upnp = upnp.cpp upnp.hpp
 SOURCES_bonjour = bonjour.c
 SOURCES_podcast = podcast.c
 SOURCES_mtp = mtp.c
 SOURCES_mediadirs = mediadirs.c
 
+libsap_plugin_la_SOURCES = sap.c
+libsap_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_sap)
+libsap_plugin_la_LIBADD = $(AM_LIBADD) $(LIBS_sap) $(SOCKET_LIBS)
+
 libpulselist_plugin_la_SOURCES = \
 	../audio_output/vlcpulse.c ../audio_output/vlcpulse.h \
 	pulse.c
-- 
1.7.10.4



More information about the vlc-devel mailing list