2 # Process this file with autoconf to produce a configure script.
4 #######################
10 dnl Use something like this if you need to patch autoconf files and
11 dnl regenerate configure outside upstream git tree:
12 dnl AC_INIT([lldpd], [0.5.7], [bernat@luffy.cx])
14 [m4_esyscmd_s([git describe --tags --always 2> /dev/null || date +%F])],
17 AC_CONFIG_SRCDIR([src/log.c])
18 AC_CONFIG_HEADER([config.h])
19 AC_CONFIG_FILES([Makefile src/Makefile src/compat/Makefile src/daemon/Makefile
20 src/lib/Makefile src/lib/lldpctl.pc src/client/Makefile
22 AC_CONFIG_MACRO_DIR([m4])
25 AM_INIT_AUTOMAKE([foreign -Wall -Werror])
27 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
33 #######################
36 # Checks for programs.
54 DX_INIT_DOXYGEN([lldpd], [doxygen.cfg], [doxygen])
56 # Check some compiler flags
57 AX_CFLAGS_GCC_OPTION([-fdiagnostics-show-option])
58 AX_CFLAGS_GCC_OPTION([-pipe])
59 AX_CFLAGS_GCC_OPTION([-Wall])
60 AX_CFLAGS_GCC_OPTION([-W])
61 AX_CFLAGS_GCC_OPTION([-Wextra])
62 AX_CFLAGS_GCC_OPTION([-Wformat])
63 AX_CFLAGS_GCC_OPTION([-Wformat-security])
64 AX_CFLAGS_GCC_OPTION([-Wfatal-errors])
65 AX_CFLAGS_GCC_OPTION([-Wcast-align])
66 AX_CFLAGS_GCC_OPTION([-Winline])
67 AX_CFLAGS_GCC_OPTION([-fstack-protector])
68 AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2])
69 AX_CFLAGS_GCC_OPTION([-Wno-unused-parameter])
70 AX_CFLAGS_GCC_OPTION([-Wno-missing-field-initializers])
71 AX_CFLAGS_GCC_OPTION([-Wno-sign-compare]) dnl Should be fixed later
72 AX_LDFLAGS_OPTION([-Wl,-z,relro])
73 AX_LDFLAGS_OPTION([-Wl,-z,now])
80 # Checks for header files.
82 AC_CHECK_HEADERS([valgrind/valgrind.h])
86 # Checks for typedefs, structures, and compiler characteristics.
89 # Checks for library functions.
90 AC_CONFIG_LIBOBJ_DIR([src/compat])
93 AC_REPLACE_FUNCS([strlcpy])
94 AC_CHECK_FUNCS([setresuid setresgid])
97 ## Unit tests wich check
98 PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [have_check=yes], [have_check=no])
103 # readline (or something similar)
106 #######################
113 [Enable the use of SNMP @<:@default=no@:>@]
115 if test x"$with_snmp" = x"yes"; then
123 [Enable XML output via libxml2 @<:@default=no@:>@]
125 if test x"$with_xml" = x"yes"; then
133 [Enable JSON output via Jansson @<:@default=no@:>@]
135 if test x"$with_json" = x"yes"; then
140 lldp_ARG_WITH([privsep-user], [Which user to use for privilege separation], [_lldpd])
141 lldp_ARG_WITH([privsep-group], [Which group to use for privilege separation], [_lldpd])
142 lldp_ARG_WITH([privsep-chroot], [Which directory to use to chroot lldpd], [/var/run/lldpd])
145 lldp_ARG_ENABLE([cdp], [Cisco Discovery Protocol], [yes])
146 lldp_ARG_ENABLE([fdp], [Foundry Discovery Protocol], [yes])
147 lldp_ARG_ENABLE([edp], [Extreme Discovery Protocol], [yes])
148 lldp_ARG_ENABLE([sonmp], [SynOptics Network Management Protocol], [yes])
151 lldp_ARG_ENABLE([lldpmed], [LLDP-MED extension], [yes])
152 lldp_ARG_ENABLE([dot1], [Dot1 extension (VLAN stuff)], [yes])
153 lldp_ARG_ENABLE([dot3], [Dot3 extension (PHY stuff)], [yes])
156 lldp_ARG_ENABLE([oldies], [compatibility with Linux kernel older than 2.6.18], [no])
158 #######################
160 AM_CONDITIONAL([HAVE_CHECK], [test x"$have_check" = x"yes"])
161 AM_CONDITIONAL([USE_SNMP], [test x"$with_snmp" = x"yes"])
162 AM_CONDITIONAL([USE_XML], [test x"$with_xml" = x"yes"])
163 AM_CONDITIONAL([USE_JSON], [test x"$with_json" = x"yes"])
166 if test x"$LIBEVENT_LDFLAGS" = x; then
174 ------------------ Summary ------------------
175 $PACKAGE_NAME version $PACKAGE_VERSION
176 Prefix.........: $prefix
177 C Compiler.....: $CC $CFLAGS $CPPFLAGS
178 Linker.........: $LD $LDFLAGS $LIBS
179 Libevent.......: $libevent
181 SNMP support...: ${with_snmp-no}
182 CDP............: $enable_cdp
183 FDP............: $enable_fdp
184 EDP............: $enable_edp
185 SONMP..........: $enable_sonmp
186 LLDPMED........: $enable_lldpmed
187 DOT1...........: $enable_dot1
188 DOT3...........: $enable_dot3
189 XML output.....: ${with_xml-no}
190 JSON output....: ${with_json-no}
191 Oldies support.: $enable_oldies
192 ---------------------------------------------
194 Check the above options and compile with: