summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 2e61414fd6591f2f833333a28bdd932e5bd8e237 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
AC_INIT([DHCP], [4.0.0a1], [dhcp-users@isc.org])

# we specify "foreign" to avoid having to have the GNU mandated files,
# like AUTHORS, COPYING, and such
AM_INIT_AUTOMAKE([foreign])

AC_PROG_CC
AC_PROG_RANLIB
AC_CONFIG_HEADERS([includes/config.h])

# we sometimes need to know byte order for building packets
AC_C_BIGENDIAN(AC_SUBST(byte_order, BIG_ENDIAN), 
	       AC_SUBST(byte_order, LITTLE_ENDIAN))
AC_DEFINE_UNQUOTED([DHCP_BYTE_ORDER], [$byte_order], 
		   [Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs)
		    or LITTLE_ENDIAN for LSB (Intel CPUs).])

# DHCPv6 is off by default
AC_ARG_ENABLE(dhcpv6,
	AC_HELP_STRING([--enable-dhcpv6],
		       [enable support for DHCPv6 (default is NO)]),
	AC_DEFINE([DHCPv6], [1], 
		  [Define to 1 to include DHCPv6 support.]))

# Allow specification of alternate state files
AC_ARG_WITH(srv-lease-file,
	AC_HELP_STRING([--with-srv-lease-file=PATH],
		       [File for dhcpd leases 
		        (default is LOCALSTATEDIR/db/dhcpd.leases)]),
	AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"],
			   [File for dhcpd leases.]))
AC_ARG_WITH(cli-lease-file,
	AC_HELP_STRING([--with-cli-lease-file=PATH],
		       [File for dhclient leases 
		        (default is LOCALSTATEDIR/db/dhclient.leases)]),
	AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"],
			   [File for dhclient leases.]))
AC_ARG_WITH(srv-pid-file,
	AC_HELP_STRING([--with-srv-pid-file=PATH],
		       [File for dhcpd process information
		        (default is LOCALSTATEDIR/run/dhcpd.pid)]),
	AC_DEFINE_UNQUOTED([_PATH_DHCPD_PID], ["$withval"],
			   [File for dhcpd process information.]))
AC_ARG_WITH(cli-pid-file,
	AC_HELP_STRING([--with-cli-pid-file=PATH],
		       [File for dhclient process information
		        (default is LOCALSTATEDIR/run/dhclient.pid)]),
	AC_DEFINE_UNQUOTED([_PATH_DHCLIENT], ["$withval"],
			   [File for dhclient process information.]))
AC_ARG_WITH(relay-pid-file,
	AC_HELP_STRING([--with-relay-pid-file=PATH],
		       [File for dhcrelay process information
		        (default is LOCALSTATEDIR/run/dhcrelay.pid)]),
	AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"],
			   [File for dhcrelay process information.]))

# figure out what IPv4 interface code to use
AC_CHECK_HEADER(linux/filter.h, 
	AC_DEFINE([USE_LPF], [1], 
		  [Define to 1 to use the Linux Packet Filter interface code.]))
AC_CHECK_HEADER(sys/dlpi.h, 
	AC_DEFINE([USE_DLPI], [1], 
		  [Define to 1 to use DLPI interface code.]))
AC_CHECK_HEADER(net/bpf.h,
	AC_DEFINE([USE_BPF], [1],
		  [Define to 1 to use the 
		   Berkeley Packet Filter interface code.]))

# Look for optional headers.
AC_CHECK_HEADER(net/if_dl.h,
	AC_DEFINE([HAVE_IF_DL], [1],
		  [Define to 1 if the system has a net/if_dl.h header.]))

# find an MD5 library
AC_SEARCH_LIBS(MD5_Init, [crypto])
AC_SEARCH_LIBS(MD5Init, [crypto])

# Solaris needs some libraries for functions
AC_SEARCH_LIBS(socket, [socket])
AC_SEARCH_LIBS(inet_ntoa, [nsl])

AC_SEARCH_LIBS(inet_aton, [socket nsl], , 
	AC_DEFINE([NEED_INET_ATON], [1], 
		  [Define to 1 if the inet_aton() function is missing.]))

# check for /dev/random (declares HAVE_DEV_RANDOM)
AC_CHECK_FILE(/dev/random,
	AC_DEFINE([HAVE_DEV_RANDOM], [1], 
		  [Define to 1 if you have the /dev/random file.]))

# see if there is a "sa_len" field in our interface information structure
AC_CHECK_MEMBER(struct sockaddr.sa_len,
	AC_DEFINE([HAVE_SA_LEN], [], 
		  [Define to 1 if the sockaddr structure has a length field.]),
	,
	[#include <sys/socket.h>])

# figure out pointer size
AC_CHECK_SIZEOF(struct iaddr *, , [
#include "includes/inet.h"
#include <stdio.h>
])

AC_OUTPUT(
  Makefile
  client/Makefile
  common/Makefile
  dhcpctl/Makefile
  dst/Makefile
  includes/Makefile
  minires/Makefile
  omapip/Makefile
  relay/Makefile
  server/Makefile
)