1 | dnl Process this file with autoconf to produce a configure script. |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | |
2 | |
3 | AC_PREREQ(2.57) |
3 | AC_PREREQ(2.57) |
4 | AC_INIT(src/vped.C) |
4 | AC_INIT(src/vped.C) |
5 | AC_CANONICAL_TARGET |
5 | AC_CANONICAL_TARGET |
6 | AM_INIT_AUTOMAKE(vpe, 1.2) |
6 | AM_INIT_AUTOMAKE(vpe, 1.4) |
7 | AM_CONFIG_HEADER(config.h) |
7 | AM_CONFIG_HEADER(config.h) |
8 | AM_MAINTAINER_MODE |
8 | AM_MAINTAINER_MODE |
9 | |
9 | |
10 | AH_TOP([ |
10 | AH_TOP([ |
11 | #ifndef CONFIG_H__ |
11 | #ifndef CONFIG_H__ |
… | |
… | |
67 | [AC_HELP_STRING(--enable-iftype[=TYPE/SUBTYPE], [ |
67 | [AC_HELP_STRING(--enable-iftype[=TYPE/SUBTYPE], [ |
68 | Use kernel/net device interface TYPE/SUBTYPE. |
68 | Use kernel/net device interface TYPE/SUBTYPE. |
69 | Working combinations are: |
69 | Working combinations are: |
70 | "native/linux" |
70 | "native/linux" |
71 | "tincd/linux" |
71 | "tincd/linux" |
72 | "tincd/freebsd"; |
72 | "tincd/freebsd" |
|
|
73 | "tincd/openbsd" |
|
|
74 | "tincd/darwin" |
|
|
75 | "native/cygwin"; |
73 | Untested combinations are: |
76 | Untested combinations are: |
74 | "tincd/netbsd" |
77 | "tincd/netbsd" |
75 | "tincd/darwin" |
|
|
76 | "tincd/solaris" |
78 | "tincd/solaris" |
77 | "tincd/openbsd"; |
79 | "tincd/mingw"; |
78 | Broken combinations are: |
80 | Broken combinations are: |
79 | "tincd/cygwin"; |
81 | "tincd/cygwin"; |
80 | The default is to autodetect. |
82 | The default is to autodetect. |
81 | ])], |
83 | ])], |
82 | [ |
84 | [ |
… | |
… | |
119 | IFTYPE=tincd |
121 | IFTYPE=tincd |
120 | IFSUBTYPE=netbsd |
122 | IFSUBTYPE=netbsd |
121 | AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) |
123 | AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) |
122 | ;; |
124 | ;; |
123 | *cygwin*) |
125 | *cygwin*) |
124 | IFTYPE=tincd |
126 | IFTYPE=native |
125 | IFSUBTYPE=cygwin |
127 | IFSUBTYPE=cygwin |
126 | AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) |
128 | AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) |
127 | ;; |
129 | ;; |
128 | *) |
130 | *) |
129 | AC_MSG_ERROR("Unknown operating system.") |
131 | AC_MSG_ERROR("Unknown operating system.") |
… | |
… | |
131 | esac |
133 | esac |
132 | fi |
134 | fi |
133 | AC_MSG_RESULT($IFTYPE/$IFSUBTYPE) |
135 | AC_MSG_RESULT($IFTYPE/$IFSUBTYPE) |
134 | AC_SUBST(IFTYPE,$IFTYPE) |
136 | AC_SUBST(IFTYPE,$IFTYPE) |
135 | AC_SUBST(IFSUBTYPE,$IFSUBTYPE) |
137 | AC_SUBST(IFSUBTYPE,$IFSUBTYPE) |
|
|
138 | AC_DEFINE_UNQUOTED(IFTYPE,"$IFTYPE",[kernel interface type]) |
|
|
139 | AC_DEFINE_UNQUOTED(IFSUBTYPE,"$IFSUBTYPE",[kernel interface subtype]) |
136 | |
140 | |
137 | AC_CACHE_SAVE |
141 | AC_CACHE_SAVE |
138 | |
142 | |
139 | dnl Checks for libraries. |
143 | dnl Checks for libraries. |
140 | |
144 | |
… | |
… | |
142 | AC_CHECK_HEADERS(ext/hash_map) |
146 | AC_CHECK_HEADERS(ext/hash_map) |
143 | |
147 | |
144 | dnl Checks for header files. |
148 | dnl Checks for header files. |
145 | AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ |
149 | AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ |
146 | sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h arpa/inet.h \ |
150 | sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h arpa/inet.h \ |
147 | sys/poll.h sys/mman.h netinet/in.h]) |
151 | sys/mman.h netinet/in.h]) |
148 | AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], |
152 | AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], |
149 | [ |
153 | [ |
150 | #include <sys/types.h> |
154 | #include <sys/types.h> |
151 | #include <sys/socket.h> |
155 | #include <sys/socket.h> |
152 | #ifdef HAVE_NETINET_IN_H |
156 | #ifdef HAVE_NETINET_IN_H |
… | |
… | |
200 | AC_LANG_PUSH(C) |
204 | AC_LANG_PUSH(C) |
201 | |
205 | |
202 | AC_HEADER_STDC |
206 | AC_HEADER_STDC |
203 | |
207 | |
204 | dnl argl, could somebody catapult darwin into the 21st century??? |
208 | dnl argl, could somebody catapult darwin into the 21st century??? |
205 | AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall poll) |
209 | AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall) |
206 | |
210 | |
207 | AC_FUNC_ALLOCA |
211 | AC_FUNC_ALLOCA |
208 | |
212 | |
209 | dnl Support for SunOS |
213 | dnl Support for SunOS |
210 | |
214 | |
… | |
… | |
221 | |
225 | |
222 | AC_CACHE_SAVE |
226 | AC_CACHE_SAVE |
223 | |
227 | |
224 | dnl These are defined in files in m4/ |
228 | dnl These are defined in files in m4/ |
225 | tinc_TUNTAP |
229 | tinc_TUNTAP |
|
|
230 | |
226 | tinc_OPENSSL |
231 | tinc_OPENSSL |
|
|
232 | if test "x$openssl_include" != x; then |
227 | CXXFLAGS="$CXXFLAGS -I$openssl_include" |
233 | CXXFLAGS="$CXXFLAGS -I$openssl_include" |
|
|
234 | fi |
228 | dnl tinc_ZLIB |
235 | dnl tinc_ZLIB |
229 | |
236 | |
230 | AC_ARG_ENABLE(rohc, |
237 | AC_ARG_ENABLE(rohc, |
231 | [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])], |
238 | [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])], |
232 | [ |
239 | [ |
… | |
… | |
260 | AC_ARG_ENABLE(http-proxy, |
267 | AC_ARG_ENABLE(http-proxy, |
261 | [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support (default disabled).])], |
268 | [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support (default disabled).])], |
262 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
269 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
263 | ) |
270 | ) |
264 | |
271 | |
265 | HMAC=12 dnl see also the AC_HELP_STRING |
272 | HMAC=8 dnl see also the AC_HELP_STRING |
266 | AC_ARG_ENABLE(hmac-length, |
273 | AC_ARG_ENABLE(hmac-length, |
267 | [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])], |
274 | [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])], |
268 | HMAC=$enableval |
275 | HMAC=$enableval |
269 | ) |
276 | ) |
270 | AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) |
277 | AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) |
… | |
… | |
322 | |
329 | |
323 | if $CXX -v --help 2>&1 | grep -q fexceptions; then |
330 | if $CXX -v --help 2>&1 | grep -q fexceptions; then |
324 | CXXFLAGS="$CXXFLAGS -fno-exceptions" |
331 | CXXFLAGS="$CXXFLAGS -fno-exceptions" |
325 | fi |
332 | fi |
326 | |
333 | |
327 | if $CXX -v --help 2>&1 | grep -q ffunction-sections; then |
334 | dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then |
328 | CXXFLAGS="$CXXFLAGS -ffunction-sections" |
335 | dnl CXXFLAGS="$CXXFLAGS -ffunction-sections" |
329 | fi |
336 | dnl fi |
330 | |
337 | dnl |
331 | if $LD -v --help 2>&1 | grep -q gc-sections; then |
338 | dnl if $LD -v --help 2>&1 | grep -q gc-sections; then |
332 | LDFLAGS="$LDFLAGS -Wl,--gc-sections" |
339 | dnl LDFLAGS="$LDFLAGS -Wl,--gc-sections" |
333 | fi |
340 | dnl fi |
334 | |
341 | |
335 | AC_CONFIG_COMMANDS_POST([ |
342 | AC_CONFIG_COMMANDS_POST([ |
336 | |
343 | |
337 | echo |
344 | echo |
338 | echo "***" |
345 | echo "***" |