aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-25 14:15:56 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-25 14:15:56 +0000
commit88e8b66cd398b4cc166d2b50069d9ef9dd5f195e (patch)
tree8398f3a51374ee7d9573b5e3ee780cf12b0d4fe1 /configure.ac
parent1fe2032dbd294989ce839d2b8f9415b3b677b1d7 (diff)
downloadgnunet-88e8b66cd398b4cc166d2b50069d9ef9dd5f195e.tar.gz
gnunet-88e8b66cd398b4cc166d2b50069d9ef9dd5f195e.zip
-LRN: special W32 function checks; It forgoes AC_CHECK_FUNCS for some functions in favour of manual
AC_LINK_IFELSE, which is necessary to check for API with stdcall interface (i.e. winsock).
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac95
1 files changed, 94 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e42c6bcaf..0af7f5935 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,8 @@ fi
68# Use Linux interface name unless the OS has a different preference 68# Use Linux interface name unless the OS has a different preference
69DEFAULT_INTERFACE="\"eth0\"" 69DEFAULT_INTERFACE="\"eth0\""
70 70
71funcstocheck="socket select inet_ntoa getnameinfo gethostname gethostbyname gethostbyaddr getaddrinfo"
72
71# Check system type 73# Check system type
72case "$host_os" in 74case "$host_os" in
73*darwin* | *rhapsody* | *macosx*) 75*darwin* | *rhapsody* | *macosx*)
@@ -158,6 +160,7 @@ netbsd*)
158 LIBPREFIX=lib 160 LIBPREFIX=lib
159 DLLDIR=bin 161 DLLDIR=bin
160 UNIXONLY="" 162 UNIXONLY=""
163 funcstocheck=""
161 ;; 164 ;;
162*) 165*)
163 AC_MSG_RESULT(Unrecognised OS $host_os) 166 AC_MSG_RESULT(Unrecognised OS $host_os)
@@ -686,7 +689,7 @@ AC_FUNC_VPRINTF
686AC_HEADER_SYS_WAIT 689AC_HEADER_SYS_WAIT
687AC_TYPE_OFF_T 690AC_TYPE_OFF_T
688AC_TYPE_UID_T 691AC_TYPE_UID_T
689AC_CHECK_FUNCS([floor gethostname memmove rmdir strncasecmp strrchr strtol atoll dup2 fdatasync ftruncate gettimeofday memset mkdir mkfifo select socket strcasecmp strchr strdup strerror strstr clock_gettime getrusage rand uname setlocale getcwd mktime gmtime_r gmtime strlcpy strlcat ftruncate stat64 sbrk mmap mremap setrlimit sysconf gethostbyaddr initgroups getifaddrs freeifaddrs getnameinfo getaddrinfo inet_ntoa localtime_r nl_langinfo putenv realpath strndup gethostbyname2 gethostbyname getpeerucred getpeereid setresuid]) 692AC_CHECK_FUNCS([floor memmove rmdir strncasecmp strrchr strtol atoll dup2 fdatasync ftruncate gettimeofday memset mkdir mkfifo strcasecmp strchr strdup strerror strstr clock_gettime getrusage rand uname setlocale getcwd mktime gmtime_r gmtime strlcpy strlcat ftruncate stat64 sbrk mmap mremap setrlimit sysconf initgroups getifaddrs freeifaddrs localtime_r nl_langinfo putenv realpath strndup gethostbyname2 gethostbyname getpeerucred getpeereid setresuid $funcstocheck])
690 693
691# restore LIBS 694# restore LIBS
692LIBS=$SAVE_LIBS 695LIBS=$SAVE_LIBS
@@ -861,6 +864,96 @@ AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
861if test $build_target = "mingw" 864if test $build_target = "mingw"
862then 865then
863 workarounds=1 866 workarounds=1
867
868AC_LINK_IFELSE(
869 [AC_LANG_PROGRAM(
870 [#include <ws2tcpip.h>
871 ],[
872 int s = socket (0, 0, 0);])
873 ],[
874 AC_DEFINE_UNQUOTED([HAVE_SOCKET],1,[Define this if socket() is available])
875 ],[
876 AC_DEFINE_UNQUOTED([HAVE_SOCKET],0,[Define this if socket() is available])
877 ])
878
879AC_LINK_IFELSE(
880 [AC_LANG_PROGRAM(
881 [#include <ws2tcpip.h>
882 ],[
883 int s = select (0, NULL, NULL, NULL, NULL);])
884 ],[
885 AC_DEFINE_UNQUOTED([HAVE_SELECT],1,[Define this if select() is available])
886 ],[
887 AC_DEFINE_UNQUOTED([HAVE_SELECT],0,[Define this if select() is available])
888 ])
889
890AC_LINK_IFELSE(
891 [AC_LANG_PROGRAM(
892 [#include <ws2tcpip.h>
893 ],[
894 struct in_addr i;
895 char *s = inet_ntoa (i);])
896 ],[
897 AC_DEFINE_UNQUOTED([HAVE_INET_NTOA],1,[Define this if inet_ntoa() is available])
898 ],[
899 AC_DEFINE_UNQUOTED([HAVE_INET_NTOA],0,[Define this if inet_ntoa() is available])
900 ])
901
902AC_LINK_IFELSE(
903 [AC_LANG_PROGRAM(
904 [#include <ws2tcpip.h>
905 ],[
906 int s = getnameinfo (NULL, 0, NULL, 0, NULL, 0, 0);])
907 ],[
908 AC_DEFINE_UNQUOTED([HAVE_GETNAMEINFO],1,[Define this if getnameinfo() is available])
909 ],[
910 AC_DEFINE_UNQUOTED([HAVE_GETNAMEINFO],0,[Define this if getnameinfo() is available])
911 ])
912
913AC_LINK_IFELSE(
914 [AC_LANG_PROGRAM(
915 [#include <ws2tcpip.h>
916 ],[
917 int s = gethostname (NULL, 0);])
918 ],[
919 AC_DEFINE_UNQUOTED([HAVE_GETHOSTNAME],1,[Define this if gethostname() is available])
920 ],[
921 AC_DEFINE_UNQUOTED([HAVE_GETHOSTNAME],0,[Define this if gethostname() is available])
922 ])
923
924AC_LINK_IFELSE(
925 [AC_LANG_PROGRAM(
926 [#include <ws2tcpip.h>
927 ],[
928 void *s = gethostbyname (NULL);])
929 ],[
930 AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME],1,[Define this if gethostbyname() is available])
931 ],[
932 AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME],0,[Define this if gethostbyname() is available])
933 ])
934
935AC_LINK_IFELSE(
936 [AC_LANG_PROGRAM(
937 [#include <ws2tcpip.h>
938 ],[
939 void *s = gethostbyaddr (NULL, 0, 0);])
940 ],[
941 AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYADDR],1,[Define this if gethostbyaddr() is available])
942 ],[
943 AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYADDR],0,[Define this if gethostbyaddr() is available])
944 ])
945
946AC_LINK_IFELSE(
947 [AC_LANG_PROGRAM(
948 [#include <ws2tcpip.h>
949 ],[
950 int s = getaddrinfo (NULL, NULL, NULL, NULL);])
951 ],[
952 AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO],1,[Define this if getaddrinfo() is available])
953 ],[
954 AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO],1,[Define this if getaddrinfo() is available])
955 ])
956
864else 957else
865 AC_MSG_CHECKING(whether to enable windows workarounds) 958 AC_MSG_CHECKING(whether to enable windows workarounds)
866 AC_ARG_ENABLE([windows_workarounds], 959 AC_ARG_ENABLE([windows_workarounds],