]>
Commit | Line | Data |
---|---|---|
43c02e7b VB |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
d38eae28 VB |
4 | ####################### |
5 | ### Base configuration | |
6 | ||
7 | # Configure autoconf | |
f3609abd | 8 | AC_PREREQ([2.69]) |
4593c0dc | 9 | |
4593c0dc | 10 | AC_INIT([lldpd], |
a888bea6 | 11 | [m4_esyscmd_s([./get-version])], |
fae9dd45 | 12 | [https://github.com/lldpd/lldpd/issues], |
493b0d42 | 13 | [lldpd], |
9b50cef9 | 14 | [https://lldpd.github.io/]) |
4593c0dc | 15 | |
4b292b55 | 16 | AC_CONFIG_SRCDIR([src/log.c]) |
bc6cf978 | 17 | AC_CONFIG_HEADERS([config.h]) |
95493844 VB |
18 | AC_CONFIG_FILES([Makefile |
19 | src/Makefile | |
20 | src/compat/Makefile | |
21 | src/daemon/Makefile | |
22 | src/lib/Makefile | |
23 | src/client/Makefile | |
24 | tests/Makefile | |
25 | osx/Makefile]) | |
2acc1418 | 26 | AC_CONFIG_MACRO_DIR([m4]) |
fa71a00c | 27 | AC_SUBST([CONFIGURE_ARGS], [$ac_configure_args]) |
43c02e7b | 28 | |
d38eae28 | 29 | # Configure automake |
4a0791a4 | 30 | AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror tar-ustar]) |
33aa26d0 | 31 | AM_MAINTAINER_MODE |
44cd2bed | 32 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) |
d38eae28 | 33 | |
0339b9a2 VB |
34 | # Automake 1.12... |
35 | m4_pattern_allow([AM_PROG_AR]) | |
36 | AM_PROG_AR | |
37 | ||
d38eae28 | 38 | # Configure libtool |
d38eae28 | 39 | LT_INIT |
f571f2db | 40 | gl_LD_VERSION_SCRIPT |
d38eae28 VB |
41 | |
42 | ####################### | |
43 | ### Checks | |
44 | ||
43c02e7b VB |
45 | # Checks for programs. |
46 | AC_PROG_CC | |
f3609abd | 47 | AC_PROG_CC_C99 |
630cc035 VB |
48 | if test x"$ac_cv_prog_cc_c99" = x"no"; then |
49 | AC_MSG_FAILURE([*** C99 support is mandatory]) | |
50 | fi | |
e47df85e | 51 | AC_PROG_CPP |
d38eae28 | 52 | AM_PROG_CC_C_O |
206db033 | 53 | LT_INIT |
fe80711e | 54 | AC_PROG_LN_S |
7ba4a183 | 55 | AC_PROG_EGREP |
140e34f0 | 56 | AC_PROG_AWK |
e47df85e | 57 | AC_PROG_SED |
2acc1418 | 58 | |
9dee8dec VB |
59 | # Check for pkg-config |
60 | m4_ifndef([PKG_CHECK_MODULES], [ | |
61 | AC_MSG_ERROR([PKG_CHECK_MODULES not found. Please install pkg-config and re-run autogen.sh])]) | |
62 | ||
4b292b55 VB |
63 | # Doxygen |
64 | DX_HTML_FEATURE(ON) | |
65 | DX_DOT_FEATURE(OFF) | |
66 | DX_CHM_FEATURE(OFF) | |
67 | DX_CHI_FEATURE(OFF) | |
68 | DX_MAN_FEATURE(OFF) | |
69 | DX_RTF_FEATURE(OFF) | |
70 | DX_XML_FEATURE(OFF) | |
71 | DX_PDF_FEATURE(ON) | |
72 | DX_PS_FEATURE(OFF) | |
73 | DX_INIT_DOXYGEN([lldpd], [doxygen.cfg], [doxygen]) | |
74 | ||
45e89c8c | 75 | # Check some compiler flags |
f42b8214 | 76 | AX_CFLAGS_GCC_OPTION([-Wunknown-warning-option], [LLDP_CFLAGS]) |
8d92800b VB |
77 | AX_CFLAGS_GCC_OPTION([-fdiagnostics-show-option], [LLDP_CFLAGS]) |
78 | AX_CFLAGS_GCC_OPTION([-fdiagnostics-color=auto], [LLDP_CFLAGS]) | |
79 | AX_CFLAGS_GCC_OPTION([-pipe], [LLDP_CFLAGS]) | |
80 | AX_CFLAGS_GCC_OPTION([-Wall], [LLDP_CFLAGS]) | |
81 | AX_CFLAGS_GCC_OPTION([-W], [LLDP_CFLAGS]) | |
82 | AX_CFLAGS_GCC_OPTION([-Wextra], [LLDP_CFLAGS]) | |
83 | AX_CFLAGS_GCC_OPTION([-Wformat], [LLDP_CFLAGS]) | |
84 | AX_CFLAGS_GCC_OPTION([-Wformat-security], [LLDP_CFLAGS]) | |
d0058aa6 | 85 | AX_CFLAGS_GCC_OPTION([-Wimplicit-fallthrough], [LLDP_CFLAGS]) |
8d92800b | 86 | AX_CFLAGS_GCC_OPTION([-Wfatal-errors], [LLDP_CFLAGS]) |
09f0af1d ALG |
87 | AX_CFLAGS_GCC_OPTION([-Wheader-guard], [LLDP_CFLAGS]) |
88 | AX_CFLAGS_GCC_OPTION([-Wdocumentation], [LLDP_CFLAGS]) | |
8d92800b | 89 | AX_CFLAGS_GCC_OPTION([-Winline], [LLDP_CFLAGS]) |
dff59172 | 90 | AX_CFLAGS_GCC_OPTION([-Wpointer-arith], [LLDP_CFLAGS]) |
8d92800b | 91 | AX_CFLAGS_GCC_OPTION([-fno-omit-frame-pointer], [LLDP_CFLAGS]) |
9b68a67f | 92 | AX_CFLAGS_GCC_OPTION([-Wno-cast-align], [LLDP_CFLAGS]) dnl clang is bad at this |
8d92800b VB |
93 | AX_CFLAGS_GCC_OPTION([-Wno-unused-parameter], [LLDP_CFLAGS]) |
94 | AX_CFLAGS_GCC_OPTION([-Wno-missing-field-initializers], [LLDP_CFLAGS]) | |
95 | AX_CFLAGS_GCC_OPTION([-Wno-sign-compare], [LLDP_CFLAGS]) dnl Should be fixed later | |
96 | AX_LDFLAGS_OPTION([-Wl,-z,relro], [LLDP_LDFLAGS]) | |
97 | AX_LDFLAGS_OPTION([-Wl,-z,now], [LLDP_LDFLAGS]) | |
19a5c9b6 | 98 | |
bdc8f796 VB |
99 | AC_C_TYPEOF |
100 | ||
56663327 VB |
101 | # Hardening |
102 | AC_ARG_ENABLE([hardening], | |
103 | [AS_HELP_STRING([--enable-hardening], | |
d2a01934 | 104 | [Enable compiler and linker options to frustrate memory corruption exploits @<:@default=yes@:>@])], |
56663327 VB |
105 | [hardening="$enableval"], |
106 | [hardening="yes"]) | |
a8add742 VB |
107 | AC_ARG_ENABLE([pie], |
108 | [AS_HELP_STRING([--enable-pie], | |
109 | [Enable PIE (position independant executable) @<:@default=no@:>@])], | |
110 | [pie="$enableval"], | |
111 | [pie="no"]) | |
56663327 VB |
112 | |
113 | if test x"$hardening" != x"no"; then | |
114 | AX_CFLAGS_GCC_OPTION([-fstack-protector], [LLDP_CFLAGS]) | |
115 | AX_CFLAGS_GCC_OPTION([-fstack-protector-all], [LLDP_CFLAGS]) | |
116 | AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) | |
38625a92 | 117 | AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) |
adbb26bc | 118 | AX_CFLAGS_GCC_OPTION([-fstack-clash-protection], [LLDP_CFLAGS]) |
56663327 | 119 | AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2], [LLDP_CPPFLAGS]) |
a8add742 VB |
120 | fi |
121 | if test x"$pie" = x"yes"; then | |
56663327 | 122 | AX_CFLAGS_GCC_OPTION([-fPIE], [LLDP_CFLAGS]) |
f42b8214 VB |
123 | AX_LDFLAGS_OPTION([-fPIE -pie], [LLDP_BIN_LDFLAGS], |
124 | [AX_LDFLAGS_OPTION([-fPIE -Wl,-pie], [LLDP_BIN_LDFLAGS])]) | |
56663327 VB |
125 | fi |
126 | ||
33fd6231 VB |
127 | # Sanitizers |
128 | AC_ARG_ENABLE([sanitizers], | |
28d521e2 | 129 | AS_HELP_STRING([--enable-sanitizers], |
33fd6231 VB |
130 | [Enable code instrumentation with selected sanitizers @<:@default=no@:>@]), |
131 | [ | |
132 | case "$enableval" in | |
133 | no) sanitizers= ;; | |
2315d097 | 134 | yes) sanitizers="-fsanitize=address,undefined" ;; |
33fd6231 VB |
135 | *) sanitizers="-fsanitize=$enableval" ;; |
136 | esac | |
dc37bc8d VB |
137 | if test x"$sanitizers" != x; then |
138 | LLDP_CFLAGS="$LLDP_CFLAGS $sanitizers" | |
139 | LLDP_LDFLAGS="$LLDP_LDFLAGS $sanitizers" | |
140 | AC_DEFINE([HAVE_ADDRESS_SANITIZER], 1, [Define if have both address and leak sanitizer]) | |
2e472cca VB |
141 | elif test x"$hardening" != x"no"; then |
142 | AX_LDFLAGS_OPTION([-fsanitize=safe-stack], [LLDP_BIN_LDFLAGS]) | |
143 | if test x"$ax_cv_ld_check_flag__fsanitize_safe_stack" != x"no"; then | |
144 | AX_CFLAGS_GCC_OPTION([-fsanitize=safe-stack], [LLDP_CFLAGS]) | |
145 | fi | |
dc37bc8d | 146 | fi |
33fd6231 VB |
147 | ]) |
148 | ||
14d35a08 | 149 | #Fuzzer |
150 | AC_ARG_ENABLE([fuzzer], | |
151 | AS_HELP_STRING([--enable-fuzzer], | |
152 | [Enable fuzzing @<:@default=no@:>@]), | |
153 | [ | |
154 | case "$enableval" in | |
155 | no) fuzzer= ;; | |
156 | yes) fuzzer="-fsanitize=fuzzer" ;; | |
157 | *) fuzzer="$enableval" ;; | |
158 | esac | |
159 | if test x"$fuzzer" != x; then | |
160 | AC_SUBST([FUZZENGINE], ["$fuzzer"]) | |
161 | fi | |
162 | ]) | |
163 | ||
28d521e2 VB |
164 | # Code coverage |
165 | AC_ARG_ENABLE([gcov], | |
166 | AS_HELP_STRING([--enable-gcov], | |
167 | [Enable coverage instrumentation @<:@default=no@:>@]), | |
168 | [gcov="$enableval"], | |
169 | [gcov="no"]) | |
170 | if test x"$gcov" != x"no"; then | |
171 | LLDP_CFLAGS="$LLDP_CFLAGS --coverage" | |
172 | LLDP_LDFLAGS="$LLDP_LDFLAGS --coverage" | |
173 | fi | |
174 | ||
e12c2365 VB |
175 | # OS |
176 | lldp_CHECK_OS | |
3dc1eb8c | 177 | lldp_CFLAGS_OS |
24b8d79f | 178 | |
8e4b9031 VB |
179 | AC_CACHE_SAVE |
180 | ||
d38eae28 VB |
181 | # Checks for header files. |
182 | AC_HEADER_RESOLV | |
396cfdfe | 183 | AC_CHECK_HEADERS([valgrind/valgrind.h]) |
c3e340b6 | 184 | lldp_CHECK_STDINT |
43c02e7b | 185 | |
8e4b9031 VB |
186 | AC_CACHE_SAVE |
187 | ||
43c02e7b | 188 | # Checks for typedefs, structures, and compiler characteristics. |
6bb9c4e0 | 189 | lldp_CHECK___PROGNAME |
dd1d33cf | 190 | lldp_CHECK_ALIGNOF |
43c02e7b VB |
191 | |
192 | # Checks for library functions. | |
4b292b55 | 193 | AC_CONFIG_LIBOBJ_DIR([src/compat]) |
d38eae28 VB |
194 | AC_FUNC_MALLOC |
195 | AC_FUNC_REALLOC | |
45bf0bd0 | 196 | AC_FUNC_FORK |
47bbc5f3 VB |
197 | |
198 | # Some functions can be in libbsd | |
ff3dcc4a VB |
199 | AC_ARG_WITH([libbsd], |
200 | AS_HELP_STRING( | |
201 | [--with-libbsd], | |
202 | [Use libbsd @<:@default=auto@:>@]), | |
203 | [], | |
204 | [with_libbsd=auto]) | |
205 | if test x"$with_libbsd" != x"no"; then | |
206 | PKG_CHECK_MODULES([libbsd], [libbsd-overlay], [ | |
207 | _save_CFLAGS="$CFLAGS" | |
208 | _save_LIBS="$LIBS" | |
209 | CFLAGS="$CFLAGS $libbsd_CFLAGS" | |
210 | LIBS="$LIBS $libbsd_LIBS" | |
211 | AC_MSG_CHECKING([if libbsd can be linked correctly]) | |
206db033 | 212 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
ff3dcc4a VB |
213 | @%:@include <sys/time.h> |
214 | @%:@include <sys/types.h> | |
206db033 | 215 | ]], [[]])],[ |
ff3dcc4a VB |
216 | AC_MSG_RESULT(yes) |
217 | LLDP_CFLAGS="$LLDP_CFLAGS $libbsd_CFLAGS" | |
218 | LLDP_LDFLAGS="$LLDP_LDFLAGS $libbsd_LIBS" | |
219 | with_libbsd=yes | |
220 | ],[ | |
221 | AC_MSG_RESULT(no) | |
222 | CFLAGS="$_save_CFLAGS" | |
223 | LIBS="$_save_LIBS" | |
224 | if test x"$with_libbsd" = x"yes"; then | |
225 | AC_MSG_FAILURE([*** no libbsd support found]) | |
226 | fi | |
227 | with_libbsd=no | |
228 | ]) | |
229 | ], [ | |
230 | if test x"$with_libbsd" = x"yes"; then | |
231 | AC_MSG_FAILURE([*** no libbsd support found]) | |
232 | fi | |
233 | with_libbsd=no | |
234 | ]) | |
235 | fi | |
e01aeb55 | 236 | |
47bbc5f3 | 237 | # setproctitle may have an _init function |
1e0d651f VB |
238 | AC_REPLACE_FUNCS([setproctitle]) |
239 | AC_CHECK_FUNCS([setproctitle_init]) | |
554d650d VB |
240 | # Other functions |
241 | AC_REPLACE_FUNCS([strlcpy | |
242 | strnlen | |
243 | strndup | |
8a378b16 | 244 | strtonum |
af828c47 | 245 | getline |
554d650d VB |
246 | asprintf |
247 | vsyslog | |
248 | daemon]) | |
249 | # Optional functions | |
8dab5698 | 250 | AC_CHECK_FUNCS([setresuid setresgid]) |
e66b7f34 | 251 | |
d0a03372 VB |
252 | # Check for res_init. On OSX, res_init is a symbol in libsystem_info |
253 | # and a macro in resolv.h. We need to ensure we test with resolv.h. | |
254 | m4_pushdef([AC_LANG_CALL(C)], [ | |
255 | AC_LANG_PROGRAM([$1 | |
256 | @%:@include <resolv.h>], [return $2 ();])]) | |
257 | AC_SEARCH_LIBS([res_init], resolv bind, | |
258 | AC_DEFINE([HAVE_RES_INIT], 1, | |
259 | [Define to indicate that res_init() exists])) | |
260 | m4_popdef([AC_LANG_CALL(C)]) | |
e66b7f34 | 261 | |
8e4b9031 VB |
262 | AC_CACHE_SAVE |
263 | ||
d38eae28 | 264 | ## Unit tests wich check |
a8dd1894 | 265 | PKG_CHECK_MODULES([check], [check >= 0.9.4], [have_check=yes], [have_check=no]) |
43c02e7b | 266 | |
13181ede | 267 | # Third-party libraries |
c461e5da | 268 | lldp_CHECK_LIBEVENT |
3a7923cb | 269 | lldp_CHECK_LIBCAP |
e5c94652 | 270 | |
135ff0f7 VB |
271 | # Compatibility with pkg.m4 < 0.27 |
272 | m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], | |
273 | [AC_ARG_WITH([pkgconfigdir], | |
274 | [AS_HELP_STRING([--with-pkgconfigdir], | |
275 | [install directory for *.pc pkg-config file])], | |
276 | [],[with_pkgconfigdir='$(libdir)/pkgconfig']) | |
277 | AC_SUBST([pkgconfigdir], [${with_pkgconfigdir}])]) | |
278 | ||
d38eae28 VB |
279 | ####################### |
280 | ### Options | |
43c02e7b | 281 | |
35f6f4fb VB |
282 | # Readline |
283 | AC_ARG_WITH([readline], | |
284 | AS_HELP_STRING( | |
285 | [--with-readline], | |
fa9b12c5 | 286 | [Enable the use of readline-like library @<:@default=auto@:>@]), |
35f6f4fb | 287 | [], |
fa9b12c5 | 288 | [with_readline=auto]) |
35f6f4fb | 289 | if test x"$with_readline" != x"no"; then |
23509dc0 | 290 | AX_LIB_READLINE_LLDPD |
fa9b12c5 | 291 | if test x"$with_readline" != x"check" -a x"$with_readline" != x"auto"; then |
35f6f4fb VB |
292 | if test x"$ax_cv_lib_readline" = x"no"; then |
293 | AC_MSG_FAILURE([*** no readline support found]) | |
294 | fi | |
295 | fi | |
296 | else | |
297 | ax_cv_lib_readline="no" | |
298 | fi | |
299 | ||
d38eae28 VB |
300 | # SNMP |
301 | AC_ARG_WITH([snmp], | |
302 | AS_HELP_STRING( | |
303 | [--with-snmp], | |
fa9b12c5 VB |
304 | [Enable the use of SNMP @<:@default=no@:>@]), |
305 | [], | |
306 | [with_snmp=no]) | |
307 | lldp_CHECK_SNMP | |
315587ef | 308 | |
8beb9a73 | 309 | # XML |
1480ce74 | 310 | AC_ARG_WITH([xml], |
00e40dba | 311 | AS_HELP_STRING( |
1480ce74 | 312 | [--with-xml], |
dd8c9fe3 | 313 | [Enable XML output via libxml2 @<:@default=auto@:>@]), |
fa9b12c5 | 314 | [], |
dd8c9fe3 | 315 | [with_xml=auto]) |
fa9b12c5 | 316 | lldp_CHECK_XML2 |
1480ce74 | 317 | |
06987a24 | 318 | # JSON (built-in) |
20edc61c | 319 | lldp_ARG_ENABLE([json0], [use of pre-0.9.2 JSON/json-c format], [no]) |
8b7150e4 | 320 | |
00e40dba VB |
321 | # Seccomp |
322 | AC_ARG_WITH([seccomp], | |
323 | AS_HELP_STRING( | |
324 | [--with-seccomp], | |
5472ac18 | 325 | [Enable seccomp support (with libseccomp, experimental) @<:@default=no@:>@]), |
00e40dba VB |
326 | [], |
327 | [with_seccomp=no]) | |
328 | lldp_CHECK_SECCOMP | |
329 | ||
c3f85560 | 330 | # OS X launchd support |
4dfe31fd VB |
331 | lldp_ARG_WITH([launchddaemonsdir], [Directory for launchd configuration file (OSX)], |
332 | [/Library/LaunchDaemons]) | |
333 | AC_SUBST([launchddaemonsdir], [$with_launchddaemonsdir]) | |
334 | AM_CONDITIONAL(HAVE_LAUNCHDDAEMONSDIR, | |
335 | [test -n "$with_launchddaemonsdir" -a "x$with_launchddaemonsdir" != xno ]) | |
9d1524b7 VB |
336 | |
337 | # Systemd | |
338 | lldp_ARG_WITH([systemdsystemunitdir], [Directory for systemd service files], | |
29760896 | 339 | [$($PKG_CONFIG --variable=systemdsystemunitdir systemd 2> /dev/null)]) |
4dfe31fd VB |
340 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) |
341 | AM_CONDITIONAL(HAVE_SYSTEMDSYSTEMUNITDIR, | |
342 | [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) | |
c3f85560 | 343 | |
a9f77488 VB |
344 | # sysusers |
345 | lldp_ARG_WITH([sysusersdir], [Directory for sysusers files], | |
346 | [$($PKG_CONFIG --variable=sysusersdir systemd 2> /dev/null)]) | |
347 | AC_SUBST([sysusersdir], [$with_sysusersdir]) | |
348 | AM_CONDITIONAL(HAVE_SYSUSERSDIR, | |
349 | [test -n "$with_sysusersdir" -a "x$with_sysusersdir" != xno ]) | |
350 | ||
cd7ee899 VB |
351 | # AppArmor |
352 | lldp_ARG_WITH([apparmordir], [Directory for AppArmor profiles (Linux)], | |
353 | [no]) | |
354 | AC_SUBST([apparmordir], [$with_apparmordir]) | |
355 | AM_CONDITIONAL(HAVE_APPARMORDIR, | |
2b70dd95 | 356 | [test -n "$with_apparmordir" -a "x$with_apparmordir" != xno ]) |
cd7ee899 | 357 | |
bdfe4193 VB |
358 | # Systemtap/DTrace |
359 | lldp_SYSTEMTAP | |
360 | ||
d38eae28 | 361 | # Privsep settings |
71a7dbb3 | 362 | lldp_ARG_ENABLE([privsep], [Privilege separation], [yes]) |
d38eae28 VB |
363 | lldp_ARG_WITH([privsep-user], [Which user to use for privilege separation], [_lldpd]) |
364 | lldp_ARG_WITH([privsep-group], [Which group to use for privilege separation], [_lldpd]) | |
9a4ed64a VB |
365 | |
366 | # Directories | |
367 | dnl On autoconf 2.69 and before, runstatedir is not configurable, let be able to use it anyway | |
368 | if test "x$runstatedir" = x; then | |
369 | AC_SUBST([runstatedir], ['${localstatedir}/run']) | |
370 | fi | |
371 | lldp_ARG_WITH([privsep-chroot], [Which directory to use to chroot lldpd], [${runstatedir}/lldpd]) | |
3a3a3623 | 372 | lldp_ARG_WITH([lldpd-ctl-socket], [Path to socket for communication with lldpd], [${runstatedir}/lldpd.socket]) |
5133ce2f | 373 | lldp_ARG_WITH([lldpd-pid-file], [Path to lldpd PID file], [${runstatedir}/lldpd.pid]) |
89840df0 | 374 | |
568a0d73 | 375 | # Netlink |
48292d82 VB |
376 | lldp_ARG_WITH_UNQUOTED([netlink-max-receive-bufsize], [Netlink maximum receive buffer size], [1024*1024]) |
377 | lldp_ARG_WITH_UNQUOTED([netlink-receive-bufsize], [Netlink initial receive buffer size], [0]) | |
568a0d73 VB |
378 | lldp_ARG_WITH_UNQUOTED([netlink-send-bufsize], [Netlink send buffer size], [0]) |
379 | ||
d38eae28 VB |
380 | # CDP/FDP/EDP/SONMP |
381 | lldp_ARG_ENABLE([cdp], [Cisco Discovery Protocol], [yes]) | |
382 | lldp_ARG_ENABLE([fdp], [Foundry Discovery Protocol], [yes]) | |
383 | lldp_ARG_ENABLE([edp], [Extreme Discovery Protocol], [yes]) | |
384 | lldp_ARG_ENABLE([sonmp], [SynOptics Network Management Protocol], [yes]) | |
a1347cd8 | 385 | |
d38eae28 VB |
386 | # LLDPMED/Dot1/Dot3 |
387 | lldp_ARG_ENABLE([lldpmed], [LLDP-MED extension], [yes]) | |
388 | lldp_ARG_ENABLE([dot1], [Dot1 extension (VLAN stuff)], [yes]) | |
389 | lldp_ARG_ENABLE([dot3], [Dot3 extension (PHY stuff)], [yes]) | |
fb1b78bb | 390 | lldp_ARG_ENABLE([custom], [Custom TLV support], [yes]) |
a1347cd8 | 391 | |
184bd199 | 392 | # Oldies |
2472bfda | 393 | MIN_LINUX_KERNEL_VERSION=2.6.39 |
d9fdc886 | 394 | lldp_ARG_ENABLE([oldies], [compatibility with Linux kernel older than 2.6.39], [no]) |
2472bfda VB |
395 | if test x"$os" = x"Linux"; then |
396 | if test x"$enable_oldies" = x"no"; then | |
397 | AC_DEFINE_UNQUOTED(MIN_LINUX_KERNEL_VERSION, "[$MIN_LINUX_KERNEL_VERSION]", [Minimal Linux kernel version required]) | |
398 | else | |
399 | AC_DEFINE(MIN_LINUX_KERNEL_VERSION, "2.6.11", [Minimal kernel version required]) | |
400 | fi | |
401 | fi | |
184bd199 | 402 | |
57231d32 VB |
403 | AX_BUILD_DATE_EPOCH(BUILD_DATE, "%FT%TZ", [BUILD_DATE="(unknown)"]) |
404 | AC_DEFINE_UNQUOTED(BUILD_DATE, "[$BUILD_DATE]", [Build date and time]) | |
69d92462 OO |
405 | |
406 | dnl per reproducible-builds.org check SOURCE_DATE_EPOCH | |
407 | dnl | |
408 | if test -z "${SOURCE_DATE_EPOCH+set}" ; then | |
efa6a7a3 VB |
409 | AC_DEFINE_UNQUOTED(LLDP_CC, "[$CC $LLDP_CFLAGS $LLDP_CPPFLAGS $CFLAGS $CPPFLAGS]", [C compiler command]) |
410 | AC_DEFINE_UNQUOTED(LLDP_LD, "[$LD $LLDP_LDFLAGS $LLDP_BIN_LDFLAGS $LDFLAGS $LIBS]", [Linker compiler command]) | |
69d92462 OO |
411 | else |
412 | AC_DEFINE_UNQUOTED(LLDP_CC, "[C compiler command is not available for reproducible builds]", [C compiler command]) | |
413 | AC_DEFINE_UNQUOTED(LLDP_LD, "[Linker compiler command is not available for reproducible builds]", [Linker compiler command]) | |
414 | fi | |
efa6a7a3 | 415 | |
d38eae28 VB |
416 | ####################### |
417 | # Output results | |
8d92800b VB |
418 | AC_SUBST([LLDP_CFLAGS]) |
419 | AC_SUBST([LLDP_CPPFLAGS]) | |
420 | AC_SUBST([LLDP_LDFLAGS]) | |
f42b8214 | 421 | AC_SUBST([LLDP_BIN_LDFLAGS]) |
14d35a08 | 422 | AM_CONDITIONAL([BUILD_FUZZER], [test x"$fuzzer" != x]) |
d38eae28 VB |
423 | AM_CONDITIONAL([HAVE_CHECK], [test x"$have_check" = x"yes"]) |
424 | AM_CONDITIONAL([USE_SNMP], [test x"$with_snmp" = x"yes"]) | |
1480ce74 | 425 | AM_CONDITIONAL([USE_XML], [test x"$with_xml" = x"yes"]) |
00e40dba | 426 | AM_CONDITIONAL([USE_SECCOMP], [test x"$with_seccomp" = x"yes"]) |
e320a274 VB |
427 | dnl If old default of AR_FLAGS is otherwise being used (because of older automake), |
428 | dnl replace it with one without 'u' | |
429 | if test "x$AR_FLAGS" = "xcru" ; then | |
430 | AR_FLAGS="cr" | |
431 | fi | |
43c02e7b | 432 | AC_OUTPUT |
d38eae28 | 433 | |
4c1a8c61 | 434 | if test x"$LIBEVENT_EMBEDDED" = x; then |
e5c94652 VB |
435 | libevent=system |
436 | else | |
437 | libevent=embedded | |
438 | fi | |
439 | ||
d38eae28 VB |
440 | cat <<EOF |
441 | ||
442 | ------------------ Summary ------------------ | |
443 | $PACKAGE_NAME version $PACKAGE_VERSION | |
91e0280a | 444 | OS.............: $os |
d38eae28 | 445 | Prefix.........: $prefix |
8d92800b | 446 | C Compiler.....: $CC $LLDP_CFLAGS $LLDP_CPPFLAGS $CFLAGS $CPPFLAGS |
f42b8214 | 447 | Linker.........: $LD $LLDP_LDFLAGS $LLDP_BIN_LDFLAGS $LDFLAGS $LIBS |
e5c94652 | 448 | Libevent.......: $libevent |
35f6f4fb | 449 | Readline.......: ${ax_cv_lib_readline} |
457d06aa | 450 | |
d38eae28 VB |
451 | Optional features: |
452 | SNMP support...: ${with_snmp-no} | |
453 | CDP............: $enable_cdp | |
454 | FDP............: $enable_fdp | |
455 | EDP............: $enable_edp | |
456 | SONMP..........: $enable_sonmp | |
457 | LLDPMED........: $enable_lldpmed | |
458 | DOT1...........: $enable_dot1 | |
459 | DOT3...........: $enable_dot3 | |
fb1b78bb | 460 | CUSTOM.........: $enable_custom |
1480ce74 | 461 | XML output.....: ${with_xml-no} |
184bd199 | 462 | Oldies support.: $enable_oldies |
00e40dba | 463 | seccomp........: ${with_seccomp-no} |
ff3dcc4a | 464 | libbsd.........: ${with_libbsd-no} |
457d06aa | 465 | |
71a7dbb3 VB |
466 | Privilege separation: |
467 | Enabled........: $enable_privsep | |
08841844 VB |
468 | User/group.....: ${with_privsep_user}/${with_privsep_group} |
469 | Chroot.........: ${with_privsep_chroot} | |
4262ca0c VB |
470 | |
471 | Instrumentation (for devs only): | |
472 | Sanitizers.....: ${sanitizers:-none} | |
473 | Coverage.......: ${gcov} | |
457d06aa VB |
474 | ------------- Compiler version -------------- |
475 | $($CC --version || true) | |
476 | -------------- Linker version --------------- | |
477 | $($LD --version || true) | |
d38eae28 VB |
478 | --------------------------------------------- |
479 | ||
480 | Check the above options and compile with: | |
481 | ${MAKE-make} | |
482 | ||
483 | EOF |