2 # Process this file with autoconf to produce a configure script.
4 #######################
9 AC_INIT([lldpd], [0.5.0], [bernat@luffy.cx])
10 AC_CONFIG_SRCDIR([src/lldpd.c])
11 AC_CONFIG_HEADER([config.h])
12 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile tests/Makefile])
13 AC_CONFIG_MACRO_DIR([m4])
16 AM_INIT_AUTOMAKE([foreign -Wall -Werror])
17 AM_SILENT_RULES([yes])
23 #######################
26 # Checks for programs.
39 # Checks for header files.
58 ],,AC_MSG_ERROR([Required header missing.]))
64 ],,AC_MSG_ERROR([Required header missing.]),[
65 @%:@include <arpa/inet.h>
66 @%:@include <linux/if.h>
70 ],,AC_MSG_ERROR([Required header missing.]),[
71 @%:@include <linux/types.h>
75 ],,AC_MSG_ERROR([You should get linux/if_vlan.h from some other place. See README file.]),[
76 @%:@include <arpa/inet.h>
77 @%:@include <linux/if.h>
82 # Check for sys/queue.h completeness, missing bits will be in compat.h
96 ],[],[],[[@%:@include <sys/queue.h>]])
98 # On some systems, some ioctl are not declared
102 SIOCBONDSLAVEINFOQUERY \
103 ],[],[],[[@%:@include <linux/sockios.h>]])
104 AC_CHECK_MEMBERS([ifslave.slave_name, ifbond.num_slaves], [],
105 [AC_MSG_ERROR([linux/if_bonding.h is incomplete. See README file.])],
107 @%:@include <arpa/inet.h>
108 @%:@include <linux/if.h>
109 @%:@include <linux/if_bonding.h>
112 # Do we have PACKET_ORIGDEV (it can be present at runtime, put it in compat.h)
113 AC_CHECK_DECLS([PACKET_ORIGDEV],[],[],[[@%:@include <linux/if_packet.h>]])
115 # Check for ethtool stuff
116 lldp_CHECK_HEADER_ETHTOOL
118 ADVERTISED_2500baseX_Full, \
120 ADVERTISED_Asym_Pause, \
121 ADVERTISED_10000baseT_Full, \
123 ],[],[],[[@%:@include <linux/ethtool.h>]])
125 # Check for ETHERTYPE_VLAN, put it in compat.h if not defined
126 AC_CHECK_DECLS([ETHERTYPE_VLAN],[],[],[[@%:@include <net/ethernet.h>]])
128 # Check some stuff in linux/if_vlan.h
130 GET_VLAN_REALDEV_NAME_CMD, \
132 ],[],[],[[@%:@include <linux/if_vlan.h>]])
136 # Checks for typedefs, structures, and compiler characteristics.
147 lldp_CHECK___PROGNAME
149 # Checks for library functions.
168 ],,[AC_MSG_ERROR(Required function not found.)])
170 AC_REPLACE_FUNCS([strlcpy])
171 AC_REPLACE_FUNCS([getifaddrs])
175 ## Unit tests wich check
176 PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [have_check=yes], [have_check=no])
178 #######################
185 [Enable the use of SNMP @<:@default=no@:>@]
187 if test x"$with_snmp" = x"yes"; then
192 lldp_ARG_WITH([privsep-user], [Which user to use for privilege separation], [_lldpd])
193 lldp_ARG_WITH([privsep-group], [Which group to use for privilege separation], [_lldpd])
194 lldp_ARG_WITH([privsep-chroot], [Which directory to use to chroot lldpd], [/var/run/lldpd])
197 lldp_ARG_ENABLE([cdp], [Cisco Discovery Protocol], [yes])
198 lldp_ARG_ENABLE([fdp], [Foundry Discovery Protocol], [yes])
199 lldp_ARG_ENABLE([edp], [Extreme Discovery Protocol], [yes])
200 lldp_ARG_ENABLE([sonmp], [SynOptics Network Management Protocol], [yes])
203 lldp_ARG_ENABLE([lldpmed], [LLDP-MED extension], [yes])
204 lldp_ARG_ENABLE([dot1], [Dot1 extension (VLAN stuff)], [yes])
205 lldp_ARG_ENABLE([dot3], [Dot3 extension (PHY stuff)], [yes])
208 lldp_ARG_ENABLE([listenvlan], [listen on any VLAN], [no])
210 #######################
212 AM_CONDITIONAL([HAVE_CHECK], [test x"$have_check" = x"yes"])
213 AM_CONDITIONAL([USE_SNMP], [test x"$with_snmp" = x"yes"])
218 ------------------ Summary ------------------
219 $PACKAGE_NAME version $PACKAGE_VERSION
220 Prefix.........: $prefix
221 C Compiler.....: $CC $CFLAGS $CPPFLAGS
222 Linker.........: $LD $LDFLAGS $LIBS
224 SNMP support...: ${with_snmp-no}
225 CDP............: $enable_cdp
226 FDP............: $enable_fdp
227 EDP............: $enable_edp
228 SONMP..........: $enable_sonmp
229 LLDPMED........: $enable_lldpmed
230 DOT1...........: $enable_dot1
231 DOT3...........: $enable_dot3
232 Listen on VLAN.: $enable_listenvlan
233 ---------------------------------------------
235 Check the above options and compile with: