Debian Codegraph @

configure.ac

raw
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.69])
5 AC_CONFIG_MACRO_DIRS([m4])
6 AC_INIT([dhcpd-pools],
7 [m4_esyscmd([build-aux/git-version-gen .tarball-version])],
8 [[email protected]],[],
9 [http://dhcpd-pools.sourceforge.net/])
10 PACKAGE_MAINTAINER="Sami Kerola"
11 AC_SUBST([PACKAGE_MAINTAINER])
12 AC_CONFIG_AUX_DIR([build-aux])
13 AM_INIT_AUTOMAKE([
14 -Wall
15 -Wextra-portability
16 1.12
17 foreign
18 dist-xz
19 no-dist-gzip
20 parallel-tests
21 subdir-objects
22 tar-pax
23 ])
24 AC_CONFIG_SRCDIR([src/dhcpd-pools.h])
25 AC_CONFIG_HEADERS([config.h])
26
27 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
28 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
29
30 # Checks for programs
31 AC_USE_SYSTEM_EXTENSIONS
32 AC_C_RESTRICT
33 AC_PROG_CC
34 gl_EARLY
35 gl_INIT
36 AC_PROG_MAKE_SET
37 LT_INIT
38
39 # Checks for libraries.
40 LT_INIT
41
42 # Checks for header files.
43 AC_CHECK_HEADERS([\
44 arpa/inet.h \
45 fcntl.h \
46 libintl.h \
47 limits.h \
48 sys/socket.h \
49 ])
50
51 AC_ARG_WITH(
52 [uthash],
53 [AS_HELP_STRING([--with-uthash=DIR], [Use uthash from [DIR]/uthash.h)])],
54 [AS_CASE([$with_uthash],
55 [yes], [],
56 [no], [AC_MSG_ERROR([the uthash is required])],
57 [CPPFLAGS="$CPPFLAGS -I$with_uthash"]
58 )]
59 )
60 AC_CHECK_HEADER([uthash.h], [], [AC_MSG_ERROR([Unable to find uthash.h])])
61
62 # Checks for typedefs, structures, and compiler characteristics.
63 AC_C_INLINE
64 AC_HEADER_STDBOOL
65 AC_TYPE_SIZE_T
66 AC_TYPE_UINT32_T
67
68 # Checks for library functions.
69 AC_FUNC_ERROR_AT_LINE
70 AC_CHECK_FUNCS([\
71 __fpending \
72 open_memstream \
73 posix_fadvise \
74 ])
75 AC_CHECK_DECL([strndupa])
76
77 AC_CHECK_FUNCS([fpclassify], [],
78 [AC_CHECK_LIB([m], [fpclassify], [MATH_LIBS="-lm"])]
79 [AC_CHECK_LIB([m], [__fpclassify], [MATH_LIBS="-lm"])]
80 )
81 AC_SUBST([MATH_LIBS])
82
83 AS_IF([test "x$ac_cv_func_open_memstream" = "xyes" && test "x$ac_cv_have_decl_strndupa" == "xyes"], [
84 build_mustach=yes
85 AC_DEFINE([BUILD_MUSTACH], [1], [build mustach support])
86 ], [
87 build_mustach=no
88 ])
89 AM_CONDITIONAL([ENABLE_MUSTACH], [test "x$build_mustach" = xyes])
90
91 AC_MSG_CHECKING([if the compiler supports __builtin_expect])
92 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
93 return __builtin_expect(1, 1) ? 1 : 0
94 ]])],[
95 have_builtin_expect=yes
96 AC_MSG_RESULT([yes])
97 ],[
98 have_builtin_expect=no
99 AC_MSG_RESULT([no])
100 ])
101 AS_IF([test x$have_builtin_expect = xyes], [
102 AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
103 [The compiler supports __builtin_expect])
104 ])
105
106 AC_ARG_WITH([dhcpd-conf],
107 [AS_HELP_STRING([--with-dhcpd-conf=FILE],[default path of dhcpd.conf])],
108 [dhcpd_conf_path="$withval"],
109 [dhcpd_conf_path="/etc/dhcpd.conf"])
110 AC_DEFINE_UNQUOTED([DHCPDCONF_FILE], ["$dhcpd_conf_path"], [default path of dhcpd.conf])
111 AC_SUBST([DHCPDCONF_FILE], [$dhcpd_conf_path])
112
113 AC_ARG_WITH([dhcpd-leases],
114 [AS_HELP_STRING([--with-dhcpd-leases=FILE],[default path of dhcpd.leases])],
115 [dhcpd_leases_path="$withval"],
116 [dhcpd_leases_path="/var/lib/dhcp/dhcpd.leases"])
117 AC_DEFINE_UNQUOTED([DHCPDLEASE_FILE], ["$dhcpd_leases_path"], [default path of dhcpd.leases])
118 AC_SUBST([DHCPDLEASE_FILE], [$dhcpd_leases_path])
119
120 AC_ARG_WITH([output-format],
121 [AS_HELP_STRING([--with-output-format=FORMAT],[default output format])],
122 [output_format="$withval"],
123 [output_format="text"])
124 AC_DEFINE_UNQUOTED([OUTPUT_FORMAT], ["$output_format"], [default output format])
125 AC_SUBST([OUTPUT_FORMAT], [$output_format])
126
127 AC_ARG_WITH([output-limit],
128 [AS_HELP_STRING([--with-output-limit=MASK],[default output limit])],
129 [output_limit="$withval"],
130 [output_limit="77"])
131 AC_DEFINE_UNQUOTED([OUTPUT_LIMIT], ["$output_limit"], [default output limit])
132 AC_SUBST([OUTPUT_LIMIT], [$output_limit])
133
134 AC_ARG_WITH([warning],
135 [AS_HELP_STRING([--with-warning=NUM],[monitoring warning default])],
136 [warning_percent="$withval"],
137 [warning_percent="80"])
138 AC_DEFINE_UNQUOTED([ALARM_WARN], [$warning_percent], [monitoring warning default])
139 AC_SUBST([ALARM_WARN], [$warning_percent])
140
141 AC_ARG_WITH([critical],
142 [AS_HELP_STRING([--with-critical=NUM],[monitoring critical default])],
143 [critical_percent="$withval"],
144 [critical_percent="90"])
145 AC_DEFINE_UNQUOTED([ALARM_CRIT], [$critical_percent], [monitoring critical default])
146 AC_SUBST([ALARM_CRIT], [$critical_percent])
147
148 AC_ARG_ENABLE([doxygen],
149 AS_HELP_STRING([--enable-doxygen],[build internal api documentation @<:@default=disabled@:>@]),
150 [], [enable_doxygen=no])
151 AM_CONDITIONAL([ENABLE_DOXYGEN], [test "x$enable_doxygen" = "xyes"])
152
153 AS_IF([test x$enable_doxygen = xyes], [
154 AC_CHECK_PROGS([DOXYGEN], [doxygen])
155 AS_IF([test "x$DOXYGEN" = "x"],
156 AC_MSG_ERROR([doxygen not in path])
157 )
158
159 AC_CHECK_PROGS([DOXYGEN_DOT], [dot])
160 AS_IF([test "x$DOXYGEN" = "x"],
161 AC_MSG_WARN([dot not in path, internal documentation graphs are not generated])
162 )
163 ])
164 AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN" != "x"])
165 AM_CONDITIONAL([HAVE_DOXYGEN_DOT], [test "x$DOXYGEN_DOT" != "x"])
166
167 AC_CONFIG_FILES([
168 Makefile
169 lib/Makefile
170 ])
171
172 AC_OUTPUT