This repository has been archived by the owner on Jan 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
82 lines (58 loc) · 2.2 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright (C) 2011, Joel Klinghed
AC_INIT([upnpproxy], [0.3], [the_jk@yahoo.com])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([dist-bzip2 foreign color-tests parallel-tests])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_C_O
AC_HEADER_STDC
AC_C_CONST
AC_C_INLINE
AC_C___ATTRIBUTE__
DEFINES="-D_GNU_SOURCE -D_XOPEN_SOURCE"
AX_CFLAGS_WARN_ALL(DEFINES)
AX_CFLAGS_GCC_OPTION([-Wunsafe-loop-optimizations],DEFINES)
AC_ARG_ENABLE([debug], AC_HELP_STRING([compile with debug options]),
if test "x$enableval" = "xyes"; then
DEFINES="$DEFINES -g -DDEBUG"
fi,)
AC_SUBST(DEFINES)
# Types
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
# Headers
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([stdint.h inttypes.h])
# Functions
AC_CHECK_FUNCS([strndup strnlen getline getc_unlocked ungetc_unlocked])
AC_CHECK_FUNC([getopt],, AC_MSG_ERROR([need getopt]))
AC_CHECK_FUNCS([getopt_long])
# Network
AC_SEARCH_LIBS([socket], [socket],, AC_MSG_ERROR([Need socket]))
AC_SEARCH_LIBS([gethostbyname], [nsl],, AC_MSG_ERROR([Need gethostbyname]))
AC_SEARCH_LIBS([inet_ntoa], [resolv],, AC_MSG_ERROR([Need inet_ntoa]))
AC_CHECK_FUNCS([inet_ntoa inet_aton inet_ntop inet_pton inet_addr])
have_inet6=0
AC_CHECK_TYPE([struct sockaddr_in6], [have_inet6=1],, [[
#include <netinet/in.h>
]])
AC_DEFINE_UNQUOTED([HAVE_INET6], [$have_inet6], [define to 1 if struct sockaddr_in6 and the rest of IPv6 functions is available])
# uuid
have_uuid_generate=
have_uuid_create=
AC_CHECK_FUNC([uuid_create],have_uuid_create=1,have_uuid_create=0)
AC_SEARCH_LIBS([uuid_generate], [uuid],
have_uuid_generate=1, have_uuid_generate=0)
if test "x$have_uuid_generate" = "x1"; then
AC_CHECK_HEADER([uuid/uuid.h],,have_uuid_generate=0)
fi
if test "x$have_uuid_generate" != "x1" -a "x$have_uuid_create" != "x1"; then
AC_MSG_ERROR([Need some way of creating UUID:s])
fi
AC_DEFINE_UNQUOTED([HAVE_UUID_GENERATE], [$have_uuid_generate], [define to 1 if uuid_generate is available])
AC_DEFINE_UNQUOTED([HAVE_UUID_CREATE], [$have_uuid_create], [define to 1 if uuid_create is available])
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT([Makefile src/Makefile test/Makefile doc/Makefile])