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.
37 # Checks for header files.
57 ],,AC_MSG_ERROR([Required header missing.]))
64 ],,AC_MSG_ERROR([Required header missing.]),[
65 @%:@include <arpa/inet.h>
66 @%:@include <linux/if.h>
70 # Check for sys/queue.h completeness, missing bits will be in compat.h
84 ],[],[],[[@%:@include <sys/queue.h>]])
86 # Do we have PACKET_ORIGDEV (it can be present at runtime, put it in compat.h)
87 AC_CHECK_DECLS([PACKET_ORIGDEV],[],[],[[@%:@include <linux/if_packet.h>]])
89 # Check for ethtool stuff
90 lldp_CHECK_HEADER_ETHTOOL
92 ADVERTISED_2500baseX_Full, \
94 ADVERTISED_Asym_Pause, \
95 ADVERTISED_10000baseT_Full, \
97 ],[],[],[[@%:@include <linux/ethtool.h>]])
99 # Check for ETHERTYPE_VLAN, put it in compat.h if not defined
100 AC_CHECK_DECLS([ETHERTYPE_VLAN],[],[],[[@%:@include <net/ethernet.h>]])
102 # Check some stuff in linux/if_vlan.h
104 GET_VLAN_REALDEV_NAME_CMD, \
106 ],[],[],[[@%:@include <linux/if_vlan.h>]])
108 # Checks for typedefs, structures, and compiler characteristics.
119 lldp_CHECK___PROGNAME
121 # Checks for library functions.
140 ],,[AC_MSG_ERROR(Required function not found.)])
142 AC_REPLACE_FUNCS([strlcpy])
143 AC_REPLACE_FUNCS([getifaddrs])
145 ## Unit tests wich check
146 PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [have_check=yes], [have_check=no])
148 #######################
155 [Enable the use of SNMP @<:@default=no@:>@]
157 if test x"$with_snmp" = x"yes"; then
162 lldp_ARG_WITH([privsep-user], [Which user to use for privilege separation], [_lldpd])
163 lldp_ARG_WITH([privsep-group], [Which group to use for privilege separation], [_lldpd])
164 lldp_ARG_WITH([privsep-chroot], [Which directory to use to chroot lldpd], [/var/run/lldpd])
167 lldp_ARG_ENABLE([cdp], [Cisco Discovery Protocol], [yes])
168 lldp_ARG_ENABLE([fdp], [Foundry Discovery Protocol], [yes])
169 lldp_ARG_ENABLE([edp], [Extreme Discovery Protocol], [yes])
170 lldp_ARG_ENABLE([sonmp], [SynOptics Network Management Protocol], [yes])
173 lldp_ARG_ENABLE([lldpmed], [LLDP-MED extension], [yes])
174 lldp_ARG_ENABLE([dot1], [Dot1 extension (VLAN stuff)], [yes])
175 lldp_ARG_ENABLE([dot3], [Dot3 extension (PHY stuff)], [yes])
178 lldp_ARG_ENABLE([listenvlan], [listen on any VLAN], [no])
180 #######################
182 AM_CONDITIONAL([HAVE_CHECK], [test x"$have_check" = x"yes"])
183 AM_CONDITIONAL([USE_SNMP], [test x"$with_snmp" = x"yes"])
188 ------------------ Summary ------------------
189 $PACKAGE_NAME version $PACKAGE_VERSION
190 Prefix.........: $prefix
191 C Compiler.....: $CC $CFLAGS $CPPFLAGS
192 Linker.........: $LD $LDFLAGS $LIBS
194 SNMP support...: ${with_snmp-no}
195 CDP............: $enable_cdp
196 FDP............: $enable_fdp
197 EDP............: $enable_edp
198 SONMP..........: $enable_sonmp
199 LLDPMED........: $enable_lldpmed
200 DOT1...........: $enable_dot1
201 DOT3...........: $enable_dot3
202 Listen on VLAN.: $enable_listenvlan
203 ---------------------------------------------
205 Check the above options and compile with: