Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 705 lines (641 sloc) 20.907 kB
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
1 dnl Fwknop AutoConf script...
2 dnl =========================
3 dnl
4 dnl Created by Damien Stuart
5 dnl
6 dnl Inspiration from RRDtool configure.ac, the AutoConf Archive
7 dnl (http://www.nongnu.org/autoconf-archive/), and other examples.
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
8
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
9 dnl Minimum Autoconf version required.
bbe8c9d Set pcap non-block mode back on unless it is a freebsd system. Server…
Damien Stuart authored
10 AC_PREREQ(2.62)
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
11
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
12 dnl Define our name, version and email.
13 m4_define(my_package, [fwknop])
17beb2d @mrash bumped version to 2.0.0rc4
authored
14 m4_define(my_version, [2.0.0rc4])
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
15 m4_define(my_bug_email, [dstuart@dstuart.org])
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
16
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
17 AC_INIT(my_package, my_version, my_bug_email)
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
18
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
19 AC_CONFIG_AUX_DIR(config)
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
20
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
21 AC_CANONICAL_TARGET
22
2bf25e6 Added perl/legacy distribution (fwknop-1.9.12). Renamed this distrib…
Damien Stuart authored
23 AM_INIT_AUTOMAKE([tar-ustar -Wall -Werror foreign])
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
24
bcdef19 Commented out AM_MAINTAINER_MODE.
Damien Stuart authored
25 dnl AM_MAINTAINER_MODE
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
26
bbe8c9d Set pcap non-block mode back on unless it is a freebsd system. Server…
Damien Stuart authored
27 AC_CONFIG_HEADERS([config.h])
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
28
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
29 dnl The top of our header
30 dnl
31 AH_TOP([
32 #ifndef FWKNOP_CONFIG_H
33 #define FWKNOP_CONFIG_H
34 ])
35
36 dnl The bottom of our header file
37 dnl
38 AH_BOTTOM([
39 #endif /* FWKNOP_CONFIG_H */
40 ])
41
42 dnl Decide whether or not to build the client
43 dnl
44 want_client=yes
45 AC_ARG_ENABLE([client],
46 [AS_HELP_STRING([--disable-client],
47 [Do not build the fwknop client @<:@default is to build@:>@])],
48 [want_client=$enableval],
49 [])
50 AM_CONDITIONAL([WANT_CLIENT], [test "$want_client" = yes])
51
52 dnl Decide whether or not to build the server
53 dnl
54 want_server=yes
55 AC_ARG_ENABLE([server],
56 [AS_HELP_STRING([--disable-server],
57 [Do not build the fwknop server @<:@default is to build@:>@])],
58 [want_server=$enableval],
59 [])
60 AM_CONDITIONAL([WANT_SERVER], [test "$want_server" = yes])
61
39e7412 Added a no-digest-cache configure option and capability (though it is…
Damien Stuart authored
62 dnl Decide whether or not to enable the digest-cache
63 dnl
64 want_digest_cache=yes
65 AC_ARG_ENABLE([digest-cache],
66 [AS_HELP_STRING([--disable-digest-cache],
67 [Do not enable the fwknopd digest-cache @<:@default is to build@:>@])],
68 [want_digest_cache=$enableval],
69 [])
70 dnl AM_CONDITIONAL([WANT_DIGEST_CACHE], [test "$want_digest_cache" = yes])
71
0525cd4 @mrash Added autoconf support for non-dbm file cache.
authored
72 dnl Decide whether or not to try to look for gdbm/ndbm (default to just
73 dnl use a file-based solution - reduces dependencies)
74 dnl
75 want_file_cache=yes
76 AC_ARG_ENABLE([file-cache],
77 [AS_HELP_STRING([--disable-file-cache],
78 [Replace file cache with gdbm/ndbm @<:@default on@:>@])],
79 [want_file_cache=$enableval],
80 [])
81 AS_IF([test "$want_file_cache" = yes], [
82 AC_DEFINE([USE_FILE_CACHE], [1], [Define this to enable non-gdbm/ndbm digest storing (eliminates gdbm/ndbm dependency).])
83 ])
84
637f7a4 @mrash Added -Wall for all gcc warnings during compile
authored
85 dnl Decide whether or not to enable all warnings with -Wall
86 dnl
87 use_wall=yes
88 AC_ARG_ENABLE([wall],
89 [AS_HELP_STRING([--disable-wall],
90 [Do not enable all warnings via -Wall @<:@default is on@:>@])],
91 [use_wall=$enableval],
92 [])
93
94
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
95 dnl Decide whether or not to enable -fstack-protector
96 dnl
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
97 use_stack_protector=yes
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
98 AC_ARG_ENABLE([stack-protector],
99 [AS_HELP_STRING([--disable-stack-protector],
100 [Do not enable -fstack-protector @<:@default is on@:>@])],
101 [use_stack_protector=$enableval],
102 [])
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
103
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
104 dnl Decide whether or not to enable Position Independent Executable (PIE)
105 dnl support
106 dnl
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
107 use_pie=yes
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
108 AC_ARG_ENABLE([pie],
109 [AS_HELP_STRING([--disable-pie],
110 [Do not enable Position Independent Executable support @<:@default is on@:>@])],
111 [use_pie=$enableval],
112 [])
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
113
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
114 dnl Decide whether or not to enable -D_FORTIFY_SOURCE support
115 dnl
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
116 use_fortify_source=yes
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
117 AC_ARG_ENABLE([fortify-source],
118 [AS_HELP_STRING([--disable-fortify-source],
119 [Do not enable -D_FORTIFY_SOURCE support @<:@default is on@:>@])],
120 [use_fortify_source=$enableval],
121 [])
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
122
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
123 dnl Decide whether or not to use read-only relocations protection
124 dnl
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
125 use_ro_relocations=yes
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
126 AC_ARG_ENABLE([ro-relocations],
127 [AS_HELP_STRING([--disable-ro-relocations],
128 [Do not enable read-only relocations protection @<:@default is on@:>@])],
129 [use_ro_relocations=$enableval],
130 [])
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
131
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
132 dnl Decide whether or not to use immediate binding protection
133 dnl
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
134 use_immediate_binding=yes
bf59c26 @mrash Bug fix for ./configure args to disable compile time security options
authored
135 AC_ARG_ENABLE([immediate-binding],
136 [AS_HELP_STRING([--disable-immediate-binding],
137 [Do not enable immediate binding protection @<:@default is on@:>@])],
138 [use_immediate_binding=$enableval],
139 [])
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
140
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
141 AC_GNU_SOURCE
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
142
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
143 AC_PROG_CC
144 AM_PROG_CC_C_O
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
145 AC_PROG_CPP
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
146 AC_PROG_AWK
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
147 AC_PROG_SED
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
148 AC_PROG_GREP
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
149 AC_PROG_INSTALL
150 AC_PROG_LN_S
151 AC_PROG_MAKE_SET
474a787 more checks for configure. omit salt from Rijndael-encrypted data as…
Damien Stuart authored
152 AC_PROG_RANLIB
e113cb7 Updates to allow for building libfko as a shared lib. (make use of li…
Damien Stuart authored
153 AC_PROG_LIBTOOL
154
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
155 case "$host" in
156 *-*-linux*)
157 ;;
158 *-*-freebsd*)
6eeb413 @mrash Fixed a few minor compiler warnings on FreeBSD
authored
159 # disable read-only relocations and immediate binding protection on FreeBSD
649b7a8 @mrash Disabled read-only relocations and immediate binding compiler protect…
authored
160 # due the following errors (there is probably a solution to this in another
0649ef9 @mrash PF support on OpenBSD in progress, fwknop --fw-list now works
authored
161 # way, please email Michael Rash mbr.at.cipherdyne.org)
649b7a8 @mrash Disabled read-only relocations and immediate binding compiler protect…
authored
162 # gcc: -z: linker input file unused because linking not done
163 # gcc: relro: linker input file unused because linking not done
164 # gcc: -z: linker input file unused because linking not done
165 # gcc: now: linker input file unused because linking not done
166 use_ro_relocations=no
167 use_immediate_binding=no
168 ;;
169 *-*-openbsd*)
170 # disable read-only relocations and immediate binding protection on FreeBSD
4248b26 @mrash On FreeBSD disable read-only relocations and immediate binding protec…
authored
171 # due the following errors (there is probably a solution to this in another
0649ef9 @mrash PF support on OpenBSD in progress, fwknop --fw-list now works
authored
172 # way, please email Michael Rash mbr.at.cipherdyne.org)
4248b26 @mrash On FreeBSD disable read-only relocations and immediate binding protec…
authored
173 # gcc: -z: linker input file unused because linking not done
174 # gcc: relro: linker input file unused because linking not done
175 # gcc: -z: linker input file unused because linking not done
176 # gcc: now: linker input file unused because linking not done
177 use_ro_relocations=no
178 use_immediate_binding=no
0649ef9 @mrash PF support on OpenBSD in progress, fwknop --fw-list now works
authored
179 AC_DEFINE_UNQUOTED([PLATFORM_OPENBSD], [1], [Define if you are running on OpenBSD])
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
180 ;;
181 esac
6126b7b Updates to accomodate building and compiling on FreeBSD systems.
Damien Stuart authored
182
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
183 # Checks for header files.
184 #
185 AC_HEADER_STDC
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
186 AC_HEADER_TIME
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
187 AC_HEADER_RESOLV
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
188
6126b7b Updates to accomodate building and compiling on FreeBSD systems.
Damien Stuart authored
189 AC_CHECK_HEADERS([arpa/inet.h ctype.h endian.h errno.h locale.h netdb.h net/ethernet.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/byteorder.h sys/endian.h sys/ethernet.h sys/socket.h sys/stat.h sys/time.h sys/wait.h termios.h time.h unistd.h])
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
190
191 # Type checks.
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
192 #
2a51204 Removing files that are auto-generated by the autogen.sh script.
Damien Stuart authored
193 AC_C_CONST
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
194 AC_TYPE_INT8_T
195 AC_TYPE_INT16_T
196 AC_TYPE_INT32_T
197 AC_TYPE_INT64_T
198 AC_TYPE_UINT8_T
199 AC_TYPE_UINT16_T
200 AC_TYPE_UINT32_T
201 AC_TYPE_UINT64_T
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
202 AC_TYPE_OFF_T
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
203 AC_TYPE_PID_T
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
204 AC_TYPE_SIZE_T
e3bd3b7 Added additional sanity checks and clean-up of access.conf processing…
Damien Stuart authored
205 AC_TYPE_SSIZE_T
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
206
2a51204 Removing files that are auto-generated by the autogen.sh script.
Damien Stuart authored
207 AC_CHECK_SIZEOF(unsigned int)
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
208 dnl AC_CHECK_TYPES([uint8_t, uint32_t])
7f0e7a9 Updated autoconf files and code to support Solaris (ver 10 x86 at lea…
Damien Stuart authored
209
210 AC_C_BIGENDIAN
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
211
153d1ec Added AC_SYS_LARGE_FILE to configure.ac
Damien Stuart authored
212 AC_SYS_LARGEFILE
213
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
214 # Checks for library functions.
215 #
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
216 AC_FUNC_MALLOC
474a787 more checks for configure. omit salt from Rijndael-encrypted data as…
Damien Stuart authored
217 AC_FUNC_REALLOC
be3bb07 Added getpasswd routine for getting a password from the user. A few …
Damien Stuart authored
218 AC_FUNC_STAT
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
219
be3bb07 Added getpasswd routine for getting a password from the user. A few …
Damien Stuart authored
220 AC_CHECK_FUNCS([bzero gettimeofday memmove memset socket strchr strcspn strdup strncasecmp strndup strrchr strspn])
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
221
7f0e7a9 Updated autoconf files and code to support Solaris (ver 10 x86 at lea…
Damien Stuart authored
222 AC_SEARCH_LIBS([socket], [socket])
223 AC_SEARCH_LIBS([inet_addr], [nsl])
224
637f7a4 @mrash Added -Wall for all gcc warnings during compile
authored
225 # Add -Wall
226 #
227 if test "x$use_wall" = "xyes"; then
228 for t in -Wall; do
229 AC_MSG_CHECKING(if $CC supports $t)
230 saved_CFLAGS="$CFLAGS"
231 saved_LDFLAGS="$LDFLAGS"
232 CFLAGS="$CFLAGS $t -Werror"
233 LDFLAGS="$LDFLAGS $t -Werror"
234 AC_LINK_IFELSE(
235 [AC_LANG_SOURCE([
236 #include <stdio.h>
237 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
238 ])],
239 [ AC_MSG_RESULT(yes)
240 CFLAGS="$saved_CFLAGS $t"
241 LDFLAGS="$saved_LDFLAGS $t"
242 AC_MSG_CHECKING(if $t works)
243 AC_RUN_IFELSE(
244 [AC_LANG_SOURCE([
245 #include <stdio.h>
246 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
247 ])],
248 [ AC_MSG_RESULT(yes)
249 break ],
250 [ AC_MSG_RESULT(no) ],
251 [ AC_MSG_WARN([cross compiling: cannot test])
252 break ]
253 )
254 ],
255 [ AC_MSG_RESULT(no) ]
256 )
257 CFLAGS="$saved_CFLAGS"
258 LDFLAGS="$saved_LDFLAGS"
259 done
260 fi
261
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
262 # Check for security features offered by the compiler
263 #
264
637f7a4 @mrash Added -Wall for all gcc warnings during compile
authored
265 # Adapted from OpenSSH:
df96e42 @mrash Added stack protection, PIE, fortify source, etc.
authored
266 # -fstack-protector-all doesn't always work for some GCC versions
267 # and/or platforms, so we test if we can. If it's not supported
268 # on a given platform gcc will emit a warning so we use -Werror.
269 if test "x$use_stack_protector" = "xyes"; then
270 for t in -fstack-protector-all -fstack-protector; do
271 AC_MSG_CHECKING(if $CC supports $t)
272 saved_CFLAGS="$CFLAGS"
273 saved_LDFLAGS="$LDFLAGS"
274 CFLAGS="$CFLAGS $t -Werror"
275 LDFLAGS="$LDFLAGS $t -Werror"
276 AC_LINK_IFELSE(
277 [AC_LANG_SOURCE([
278 #include <stdio.h>
279 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
280 ])],
281 [ AC_MSG_RESULT(yes)
282 CFLAGS="$saved_CFLAGS $t"
283 LDFLAGS="$saved_LDFLAGS $t"
284 AC_MSG_CHECKING(if $t works)
285 AC_RUN_IFELSE(
286 [AC_LANG_SOURCE([
287 #include <stdio.h>
288 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
289 ])],
290 [ AC_MSG_RESULT(yes)
291 break ],
292 [ AC_MSG_RESULT(no) ],
293 [ AC_MSG_WARN([cross compiling: cannot test])
294 break ]
295 )
296 ],
297 [ AC_MSG_RESULT(no) ]
298 )
299 CFLAGS="$saved_CFLAGS"
300 LDFLAGS="$saved_LDFLAGS"
301 done
302 fi
303
304 if test "x$use_pie" = "xyes"; then
305 for t in "-fPIE -pie"; do
306 AC_MSG_CHECKING(if $CC supports $t)
307 saved_CFLAGS="$CFLAGS"
308 saved_LDFLAGS="$LDFLAGS"
309 CFLAGS="$CFLAGS $t -Werror"
310 LDFLAGS="$LDFLAGS $t -Werror"
311 AC_LINK_IFELSE(
312 [AC_LANG_SOURCE([
313 #include <stdio.h>
314 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
315 ])],
316 [ AC_MSG_RESULT(yes)
317 CFLAGS="$saved_CFLAGS $t"
318 LDFLAGS="$saved_LDFLAGS $t"
319 AC_MSG_CHECKING(if $t works)
320 AC_RUN_IFELSE(
321 [AC_LANG_SOURCE([
322 #include <stdio.h>
323 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
324 ])],
325 [ AC_MSG_RESULT(yes)
326 break ],
327 [ AC_MSG_RESULT(no) ],
328 [ AC_MSG_WARN([cross compiling: cannot test])
329 break ]
330 )
331 ],
332 [ AC_MSG_RESULT(no) ]
333 )
334 CFLAGS="$saved_CFLAGS"
335 LDFLAGS="$saved_LDFLAGS"
336 done
337 fi
338
339 if test "x$use_fortify_source" = "xyes"; then
340 for t in "-D_FORTIFY_SOURCE=2"; do
341 AC_MSG_CHECKING(if $CC supports $t)
342 saved_CFLAGS="$CFLAGS"
343 saved_LDFLAGS="$LDFLAGS"
344 CFLAGS="$CFLAGS $t -Werror"
345 LDFLAGS="$LDFLAGS $t -Werror"
346 AC_LINK_IFELSE(
347 [AC_LANG_SOURCE([
348 #include <stdio.h>
349 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
350 ])],
351 [ AC_MSG_RESULT(yes)
352 CFLAGS="$saved_CFLAGS $t"
353 LDFLAGS="$saved_LDFLAGS $t"
354 AC_MSG_CHECKING(if $t works)
355 AC_RUN_IFELSE(
356 [AC_LANG_SOURCE([
357 #include <stdio.h>
358 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
359 ])],
360 [ AC_MSG_RESULT(yes)
361 break ],
362 [ AC_MSG_RESULT(no) ],
363 [ AC_MSG_WARN([cross compiling: cannot test])
364 break ]
365 )
366 ],
367 [ AC_MSG_RESULT(no) ]
368 )
369 CFLAGS="$saved_CFLAGS"
370 LDFLAGS="$saved_LDFLAGS"
371 done
372 fi
373
374 if test "x$use_ro_relocations" = "xyes"; then
375 for t in "-Wl,-z,relro"; do
376 AC_MSG_CHECKING(if $CC supports $t)
377 saved_CFLAGS="$CFLAGS"
378 saved_LDFLAGS="$LDFLAGS"
379 CFLAGS="$CFLAGS $t -Werror"
380 LDFLAGS="$LDFLAGS $t -Werror"
381 AC_LINK_IFELSE(
382 [AC_LANG_SOURCE([
383 #include <stdio.h>
384 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
385 ])],
386 [ AC_MSG_RESULT(yes)
387 CFLAGS="$saved_CFLAGS $t"
388 LDFLAGS="$saved_LDFLAGS $t"
389 AC_MSG_CHECKING(if $t works)
390 AC_RUN_IFELSE(
391 [AC_LANG_SOURCE([
392 #include <stdio.h>
393 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
394 ])],
395 [ AC_MSG_RESULT(yes)
396 break ],
397 [ AC_MSG_RESULT(no) ],
398 [ AC_MSG_WARN([cross compiling: cannot test])
399 break ]
400 )
401 ],
402 [ AC_MSG_RESULT(no) ]
403 )
404 CFLAGS="$saved_CFLAGS"
405 LDFLAGS="$saved_LDFLAGS"
406 done
407 fi
408
409 if test "x$use_immediate_binding" = "xyes"; then
410 for t in "-Wl,-z,now"; do
411 AC_MSG_CHECKING(if $CC supports $t)
412 saved_CFLAGS="$CFLAGS"
413 saved_LDFLAGS="$LDFLAGS"
414 CFLAGS="$CFLAGS $t -Werror"
415 LDFLAGS="$LDFLAGS $t -Werror"
416 AC_LINK_IFELSE(
417 [AC_LANG_SOURCE([
418 #include <stdio.h>
419 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
420 ])],
421 [ AC_MSG_RESULT(yes)
422 CFLAGS="$saved_CFLAGS $t"
423 LDFLAGS="$saved_LDFLAGS $t"
424 AC_MSG_CHECKING(if $t works)
425 AC_RUN_IFELSE(
426 [AC_LANG_SOURCE([
427 #include <stdio.h>
428 int main(void){char x[[256]]; snprintf(x, sizeof(x), "NNN"); return 0;}
429 ])],
430 [ AC_MSG_RESULT(yes)
431 break ],
432 [ AC_MSG_RESULT(no) ],
433 [ AC_MSG_WARN([cross compiling: cannot test])
434 break ]
435 )
436 ],
437 [ AC_MSG_RESULT(no) ]
438 )
439 CFLAGS="$saved_CFLAGS"
440 LDFLAGS="$saved_LDFLAGS"
441 done
442 fi
443
d0373a5 Fixed libfko so gpgme engine is gpg by default. Added functions to l…
Damien Stuart authored
444 # Check for 3rd-party libs
445 #
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
446 AC_ARG_WITH([gpgme],
447 [AS_HELP_STRING([--with-gpgme],
448 [support for gpg encryption using libgpgme @<:@default=check@:>@])],
449 [],
450 [with_gpgme=check])
451
10b308b Fixed configure.ac again (I broke it with my last change). Added fir…
Damien Stuart authored
452 have_gpgme=yes
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
453 AS_IF([test "x$with_gpgme" != xno],
41127cd Added better autoconf handling of gpgpme. Fixes so libfko will compi…
Damien Stuart authored
454 [AM_PATH_GPGME([],
455 [AC_DEFINE([HAVE_LIBGPGME], [1], [Define if you have libgpgme])],
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
456 [if test "x$with_gpgme" != xcheck; then
457 AC_MSG_FAILURE(
458 [--with-gpgme was given, but test for gpgme failed])
10b308b Fixed configure.ac again (I broke it with my last change). Added fir…
Damien Stuart authored
459 else
460 have_gpgme=no
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
461 fi
41127cd Added better autoconf handling of gpgpme. Fixes so libfko will compi…
Damien Stuart authored
462 ], [have_gpgme=no])], [have_gpgme=no])
463
b6c57aa Changed the way running external commands are hanlded to address issu…
Damien Stuart authored
464 dnl Add various common way to sbin dir to the path (just in case)
465 APP_PATH=$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/local/sbin
466
467 dnl Check for gpg (not gpg2)
468 dnl
469 AC_ARG_WITH([gpg],
470 [AS_HELP_STRING([--with-gpg=/path/to/gpg],
471 [Specify path to the gpg executable that gpgme will use @<:@default=check path@:>@])],
472 [
473 AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ],
474 [AC_MSG_ERROR([--with-gpg requires an argument specifying a path to gpg])],
9413006 Cleaned out some old commented-out sections configure.ac and fixed an…
Damien Stuart authored
475 [ GPG_EXE=$withval ]
b6c57aa Changed the way running external commands are hanlded to address issu…
Damien Stuart authored
476 )
477 ],
478 [
479 AC_PATH_PROG(GPG_EXE, [gpg], [], [$APP_PATH])
480 ]
481 )
482 AS_IF([test "x$GPG_EXE" != x],
483 [
484 AC_DEFINE_UNQUOTED([GPG_EXE], ["$GPG_EXE"], [Path to gpg executable])
485 gpg_exe=$GPG_EXE
486 ], [ gpg_exe="(not found)"]
487 )
488
04afd28 @mrash On FreeBSD, made gpgme header path inclusion optional
authored
489 if [test "$have_gpgme" = "yes" ]; then
490 case "$host" in
491 *-*-linux*)
492 ;;
493 *-*-freebsd*)
494 if [ test "x$CPPFLAGS" = "x" ] ; then
495 CPPFLAGS="-I/usr/local/include -I/usr/local/include/gpgme"
496 fi
497 if [ test "x$LDFLAGS" = "x" ] ; then
498 LDFLAGS="-L/usr/local/lib"
499 fi
500 ;;
501 esac
502 fi
503
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
504 dnl Check for libpcap, gdbm (or ndbm) if we are building the server component
791eb40 Added check for libpcap. More stubbing in on the server code side.
Damien Stuart authored
505 dnl
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
506 AS_IF([test "$want_server" = yes], [
39e7412 Added a no-digest-cache configure option and capability (though it is…
Damien Stuart authored
507 # Looking for libpcap
508 #
509 AC_CHECK_LIB([pcap],[pcap_open_live],
510 [ AC_DEFINE([HAVE_LIBPCAP], [1], [Define if you have libpcap]) ],
511 [ AC_MSG_ERROR([fwknopd needs libpcap])]
512 )
513
514 AS_IF([test "$want_digest_cache" = yes], [
515 use_ndbm=no
516 have_digest_cache=yes
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
517
0525cd4 @mrash Added autoconf support for non-dbm file cache.
authored
518 AS_IF([test "$want_file_cache" = no], [
519
520 # Looking for gdbm or fallback to ndbm or bail
521 #
522 AC_CHECK_LIB([gdbm],[gdbm_open],
523 [
524 AC_DEFINE([HAVE_LIBGDBM], [1], [Define if you have libgdbm])
525 ],
526 [ AC_CHECK_LIB([ndbm],[dbm_open],
527 [
528 AC_DEFINE([HAVE_LIBNDBM], [1], [Define if you have libndbm])
529 use_ndbm=yes
530 ],
531 [ AC_CHECK_HEADER([ndbm.h],
532 [ AC_CHECK_FUNC([dbm_open],
533 [ AC_DEFINE([HAVE_LIBNDBM], [1], [Define if you have libndbm])],
534 [
535 AC_DEFINE([NO_DIGEST_CACHE], [1], [Define this to disable the digest cache for replay detection - not recommended.])
536 AC_MSG_WARN([No DBM implementation found. Replay detection will be disabled.])
537 have_digest_cache=no
538 ]
539 )]
540 )]
541 )]
542 )]
39e7412 Added a no-digest-cache configure option and capability (though it is…
Damien Stuart authored
543 )],
544 [
0525cd4 @mrash Added autoconf support for non-dbm file cache.
authored
545 AC_DEFINE([NO_DIGEST_CACHE], [1], [Define this to disable the digest cache for replay detection - not recommended.])
39e7412 Added a no-digest-cache configure option and capability (though it is…
Damien Stuart authored
546 have_digest_cache=no
547 ]
791eb40 Added check for libpcap. More stubbing in on the server code side.
Damien Stuart authored
548 )
549
9d2a4c2 Fixed autoconf config so libfko and fwknop client are not linked with…
Damien Stuart authored
550 AM_CONDITIONAL([USE_NDBM], [test x$use_ndbm = xyes])
0525cd4 @mrash Added autoconf support for non-dbm file cache.
authored
551 AM_CONDITIONAL([CONFIG_FILE_CACHE], [test x$want_file_cache = xyes])
9d2a4c2 Fixed autoconf config so libfko and fwknop client are not linked with…
Damien Stuart authored
552
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
553 dnl Check for iptables
554 dnl
555 AC_ARG_WITH([iptables],
556 [AS_HELP_STRING([--with-iptables=/path/to/iptables],
557 [Specify path to the iptables executable @<:@default=check path@:>@])],
558 [
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
559 AS_IF([ test "x$withval" = xno ], [],
560 AS_IF([ test "x$withval" = x -o "x$withval" = xyes ],
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
561 [AC_MSG_ERROR([--with-iptables requires an argument specifying a path to iptables])],
9413006 Cleaned out some old commented-out sections configure.ac and fixed an…
Damien Stuart authored
562 [ IPTABLES_EXE=$withval ]
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
563 )
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
564 )
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
565 ],
566 [
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
567 AC_PATH_PROG(IPTABLES_EXE, [iptables], [], [$APP_PATH])
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
568 ]
569 )
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
570
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
571 dnl Check for ipfw
572 dnl
573 AC_ARG_WITH([ipfw],
574 [AS_HELP_STRING([--with-ipfw=/path/to/ipfw],
575 [Specify path to the ipfw executable @<:@default=check path@:>@])],
576 [
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
577 AS_IF([ test "x$withval" = xno ], [],
578 AS_IF([ test "x$withval" = x -o "x$withval" = xyes ],
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
579 [AC_MSG_ERROR([--with-ipfw requires an argument specifying a path to ipfw])],
9413006 Cleaned out some old commented-out sections configure.ac and fixed an…
Damien Stuart authored
580 [ IPFW_EXE=$withval ]
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
581 )
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
582 )
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
583 ],
584 [
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
585 AC_PATH_PROG(IPFW_EXE, [ipfw], [], [$APP_PATH])
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
586 ]
587 )
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
588
dcf2d94 @mrash Added autoconf check for pf firewalls
authored
589 dnl Check for pf from OpenBSD
590 dnl
591 AC_ARG_WITH([pf],
592 [AS_HELP_STRING([--with-pf=/path/to/pfctl],
593 [Specify path to the pf executable @<:@default=check path@:>@])],
594 [
595 AS_IF([ test "x$withval" = xno ], [],
596 AS_IF([ test "x$withval" = x -o "x$withval" = xyes ],
597 [AC_MSG_ERROR([--with-pf requires an argument specifying a path to pf])],
598 [ PF_EXE=$withval ]
599 )
600 )
601 ],
602 [
603 AC_PATH_PROG(PF_EXE, [pfctl], [], [$APP_PATH])
604 ]
605 )
606
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
607 dnl Check for ipf (ipfilter)
608 dnl
609 AC_ARG_WITH([ipf],
610 [AS_HELP_STRING([--with-ipf=/path/to/ipf],
611 [Specify path to the ipf executable @<:@default=check path@:>@])],
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
612 [
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
613 AS_IF([ test "x$withval" = xno ], [],
614 AS_IF([ test "x$withval" = x -o "x$withval" = xyes ],
dcf2d94 @mrash Added autoconf check for pf firewalls
authored
615 [AC_MSG_ERROR([--with-ipf requires an argument specifying a path to ipf])],
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
616 [ IPF_EXE=$withval ]
617 )
618 )
619 ],
620 [
621 AC_PATH_PROG(IPF_EXE, [ipf], [], [$APP_PATH])
622 ]
623 )
7dc24c1 @mrash Bug fix for USE_NDBM variable so that client-only builds work. The s…
authored
624
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
625 dnl Determine which firewall exe we use (if we have one).
626 dnl If iptables was found or specified, it wins, then we fallback to ipfw,
dcf2d94 @mrash Added autoconf check for pf firewalls
authored
627 dnl then pf, and otherwise we try ipf.
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
628 dnl
629 AS_IF([test "x$IPTABLES_EXE" != x], [
630 FW_DEF="FW_IPTABLES"
631 FIREWALL_TYPE="iptables"
632 FIREWALL_EXE=$IPTABLES_EXE
633 AC_DEFINE_UNQUOTED([FIREWALL_IPTABLES], [1], [The firewall type: iptables.])
634 ],[
635 AS_IF([test "x$IPFW_EXE" != x], [
636 FW_DEF="FW_IPFW"
637 FIREWALL_TYPE="ipfw"
638 FIREWALL_EXE=$IPFW_EXE
639 AC_DEFINE_UNQUOTED([FIREWALL_IPFW], [1], [The firewall type: ipfw.])
dcf2d94 @mrash Added autoconf check for pf firewalls
authored
640 ],[
641 AS_IF([test "x$PF_EXE" != x], [
642 FW_DEF="FW_PF"
643 FIREWALL_TYPE="pf"
644 FIREWALL_EXE=$PF_EXE
645 AC_DEFINE_UNQUOTED([FIREWALL_PF], [1], [The firewall type: pf.])
646 ],[
647 AS_IF([test "x$IPF_EXE" != x], [
648 AC_MSG_ERROR([Sorry - ipf was specified or the only one found, however, it is not supported yet.])
649 FIREWALL_TYPE="ipf"
650 FIREWALL_EXE=$IPF_EXE
651 AC_DEFINE_UNQUOTED([FIREWALL_IPF], [1], [The firewall type: ipf.])
652 ], [AC_MSG_ERROR([No firewall program was found or specified.]) ]
653 ]
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
654 ]
655 ]
dcf2d94 @mrash Added autoconf check for pf firewalls
authored
656 ))))
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
657
658 AC_DEFINE_UNQUOTED([FIREWALL_EXE], ["$FIREWALL_EXE"],
659 [Path to firewall command executable (it should match the firewall type).])
660
661 ],
7dc24c1 @mrash Bug fix for USE_NDBM variable so that client-only builds work. The s…
authored
662 [test "$want_server" = no], [
663 use_ndbm=no
664 AM_CONDITIONAL([USE_NDBM], [test x$use_ndbm = xno])
0525cd4 @mrash Added autoconf support for non-dbm file cache.
authored
665 AM_CONDITIONAL([CONFIG_FILE_CACHE], [test x$use_ndbm = xno])
7dc24c1 @mrash Bug fix for USE_NDBM variable so that client-only builds work. The s…
authored
666 ]
667 )
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
668
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
669 AC_CONFIG_FILES([Makefile
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
670 lib/Makefile
671 client/Makefile
672 server/Makefile
673 common/Makefile
674 doc/Makefile])
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
675
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
676 AC_OUTPUT
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
677
39e7412 Added a no-digest-cache configure option and capability (though it is…
Damien Stuart authored
678 if [test "$have_gpgme" = "yes" ]; then
d0373a5 Fixed libfko so gpgme engine is gpg by default. Added functions to l…
Damien Stuart authored
679 have_gpgme="$have_gpgme
680 Gpgme engine: $GPG_EXE"
681 fi
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
682
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
683 echo "
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
684 $PACKAGE_NAME-$PACKAGE_VERSION configuration.
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
685 ==========================================================
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
686 Client build: $want_client
687 Server build: $want_server
688 GPG encryption support: $have_gpgme
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
689
690 Installation prefix: $prefix
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
691 "
39e7412 Added a no-digest-cache configure option and capability (though it is…
Damien Stuart authored
692 if [test "$want_server" = "yes" ]; then
838b80f Refactored firewall rule code to separate files by firewall type. St…
Damien Stuart authored
693 echo " Server support:
694 firewall type: $FIREWALL_TYPE
695 firewall program path: $FIREWALL_EXE
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
696 "
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
697
39e7412 Added a no-digest-cache configure option and capability (though it is…
Damien Stuart authored
698 if [test "$want_digest_cache" = "no" ]; then
699 echo " *WARNING*
700 The digest-cache functionality is not enabled. This
701 could leave the fwknopd server open to replay attacks!
702 "
703 fi
704 fi
Something went wrong with that request. Please try again.