2
2
# Process this file with autoconf to produce a configure script.
5
AC_INIT(libspf2, 1.2.5, libspf2@rt.anarres.org)
5
AC_INIT(libspf2, 1.2.9, libspf2@anarres.org)
6
6
AC_CONFIG_AUX_DIR(config)
7
7
AM_INIT_AUTOMAKE(libspf2, $PACKAGE_VERSION)
8
8
AC_CONFIG_SRCDIR([src/libspf2/spf_server.c])
11
11
# remember the version info for later
13
major=`echo $PACKAGE_VERSION | sed 's/^\([[0-9]]*\)\.[[0-9]]*\.[[0-9]]*/\1/'`
14
minor=`echo $PACKAGE_VERSION | sed 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*/\1/'`
15
patch=`echo $PACKAGE_VERSION | sed 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)/\1/'`
13
KV_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\([[0-9]]*\)\.[[0-9]]*\.[[0-9]]*/\1/'`
14
KV_MINOR=`echo $PACKAGE_VERSION | sed 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*/\1/'`
15
KV_PATCH=`echo $PACKAGE_VERSION | sed 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)/\1/'`
17
cat >src/libspf2/spf_lib_version.h <<_EOF_VERSION
20
cat >src/include/spf_lib_version.h <<_EOF_VERSION
23
* @brief Autogenerated configuration information - do not edit.
18
25
#ifndef INC_SPF_VERSION
19
26
#define INC_SPF_VERSION
21
#define SPF_LIB_VERSION_MAJOR $major
22
#define SPF_LIB_VERSION_MINOR $minor
23
#define SPF_LIB_VERSION_PATCH $patch
28
#define SPF_LIB_VERSION_MAJOR $KV_MAJOR
29
#define SPF_LIB_VERSION_MINOR $KV_MINOR
30
#define SPF_LIB_VERSION_PATCH $KV_PATCH
37
AC_SUBST([PERL_SUBDIRS])
39
AC_HELP_STRING([--enable-perl],
40
[build the Perl/XS interface to libspf2]),
43
AC_CONFIG_COMMANDS([perl/Makefile], [
44
# XXX This needs to use $PERL, somehow.
45
( cd perl && perl Makefile.PL )
29
50
# Checks for programs.
65
87
AC_CHECK_SIZEOF([int])
66
AC_CHECK_HEADERS([limits.h])
67
AC_CHECK_HEADERS([sys/param.h])
68
AC_CHECK_HEADERS([netinet/in.h sys/socket.h syslog.h sys/time.h errno.h sys/types.h])
69
AC_CHECK_HEADERS([fcntl.h malloc.h nmemory.h stddef.h inttypes.h stdlib.h string.h syslog.h unistd.h stdarg.h])
70
AC_CHECK_HEADERS([pthread.h pwd.h grp.h])
71
AC_CHECK_HEADERS([netdb.h arpa/inet.h arpa/nameser.h])
72
AC_CHECK_HEADERS([syslog.h])
73
AC_CHECK_HEADERS([resolv.h], [], [],
74
[[#if HAVE_SYS_TYPES_H
88
AC_CHECK_HEADERS([limits.h sys/param.h syslog.h sys/time.h errno.h sys/types.h])
89
AC_CHECK_HEADERS([fcntl.h malloc.h nmemory.h stddef.h inttypes.h stdlib.h string.h unistd.h stdarg.h])
90
AC_CHECK_HEADERS([pthread.h pwd.h grp.h libintl.h getopt.h])
91
AC_CHECK_HEADERS([netdb.h netinet/in.h sys/socket.h arpa/inet.h arpa/nameser.h])
92
AC_CHECK_HEADERS([resolv.h], [], [], [[
75
94
# include <sys/types.h>
77
#ifdef HAVE_NETINET_IN_H
78
# include <netinet/in.h> /* inet_ functions / structs */
80
#ifdef HAVE_ARPA_NAMESER_H
81
# include <arpa/nameser.h> /* DNS HEADER struct */
83
96
#ifdef HAVE_SYS_SOCKET_H
84
97
# include <sys/socket.h> /* DNS HEADER struct */
87
AC_CHECK_HEADERS([libintl.h])
88
AC_CHECK_HEADERS([getopt.h])
99
#ifdef HAVE_NETINET_IN_H
100
# include <netinet/in.h> /* inet_ functions / structs */
102
#ifdef HAVE_ARPA_NAMESER_H
103
# include <arpa/nameser.h> /* DNS HEADER struct */
106
dnl XXX This is no longer true.
90
107
AC_CHECK_HEADER(pthread.h, , [
91
108
echo "pthread.h is required to build this program."
144
161
AC_C_CHAR_UNSIGNED
145
162
AC_CHECK_TYPES([u_char, u_int8_t, u_int16_t, u_int32_t, uint8_t, uint16_t, uint32_t])
146
AC_CHECK_TYPES([ns_type], [], [],
163
AC_CHECK_TYPES([ns_type], [], [], [[
164
#ifdef HAVE_SYS_TYPES_H
165
# include <sys/types.h>
148
167
#ifdef HAVE_SYS_SOCKET_H
149
168
# include <sys/socket.h> /* inet_ functions / structs */
152
171
# include <netinet/in.h> /* inet_ functions / structs */
154
173
#ifdef HAVE_ARPA_NAMESER_H
155
# include <arpa/nameser.h> /* DNS HEADER struct */
174
# include <arpa/nameser.h> /* DNS HEADER struct */
158
AC_CHECK_TYPES([struct in6_addr], [], [],
177
AC_CHECK_TYPES([struct in6_addr], [], [], [[
160
178
#ifdef HAVE_NETINET_IN_H
161
# include <netinet/in.h> /* inet_ functions / structs */
179
# include <netinet/in.h> /* inet_ functions / structs */
179
197
# Nowadays, I think libspf2 requires this function to be available.
180
198
AC_CHECK_DECLS([res_ninit], [], [], [[
181
#ifdef HAVE_SYS_SOCKET_H
182
# include <sys/socket.h> /* inet_ functions / structs */
184
#ifdef HAVE_NETINET_IN_H
185
# include <netinet/in.h> /* inet_ functions / structs */
187
#ifdef HAVE_ARPA_NAMESER_H
188
# include <arpa/nameser.h> /* DNS HEADER struct */
199
#ifdef HAVE_SYS_TYPES_H
200
# include <sys/types.h>
202
#ifdef HAVE_SYS_SOCKET_H
203
# include <sys/socket.h> /* inet_ functions / structs */
205
#ifdef HAVE_NETINET_IN_H
206
# include <netinet/in.h> /* inet_ functions / structs */
208
#ifdef HAVE_ARPA_NAMESER_H
209
# include <arpa/nameser.h> /* DNS HEADER struct */
215
AC_CHECK_DECLS([res_ndestroy], [], [], [[
216
#ifdef HAVE_SYS_TYPES_H
217
# include <sys/types.h>
219
#ifdef HAVE_SYS_SOCKET_H
220
# include <sys/socket.h> /* inet_ functions / structs */
222
#ifdef HAVE_NETINET_IN_H
223
# include <netinet/in.h> /* inet_ functions / structs */
225
#ifdef HAVE_ARPA_NAMESER_H
226
# include <arpa/nameser.h> /* DNS HEADER struct */
233
AC_CHECK_DECLS([ns_t_spf], [], [], [[
234
#ifdef HAVE_SYS_TYPES_H
235
# include <sys/types.h>
237
#ifdef HAVE_SYS_SOCKET_H
238
# include <sys/socket.h> /* inet_ functions / structs */
240
#ifdef HAVE_NETINET_IN_H
241
# include <netinet/in.h> /* inet_ functions / structs */
243
#ifdef HAVE_ARPA_NAMESER_H
244
# include <arpa/nameser.h> /* DNS HEADER struct */
251
AC_CHECK_DECLS([ns_t_invalid], [], [], [[
252
#ifdef HAVE_SYS_TYPES_H
253
# include <sys/types.h>
255
#ifdef HAVE_SYS_SOCKET_H
256
# include <sys/socket.h> /* inet_ functions / structs */
258
#ifdef HAVE_NETINET_IN_H
259
# include <netinet/in.h> /* inet_ functions / structs */
261
#ifdef HAVE_ARPA_NAMESER_H
262
# include <arpa/nameser.h> /* DNS HEADER struct */
193
269
AC_CHECK_FUNCS([ftruncate gethostname memmove memset socket])
195
271
AC_CHECK_FUNCS([strcasecmp strncasecmp strspn strtoul])
196
272
AC_CHECK_FUNCS([gethostbyname inet_ntoa select strrchr strstr strtol])
198
AC_REPLACE_FUNCS([getopt_long_only])
274
AC_REPLACE_FUNCS([getopt_long_only strncasecmp])
199
275
AC_REPLACE_FUNCS([__ns_initparse __ns_name_uncompress __ns_get16 __ns_msg_getflag])
201
277
AC_CONFIG_FILES([Makefile
203
280
src/include/Makefile
204
281
src/libreplace/Makefile