configure.in: Update checks for required and optional features

Update checks for required and optional header files, data types,
and functions.
This commit is contained in:
Alexander Barton 2012-09-11 14:32:17 +02:00
parent 67e882d4bb
commit 47ad9afcf3
1 changed files with 23 additions and 19 deletions

View File

@ -107,25 +107,17 @@ AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
# Required header files
AC_CHECK_HEADERS([ \
ctype.h errno.h fcntl.h netdb.h netinet/in.h netinet/in_systm.h \
stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h \
fcntl.h inttypes.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h \
string.h strings.h sys/socket.h sys/time.h unistd.h \
],,AC_MSG_ERROR([required C header missing!]))
# Optional header files
AC_CHECK_HEADERS([ \
arpa/inet.h ctype.h malloc.h netinet/ip.h stdbool.h stddef.h varargs.h \
],[],[],[[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
]]
)
arpa/inet.h malloc.h netinet/ip.h stdbool.h stddef.h stdint.h \
varargs.h \
])
# -- Datatypes --
@ -142,8 +134,14 @@ AC_TRY_COMPILE([
AC_MSG_RESULT(no)
])
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),,
[#include <arpa/inet.h>])
@ -159,16 +157,22 @@ AC_CHECK_LIB(socket,bind)
# -- Functions --
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRFTIME
# Required functions
AC_CHECK_FUNCS([ \
bind gethostbyaddr gethostbyname gethostname inet_ntoa \
setsid setsockopt socket strcasecmp waitpid],,
alarm dup2 endpwent gethostbyaddr gethostbyname gethostname \
gettimeofday inet_ntoa memmove memset setsid socket strcasecmp \
strchr strcspn strerror strncasecmp strrchr strspn strstr \
],,
AC_MSG_ERROR([required function missing!]))
# Optional functions
AC_CHECK_FUNCS([ \
gai_strerror getaddrinfo getnameinfo inet_aton sigaction \
sigprocmask snprintf vsnprintf strdup strlcpy strlcat strtok_r])
gai_strerror getaddrinfo getnameinfo inet_aton sigaction sigprocmask \
snprintf vsnprintf strdup strlcpy strlcat strtok_r waitpid])
# -- Configuration options --