File: configure.ac

package info (click to toggle)
smcroute 2.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 636 kB
  • ctags: 221
  • sloc: ansic: 2,296; sh: 1,310; perl: 161; makefile: 61
file content (194 lines) | stat: -rw-r--r-- 4,431 bytes parent folder | download | duplicates (2)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(smcroute, 2.0.0, https://github.com/troglobit/smcroute/issues)
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
AM_SILENT_RULES()

AC_CONFIG_SRCDIR([mclab.h])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile])

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL

# The pidfile() code needs asprintf(), which relies on -D_GNU_SOURCE
AC_GNU_SOURCE

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
                  sys/ioctl.h sys/socket.h sys/types.h syslog.h unistd.h \
                  net/route.h sys/param.h ifaddrs.h], [], [],
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])

AC_CHECK_HEADERS([linux/mroute.h], [], [], 
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#define _LINUX_IN_H             /* For Linux <= 2.6.25 */
#include <linux/types.h>
])

AC_CHECK_HEADERS([linux/mroute6.h], [], [], 
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
])

AC_CHECK_HEADERS([linux/sockios.h])

AC_CHECK_HEADERS([netinet/ip_mroute.h], [], [],
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NET_ROUTE_H
#include <net/route.h>
#endif
])
AC_CHECK_HEADERS([netinet6/ip6_mroute.h], [], [],
[
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
])

AC_MSG_CHECKING(for IPv6 multicast host support)
AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM(
[[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
]],
[[
  struct ipv6_mreq mreq;
]])],
  [AC_DEFINE(HAVE_IPV6_MULTICAST_HOST, 1, [Define to 1 if your OS supports acting as an IPv6 multicast host])
   AC_MSG_RESULT(yes)],
  [AC_MSG_RESULT(no)]) 

AC_MSG_CHECKING(for IPv6 multicast routing support)
AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM(
[[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_LINUX_MROUTE6_H
#include <linux/mroute6.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_NETINET6_IP6_MROUTE_H
#include <netinet6/ip6_mroute.h>
#endif
]],
[[
  int dummy = MRT6_INIT;
]])],
  [AC_DEFINE(HAVE_IPV6_MULTICAST_ROUTING, 1, [Define to 1 if your OS supports IPv6 multicast routing])
   AC_MSG_RESULT(yes)],
  [AC_MSG_RESULT(no)]) 


# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_UINT32_T

AC_MSG_CHECKING(for sun_len member in struct sockaddr_un)
AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM(
[[
#include <sys/un.h>
]],
[[
  struct sockaddr_un dummy;
  dummy.sun_len = 0;
]])],
  [AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN, 1, [Define to 1 if the struct sockaddr_un has a member sun_len on your OS])
   AC_MSG_RESULT(yes)],
  [AC_MSG_RESULT(no)])

AC_MSG_CHECKING(for vifc_threshold member in struct mif6ctl)
AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM(
[[
#ifdef HAVE_LINUX_MROUTE6_H
#include <linux/mroute6.h>
#endif
#ifdef HAVE_NETINET6_IP6_MROUTE_H
#include <netinet6/ip6_mroute.h>
#endif
]],
[[
  struct mif6ctl dummy;
  dummy.vifc_threshold = 1;
]])],
  [AC_DEFINE(HAVE_MIF6CTL_VIFC_THRESHOLD, 1, [Define to 1 if the struct mif6ctl has a member vifc_threshold on your OS])
   AC_MSG_RESULT(yes)],
  [AC_MSG_RESULT(no)])

AC_MSG_CHECKING(for vifc_rate_limit member in struct mif6ctl)
AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM(
[[
#ifdef HAVE_LINUX_MROUTE6_H
#include <linux/mroute6.h>
#endif
#ifdef HAVE_NETINET6_IP6_MROUTE_H
#include <netinet6/ip6_mroute.h>
#endif
]],
[[
  struct mif6ctl dummy;
  dummy.vifc_rate_limit = 1;
]])],
  [AC_DEFINE(HAVE_MIF6CTL_VIFC_RATE_LIMIT, 1, [Define to 1 if the struct mif6ctl has a member vifc_rate_limit on your OS])
   AC_MSG_RESULT(yes)],
  [AC_MSG_RESULT(no)])

# Add build number to config.h.in
AC_DEFINE_UNQUOTED([BUILD], "`date +%y%m%d`", [Build number, abbreviated date.])

# Checks for library functions.
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_SETPGRP
AC_CHECK_FUNCS([atexit dup2 memset select socket strchr strerror strrchr asprintf])

AC_OUTPUT