Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 365 lines (324 sloc) 10.228 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.
2a51204 Removing files that are auto-generated by the autogen.sh script.
Damien Stuart authored
10 AC_PREREQ(2.61)
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])
2a67766 Added fwknop.spec for rpm builds. Removed the server post install hoo…
Damien Stuart authored
14 m4_define(my_version, [2.0.0_beta_rc1])
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
27 AC_CONFIG_HEADER([config.h])
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
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
62 AC_GNU_SOURCE
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
63
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
64 AC_PROG_CC
65 AM_PROG_CC_C_O
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
66 AC_PROG_CPP
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
67 AC_PROG_AWK
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
68 AC_PROG_SED
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
69 AC_PROG_GREP
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
70 AC_PROG_INSTALL
71 AC_PROG_LN_S
72 AC_PROG_MAKE_SET
474a787 more checks for configure. omit salt from Rijndael-encrypted data as…
Damien Stuart authored
73 AC_PROG_RANLIB
e113cb7 Updates to allow for building libfko as a shared lib. (make use of li…
Damien Stuart authored
74 AC_PROG_LIBTOOL
75
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
76 # Checks for header files.
77 #
78 AC_HEADER_STDC
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
79 AC_HEADER_TIME
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
80 AC_HEADER_RESOLV
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
81
909ff4e Added check for and create of run dir and/or basename of digest_cache…
Damien Stuart authored
82 AC_CHECK_HEADERS([ctype.h endian.h errno.h locale.h netdb.h net/ethernet.h netinet/ether.h netinet/ip_icmp.h netinet/in.h netinet/ip.h netinet/tcp.h netinet/udp.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 termios.h unistd.h])
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
83
84 # Type checks.
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
85 #
2a51204 Removing files that are auto-generated by the autogen.sh script.
Damien Stuart authored
86 AC_C_CONST
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
87 AC_TYPE_INT8_T
88 AC_TYPE_INT16_T
89 AC_TYPE_INT32_T
90 AC_TYPE_INT64_T
91 AC_TYPE_UINT8_T
92 AC_TYPE_UINT16_T
93 AC_TYPE_UINT32_T
94 AC_TYPE_UINT64_T
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
95 AC_TYPE_OFF_T
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
96 AC_TYPE_PID_T
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
97 AC_TYPE_SIZE_T
e3bd3b7 Added additional sanity checks and clean-up of access.conf processing…
Damien Stuart authored
98 AC_TYPE_SSIZE_T
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
99
2a51204 Removing files that are auto-generated by the autogen.sh script.
Damien Stuart authored
100 AC_CHECK_SIZEOF(unsigned int)
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
101 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
102
103 AC_C_BIGENDIAN
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
104
105 # Checks for library functions.
106 #
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
107 AC_FUNC_MALLOC
474a787 more checks for configure. omit salt from Rijndael-encrypted data as…
Damien Stuart authored
108 AC_FUNC_REALLOC
be3bb07 Added getpasswd routine for getting a password from the user. A few …
Damien Stuart authored
109 AC_FUNC_STAT
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
110
be3bb07 Added getpasswd routine for getting a password from the user. A few …
Damien Stuart authored
111 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
112
7f0e7a9 Updated autoconf files and code to support Solaris (ver 10 x86 at lea…
Damien Stuart authored
113 AC_SEARCH_LIBS([socket], [socket])
114 AC_SEARCH_LIBS([inet_addr], [nsl])
115
d0373a5 Fixed libfko so gpgme engine is gpg by default. Added functions to l…
Damien Stuart authored
116 # Check for 3rd-party libs
117 #
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
118 AC_ARG_WITH([gpgme],
119 [AS_HELP_STRING([--with-gpgme],
120 [support for gpg encryption using libgpgme @<:@default=check@:>@])],
121 [],
122 [with_gpgme=check])
123
10b308b Fixed configure.ac again (I broke it with my last change). Added fir…
Damien Stuart authored
124 have_gpgme=yes
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
125 AS_IF([test "x$with_gpgme" != xno],
41127cd Added better autoconf handling of gpgpme. Fixes so libfko will compi…
Damien Stuart authored
126 [AM_PATH_GPGME([],
127 [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
128 [if test "x$with_gpgme" != xcheck; then
129 AC_MSG_FAILURE(
130 [--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
131 else
132 have_gpgme=no
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
133 fi
41127cd Added better autoconf handling of gpgpme. Fixes so libfko will compi…
Damien Stuart authored
134 ], [have_gpgme=no])], [have_gpgme=no])
135
b6c57aa Changed the way running external commands are hanlded to address issu…
Damien Stuart authored
136 dnl Add various common way to sbin dir to the path (just in case)
137 APP_PATH=$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/local/sbin
138
139 dnl Check for gpg (not gpg2)
140 dnl
141 AC_ARG_WITH([gpg],
142 [AS_HELP_STRING([--with-gpg=/path/to/gpg],
143 [Specify path to the gpg executable that gpgme will use @<:@default=check path@:>@])],
144 [
145 AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ],
146 [AC_MSG_ERROR([--with-gpg requires an argument specifying a path to gpg])],
147 [
148 AC_CHECK_FILE([$withval], [], [
149 AC_MSG_WARN([Specified path to gpg does not exist on this system])
150 gpg_exe_warn="*not found*"
151 ])
152 GPG_EXE=$withval
153 ]
154 )
155 ],
156 [
157 AC_PATH_PROG(GPG_EXE, [gpg], [], [$APP_PATH])
158 ]
159 )
160 AS_IF([test "x$GPG_EXE" != x],
161 [
162 AC_DEFINE_UNQUOTED([GPG_EXE], ["$GPG_EXE"], [Path to gpg executable])
163 gpg_exe=$GPG_EXE
164 ], [ gpg_exe="(not found)"]
165 )
166
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
167 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
168 dnl
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
169 AS_IF([test "$want_server" = yes], [
9d2a4c2 Fixed autoconf config so libfko and fwknop client are not linked with…
Damien Stuart authored
170 use_ndbm=no
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
171 # Looking for libpcap
172 #
9d2a4c2 Fixed autoconf config so libfko and fwknop client are not linked with…
Damien Stuart authored
173 AC_CHECK_LIB([pcap],[pcap_open_live],
174 [ AC_DEFINE([HAVE_LIBPCAP], [1], [Define if you have libpcap]) ],
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
175 [ AC_MSG_ERROR([fwknopd needs libpcap])]
176 )
177
178 # Looking for gdbm or fallback to ndbm or bail
179 #
9d2a4c2 Fixed autoconf config so libfko and fwknop client are not linked with…
Damien Stuart authored
180 AC_CHECK_LIB([gdbm],[gdbm_open],
181 [ AC_DEFINE([HAVE_LIBGDBM], [1], [Define if you have libgdbm]) ],
182 [ AC_CHECK_LIB([ndbm],[dbm_open],
183 [
184 AC_DEFINE([HAVE_LIBNDBM], [1], [Define if you have libndbm])
185 use_ndbm=yes
186 ],
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
187 [ AC_MSG_ERROR([fwknopd needs either gdbm or ndbm])]
188 )]
791eb40 Added check for libpcap. More stubbing in on the server code side.
Damien Stuart authored
189 )
190
9d2a4c2 Fixed autoconf config so libfko and fwknop client are not linked with…
Damien Stuart authored
191 AM_CONDITIONAL([USE_NDBM], [test x$use_ndbm = xyes])
192
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
193 dnl Check for iptables
194 dnl
195 AC_ARG_WITH([iptables],
196 [AS_HELP_STRING([--with-iptables=/path/to/iptables],
197 [Specify path to the iptables executable @<:@default=check path@:>@])],
198 [
199 AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ],
200 [AC_MSG_ERROR([--with-iptables requires an argument specifying a path to iptables])],
201 [
202 AC_CHECK_FILE([$withval], [], [
203 AC_MSG_WARN([Specified path to iptables does not exist on this system])
204 iptables_exe_warn="*not found*"
205 ])
206 IPTABLES_EXE=$withval
207 ]
208 )
209 ],
210 [
211 AC_PATH_PROG(IPTABLES_EXE, [iptables], [], [$APP_PATH])
212 ]
213 )
214 AS_IF([test "x$IPTABLES_EXE" != x],
215 [
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
216 AC_DEFINE_UNQUOTED([IPTABLES_EXE], ["$IPTABLES_EXE"], [Path to iptables executable])
217 iptables_exe=$IPTABLES_EXE
218 ], [ iptables_exe="(not found)"]
219 )
220
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
221 dnl Check for ipfw
222 dnl
223 AC_ARG_WITH([ipfw],
224 [AS_HELP_STRING([--with-ipfw=/path/to/ipfw],
225 [Specify path to the ipfw executable @<:@default=check path@:>@])],
226 [
227 AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ],
228 [AC_MSG_ERROR([--with-ipfw requires an argument specifying a path to ipfw])],
229 [
230 AC_CHECK_FILE([$withval], [], [
231 AC_MSG_WARN([Specified path to ipfw does not exist on this system])
232 ipfw_exe_warn="*not found*"
233 ])
234 IPFW_EXE=$withval
235 ]
236 )
237 ],
238 [
239 AC_PATH_PROG(IPFW_EXE, [ipfw], [], [$APP_PATH])
240 ]
241 )
242 AS_IF([test "x$IPFW_EXE" != x],
243 [
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
244 AC_DEFINE_UNQUOTED([IPFW_EXE], ["$IPFW_EXE"], [Path to ipfw executable])
245 ipfw_exe=$IPFW_EXE
246 ], [ ipfw_exe="(not found)"]
247 )
248
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
249 dnl Check for sendmail
250 dnl
aef097a Some tweaks to the sigchld handling in the server. Other misc minor c…
Damien Stuart authored
251 dnl AC_ARG_WITH([sendmail],
252 dnl [AS_HELP_STRING([--with-sendmail=/path/to/sendmail],
253 dnl [Specify path to the sendmail executable @<:@default=check path@:>@])],
254 dnl [
255 dnl AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ],
256 dnl [AC_MSG_ERROR([--with-sendmail requires an argument specifying a path to sendmail])],
257 dnl [
258 dnl AC_CHECK_FILE([$withval], [], [
259 dnl AC_MSG_WARN([Specified path to sendmail does not exist on this system])
260 dnl sendmail_exe_warn="*not found*"
261 dnl ])
262 dnl SENDMAIL_EXE=$withval
263 dnl ]
264 dnl )
265 dnl ],
266 dnl [
267 dnl AC_PATH_PROG(SENDMAIL_EXE, [sendmail], [], [$APP_PATH])
268 dnl ]
269 dnl )
270 dnl AS_IF([test "x$SENDMAIL_EXE" != x],
271 dnl [
272 dnl AC_DEFINE_UNQUOTED([SENDMAIL_EXE], ["$SENDMAIL_EXE"], [Path to sendmail executable])
273 dnl sendmail_exe=$SENDMAIL_EXE
274 dnl ], [ sendmail_exe="(not found)"]
275 dnl )
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
276
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
277 dnl Check for mail
278 dnl
aef097a Some tweaks to the sigchld handling in the server. Other misc minor c…
Damien Stuart authored
279 dnl AC_ARG_WITH([mail],
280 dnl [AS_HELP_STRING([--with-mail=/path/to/mail],
281 dnl [Specify path to the mail executable @<:@default=check path@:>@])],
282 dnl [
283 dnl AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ],
284 dnl [AC_MSG_ERROR([--with-mail requires an argument specifying a path to mail])],
285 dnl [
286 dnl AC_CHECK_FILE([$withval], [], [
287 dnl AC_MSG_WARN([Specified path to mail does not exist on this system])
288 dnl mail_exe_warn="*not found*"
289 dnl ])
290 dnl MAIL_EXE=$withval
291 dnl ]
292 dnl )
293 dnl ],
294 dnl [
295 dnl AC_PATH_PROG(MAIL_EXE, [mail], [], [$APP_PATH])
296 dnl ]
297 dnl )
298 dnl AS_IF([test "x$MAIL_EXE" != x],
299 dnl [
300 dnl AC_DEFINE_UNQUOTED([MAIL_EXE], ["$MAIL_EXE"], [Path to mail executable])
301 dnl mail_exe=$MAIL_EXE
302 dnl ], [ mail_exe="(not found)"]
303 dnl )
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
304
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
305 dnl Check for sh
306 dnl
307 AC_ARG_WITH([sh],
308 [AS_HELP_STRING([--with-sh=/path/to/sh],
309 [Specify path to the sh executable @<:@default=check path@:>@])],
310 [
311 AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ],
312 [AC_MSG_ERROR([--with-sh requires an argument specifying a path to sh])],
313 [
314 AC_CHECK_FILE([$withval], [], [
315 AC_MSG_WARN([Specified path to sh does not exist on this system])
316 sh_exe_warn="*not found*"
317 ])
318 SH_EXE=$withval
319 ]
320 )
321 ],
322 [
323 AC_PATH_PROG(SH_EXE, [sh], [], [$APP_PATH])
324 ]
325 )
326 AS_IF([test "x$SH_EXE" != x],
327 [
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
328 AC_DEFINE_UNQUOTED([SH_EXE], ["$SH_EXE"], [Path to sh executable])
329 sh_exe=$SH_EXE
330 ], [ sh_exe="(not found)"]
331 )
332 ])
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
333
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
334 AC_CONFIG_FILES([Makefile
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
335 lib/Makefile
336 client/Makefile
337 server/Makefile
338 common/Makefile
339 doc/Makefile])
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
340
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
341 AC_OUTPUT
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
342
d0373a5 Fixed libfko so gpgme engine is gpg by default. Added functions to l…
Damien Stuart authored
343 if [test $have_gpgme = "yes" ]; then
344 have_gpgme="$have_gpgme
345 Gpgme engine: $GPG_EXE"
346 fi
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
347
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
348 echo "
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
349 $PACKAGE_NAME-$PACKAGE_VERSION configuration.
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
350 ==========================================================
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
351 Client build: $want_client
352 Server build: $want_server
353 GPG encryption support: $have_gpgme
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
354
355 Installation prefix: $prefix
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
356 "
357 if [test $want_server = "yes" ]; then
358 echo " Server support programs:
b823580 Added configure args for specifying specific pathes to the local exec…
Damien Stuart authored
359 iptables: $iptables_exe $iptables_exe_warn
360 ipfw: $ipfw_exe $ipfw_exe_warn
361 sh: $sh_exe $sh_exe_warn
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
362 "
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
363 fi
364
Something went wrong with that request. Please try again.