xref: /freebsd/contrib/blocklist/port/configure.ac (revision 5f4c09dd85bff675e0ca63c55ea3c517e0fddfcc)
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([blacklistd],[0.1],[christos@netbsd.com])
3AM_INIT_AUTOMAKE([subdir-objects foreign])
4m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
5
6AC_CONFIG_HEADERS([config.h])
7AC_CONFIG_MACRO_DIR([m4])
8
9AC_SUBST(WARNINGS)
10
11dnl Checks for programs.
12AC_PROG_CC_STDC
13AC_USE_SYSTEM_EXTENSIONS
14AM_PROG_CC_C_O
15AC_C_BIGENDIAN
16AC_PROG_INSTALL
17AC_PROG_LN_S
18LT_INIT([disable-static pic-only])
19gl_VISIBILITY
20dnl Checks for headers
21AC_HEADER_STDC
22AC_HEADER_MAJOR
23AC_HEADER_SYS_WAIT
24AC_CHECK_HEADERS(stdint.h fcntl.h stdint.h inttypes.h unistd.h)
25AC_CHECK_HEADERS(sys/un.h sys/socket.h limits.h)
26AC_CHECK_HEADERS(arpa/inet.h getopt.h err.h)
27AC_CHECK_HEADERS(sys/types.h util.h sys/time.h time.h)
28AC_CHECK_HEADERS(netatalk/at.h net/if_dl.h db.h db_185.h)
29AC_CHECK_LIB(rt, clock_gettime)
30AC_CHECK_LIB(db, __db185_open)
31AC_CHECK_LIB(util, pidfile)
32AC_CHECK_LIB(util, sockaddr_snprintf)
33
34AH_BOTTOM([
35#ifndef __NetBSD__
36#include "port.h"
37#endif
38])
39
40dnl Checks for typedefs, structures, and compiler characteristics.
41AC_C_CONST
42AC_TYPE_OFF_T
43AC_TYPE_SIZE_T
44AC_SYS_LARGEFILE
45AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [], [#include <sys/socket.h>])
46
47AC_TYPE_PID_T
48AC_TYPE_UINT8_T
49AC_TYPE_UINT16_T
50AC_TYPE_UINT32_T
51AC_TYPE_INT32_T
52AC_TYPE_UINT64_T
53AC_TYPE_INT64_T
54AC_TYPE_INTPTR_T
55AC_TYPE_UINTPTR_T
56
57AC_MSG_CHECKING(for gcc compiler warnings)
58AC_ARG_ENABLE(warnings,
59[  --disable-warnings	disable compiler warnings],
60[if test "${enableval}" = no -o "$GCC" = no; then
61   AC_MSG_RESULT(no)
62   WARNINGS=
63else
64   AC_MSG_RESULT(yes)
65   WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
66       -Wmissing-declarations -Wredundant-decls -Wnested-externs \
67       -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
68       -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
69fi], [
70if test "$GCC" = yes; then
71   AC_MSG_RESULT(yes)
72   WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
73       -Wmissing-declarations -Wredundant-decls -Wnested-externs \
74       -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
75       -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
76else
77   WARNINGS=
78   AC_MSG_RESULT(no)
79fi])
80
81dnl Checks for functions
82AC_CHECK_FUNCS(strerror)
83
84dnl Provide implementation of some required functions if necessary
85AC_REPLACE_FUNCS(strtoi sockaddr_snprintf popenve clock_gettime strlcpy strlcat getprogname fparseln fgetln pidfile)
86
87dnl See if we are cross-compiling
88AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
89
90AC_CONFIG_FILES([Makefile])
91AC_OUTPUT
92