diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-25 14:15:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-25 14:15:56 +0000 |
commit | 88e8b66cd398b4cc166d2b50069d9ef9dd5f195e (patch) | |
tree | 8398f3a51374ee7d9573b5e3ee780cf12b0d4fe1 /configure.ac | |
parent | 1fe2032dbd294989ce839d2b8f9415b3b677b1d7 (diff) | |
download | gnunet-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.ac | 95 |
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 |
69 | DEFAULT_INTERFACE="\"eth0\"" | 69 | DEFAULT_INTERFACE="\"eth0\"" |
70 | 70 | ||
71 | funcstocheck="socket select inet_ntoa getnameinfo gethostname gethostbyname gethostbyaddr getaddrinfo" | ||
72 | |||
71 | # Check system type | 73 | # Check system type |
72 | case "$host_os" in | 74 | case "$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 | |||
686 | AC_HEADER_SYS_WAIT | 689 | AC_HEADER_SYS_WAIT |
687 | AC_TYPE_OFF_T | 690 | AC_TYPE_OFF_T |
688 | AC_TYPE_UID_T | 691 | AC_TYPE_UID_T |
689 | AC_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]) | 692 | AC_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 |
692 | LIBS=$SAVE_LIBS | 695 | LIBS=$SAVE_LIBS |
@@ -861,6 +864,96 @@ AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"]) | |||
861 | if test $build_target = "mingw" | 864 | if test $build_target = "mingw" |
862 | then | 865 | then |
863 | workarounds=1 | 866 | workarounds=1 |
867 | |||
868 | AC_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 | |||
879 | AC_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 | |||
890 | AC_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 | |||
902 | AC_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 | |||
913 | AC_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 | |||
924 | AC_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 | |||
935 | AC_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 | |||
946 | AC_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 | |||
864 | else | 957 | else |
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], |