Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 235 lines (188 sloc) 5.994 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])
14 m4_define(my_version, [2.0.0-alpha-pre1])
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
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
25 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 AC_CONFIG_MACRO_DIR([m4])
30
31 dnl The top of our header
32 dnl
33 AH_TOP([
34 #ifndef FWKNOP_CONFIG_H
35 #define FWKNOP_CONFIG_H
36 ])
37
38 dnl The bottom of our header file
39 dnl
40 AH_BOTTOM([
41 #endif /* FWKNOP_CONFIG_H */
42 ])
43
44 dnl Decide whether or not to build the client
45 dnl
46 want_client=yes
47 AC_ARG_ENABLE([client],
48 [AS_HELP_STRING([--disable-client],
49 [Do not build the fwknop client @<:@default is to build@:>@])],
50 [want_client=$enableval],
51 [])
52 AM_CONDITIONAL([WANT_CLIENT], [test "$want_client" = yes])
53
54 dnl Decide whether or not to build the server
55 dnl
56 want_server=yes
57 AC_ARG_ENABLE([server],
58 [AS_HELP_STRING([--disable-server],
59 [Do not build the fwknop server @<:@default is to build@:>@])],
60 [want_server=$enableval],
61 [])
62 AM_CONDITIONAL([WANT_SERVER], [test "$want_server" = yes])
63
64 CONFIGURE_PART(Compilation Environment)
65
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
66 AC_GNU_SOURCE
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
67
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
68 AC_PROG_CC
69 AM_PROG_CC_C_O
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
70 AC_PROG_CPP
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
71 AC_PROG_AWK
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
72 AC_PROG_SED
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
73 AC_PROG_GREP
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
74 AC_PROG_INSTALL
75 AC_PROG_LN_S
76 AC_PROG_MAKE_SET
474a787 more checks for configure. omit salt from Rijndael-encrypted data as…
Damien Stuart authored
77 AC_PROG_RANLIB
e113cb7 Updates to allow for building libfko as a shared lib. (make use of li…
Damien Stuart authored
78 AC_PROG_LIBTOOL
79
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
80 # Checks for header files.
81 #
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
82 CONFIGURE_PART(Header File Checks)
83
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
84 AC_HEADER_STDC
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
85 AC_HEADER_TIME
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
86 AC_HEADER_RESOLV
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
87
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
88 AC_CHECK_HEADERS([ctype.h endian.h errno.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
89
90 # Type checks.
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
91 #
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
92 CONFIGURE_PART(Type Checks)
93
2a51204 Removing files that are auto-generated by the autogen.sh script.
Damien Stuart authored
94 AC_C_CONST
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
95 AC_TYPE_INT8_T
96 AC_TYPE_INT16_T
97 AC_TYPE_INT32_T
98 AC_TYPE_INT64_T
99 AC_TYPE_UINT8_T
100 AC_TYPE_UINT16_T
101 AC_TYPE_UINT32_T
102 AC_TYPE_UINT64_T
deb85dd Total re-arrangement for autoconf/automake implementation.
Damien Stuart authored
103 AC_TYPE_OFF_T
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
104 AC_TYPE_PID_T
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
105 AC_TYPE_SIZE_T
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
106
2a51204 Removing files that are auto-generated by the autogen.sh script.
Damien Stuart authored
107 AC_CHECK_SIZEOF(unsigned int)
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
108 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
109
110 AC_C_BIGENDIAN
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
111
112 # Checks for library functions.
113 #
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
114 CONFIGURE_PART(Library Function Checks)
115
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
116 AC_FUNC_MALLOC
474a787 more checks for configure. omit salt from Rijndael-encrypted data as…
Damien Stuart authored
117 AC_FUNC_REALLOC
be3bb07 Added getpasswd routine for getting a password from the user. A few …
Damien Stuart authored
118 AC_FUNC_STAT
7f45031 Added SHA384 and SHA512 digests. Tweaks for getting rid of windows w…
Damien Stuart authored
119
be3bb07 Added getpasswd routine for getting a password from the user. A few …
Damien Stuart authored
120 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
121
7f0e7a9 Updated autoconf files and code to support Solaris (ver 10 x86 at lea…
Damien Stuart authored
122 AC_SEARCH_LIBS([socket], [socket])
123 AC_SEARCH_LIBS([inet_addr], [nsl])
124
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
125 CONFIGURE_PART(3rd-party Libraries)
41127cd Added better autoconf handling of gpgpme. Fixes so libfko will compi…
Damien Stuart authored
126
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
127 AC_ARG_WITH([gpgme],
128 [AS_HELP_STRING([--with-gpgme],
129 [support for gpg encryption using libgpgme @<:@default=check@:>@])],
130 [],
131 [with_gpgme=check])
132
10b308b Fixed configure.ac again (I broke it with my last change). Added fir…
Damien Stuart authored
133 have_gpgme=yes
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
134 AS_IF([test "x$with_gpgme" != xno],
41127cd Added better autoconf handling of gpgpme. Fixes so libfko will compi…
Damien Stuart authored
135 [AM_PATH_GPGME([],
136 [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
137 [if test "x$with_gpgme" != xcheck; then
138 AC_MSG_FAILURE(
139 [--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
140 else
141 have_gpgme=no
18c0560 Fixed gpgme check so it would not fail if gpgme was not installed. S…
Damien Stuart authored
142 fi
41127cd Added better autoconf handling of gpgpme. Fixes so libfko will compi…
Damien Stuart authored
143 ], [have_gpgme=no])], [have_gpgme=no])
144
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
145 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
146 dnl
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
147 AS_IF([test "$want_server" = yes], [
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
148 # Looking for libpcap
149 #
150 AC_CHECK_LIB([pcap],[pcap_open_live], [],
151 [ AC_MSG_ERROR([fwknopd needs libpcap])]
152 )
153
154 # Looking for gdbm or fallback to ndbm or bail
155 #
4b8e3e9 Changed digest cache to use gdbm directly wth fallback to ndbm (still…
Damien Stuart authored
156 AC_CHECK_LIB([gdbm],[gdbm_open], [],
8c1261c Fixed memory leak issue in libfko when fko_new_with_data() was called…
Damien Stuart authored
157 [ AC_CHECK_LIB([ndbm],[dbm_open], [],
158 [ AC_MSG_ERROR([fwknopd needs either gdbm or ndbm])]
159 )]
791eb40 Added check for libpcap. More stubbing in on the server code side.
Damien Stuart authored
160 )
161
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
162 CONFIGURE_PART(Find local executables used by the server)
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
163
164 dnl Add various common way to sbin dir to the path (just in case)
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
165 APP_PATH=$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/local/sbin
166
167 AC_PATH_PROG(IPTABLES_EXE, [iptables], [], [$APP_PATH])
168 AS_IF([test x$IPTABLES_EXE != x], [
169 AC_DEFINE_UNQUOTED([IPTABLES_EXE], ["$IPTABLES_EXE"], [Path to iptables executable])
170 iptables_exe=$IPTABLES_EXE
171 ], [ iptables_exe="(not found)"]
172 )
173
174 AC_PATH_PROG(IPFW_EXE, [ipfw], [], [$APP_PATH])
175 AS_IF([test x$IPFW_EXE != x], [
176 AC_DEFINE_UNQUOTED([IPFW_EXE], ["$IPFW_EXE"], [Path to ipfw executable])
177 ipfw_exe=$IPFW_EXE
178 ], [ ipfw_exe="(not found)"]
179 )
180
181 AC_PATH_PROG(SENDMAIL_EXE, [sendmail], [], [$APP_PATH$PATH_SEPARATOR/usr/lib])
182 AS_IF([test x$SENDMAIL_EXE != x], [
183 AC_DEFINE_UNQUOTED([SENDMAIL_EXE], ["$SENDMAIL_EXE"], [Path to sendmail executable])
184 sendmail_exe=$SENDMAIL_EXE
185 ], [ sendmail_exe="(not found)"]
186 )
187
188 AC_PATH_PROG(MAIL_EXE, [mail], [], [$APP_PATH])
189 AS_IF([test x$MAIL_EXE != x], [
190 AC_DEFINE_UNQUOTED([MAIL_EXE], ["$MAIL_EXE"], [Path to mail executable])
191 mail_exe=$MAIL_EXE
192 ], [ mail_exe="(not found)"]
193 )
194
195 AC_PATH_PROG(SH_EXE, [sh], [], [$APP_PATH])
196 AS_IF([test x$SH_EXE != x], [
197 AC_DEFINE_UNQUOTED([SH_EXE], ["$SH_EXE"], [Path to sh executable])
198 sh_exe=$SH_EXE
199 ], [ sh_exe="(not found)"]
200 )
201 ])
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
202
203 CONFIGURE_PART(Generating Files)
204
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
205 AC_CONFIG_FILES([Makefile
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
206 lib/Makefile
207 client/Makefile
208 server/Makefile
209 common/Makefile
210 doc/Makefile])
a82c361 Another major re-write of the fwknop library.
Damien Stuart authored
211
1cdf9fd Re-arrangement of source tree.
Damien Stuart authored
212 AC_OUTPUT
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
213
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
214 CONFIGURE_PART(Configure Summary)
215
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
216 echo "
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
217 $PACKAGE_NAME-$PACKAGE_VERSION configuration.
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
218 ==========================================================
53b7fae Major rearrangement. Renamed directories: "fko" to "lib", "src" to "…
Damien Stuart authored
219 Client build: $want_client
220 Server build: $want_server
221 GPG encryption support: $have_gpgme
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
222
223 Installation prefix: $prefix
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
224 "
225 if [test $want_server = "yes" ]; then
226 echo " Server support programs:
861c0e8 Autoconf updates for detecting locally installed program paths and ch…
Damien Stuart authored
227 iptables: $iptables_exe
228 ipfw: $ipfw_exe
229 sendmail: $sendmail_exe
230 mail: $mail_exe
231 sh: $sh_exe
e846cdd First cut at GPG encrytion support (decryption and doc update are pen…
Damien Stuart authored
232 "
2310b36 Made local exe checks run only of a server is being built. Removed c…
Damien Stuart authored
233 fi
234
Something went wrong with that request. Please try again.