]> git.sesse.net Git - vlc/commitdiff
Look for inet_ntop/inet_pton in ws2_32
authorRafaël Carré <funman@videolan.org>
Mon, 18 Mar 2013 16:49:19 +0000 (17:49 +0100)
committerRafaël Carré <funman@videolan.org>
Tue, 19 Mar 2013 11:52:39 +0000 (12:52 +0100)
configure.ac
modules/services_discovery/Modules.am

index 994705048ca5b4538d60e95052da95f98b763cef..b820683379eaa4b23e51b404a2e491c4d565cf62 100644 (file)
@@ -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
 
index b4f30503871c3a0852d8512ef223540eb6fb7f57..241eb684a17c6dac17d5bddadb370b48b650ab67 100644 (file)
@@ -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