@@ -1130,14 +1130,15 @@ dnl -------------------------
1130
1130
dnl Check other header files.
1131
1131
dnl -------------------------
1132
1132
AC_CHECK_HEADERS ( [ stropts.h sys/ksym.h \
1133
- linux/version.h asm/types.h endian.h sys/endian.h] )
1133
+ linux/version.h asm/types.h sys/endian.h] )
1134
+
1135
+ AC_CHECK_HEADER ( [ endian.h] , [ ] , [
1136
+ AC_MSG_ERROR ( [ missing endian.h] )
1137
+ ] )
1134
1138
1135
1139
AC_CHECK_LIB ( [ atomic] , [ main] , [ LIBS="$LIBS -latomic"] , [ ] , [ ] )
1136
1140
1137
- ac_stdatomic_ok=false
1138
- AC_DEFINE ( [ FRR_AUTOCONF_ATOMIC] , [ 1] , [ did autoconf checks for atomic funcs] )
1139
1141
AC_CHECK_HEADER ( [ stdatomic.h] ,[
1140
-
1141
1142
AC_MSG_CHECKING ( [ whether _Atomic qualifier works] )
1142
1143
AC_LINK_IFELSE ( [ AC_LANG_SOURCE ( [ [
1143
1144
#include <stdatomic.h>
@@ -1151,52 +1152,7 @@ int main(int argc, char **argv) {
1151
1152
ac_stdatomic_ok=true
1152
1153
] , [
1153
1154
AC_MSG_RESULT ( [ no] )
1154
- ] )
1155
- ] )
1156
-
1157
- AS_IF ( [ $ac_stdatomic_ok] , [ true] , [
1158
- AC_MSG_CHECKING ( [ for __atomic_* builtins] )
1159
- AC_LINK_IFELSE ( [ AC_LANG_SOURCE ( [ [
1160
- int main(int argc, char **argv) {
1161
- volatile int i = 1;
1162
- __atomic_store_n (&i, 0, __ATOMIC_RELEASE);
1163
- return __atomic_load_n (&i, __ATOMIC_ACQUIRE);
1164
- }
1165
- ] ] ) ] , [
1166
- AC_DEFINE ( [ HAVE___ATOMIC] , [ 1] , [ found __atomic builtins] )
1167
- AC_MSG_RESULT ( [ yes] )
1168
- ] , [
1169
- AC_MSG_RESULT ( [ no] )
1170
-
1171
- dnl FreeBSD 9 has a broken stdatomic.h where _Atomic doesn't work
1172
- AC_MSG_CHECKING ( [ for __sync_* builtins] )
1173
- AC_LINK_IFELSE ( [ AC_LANG_SOURCE ( [ [
1174
- int main(int argc, char **argv) {
1175
- volatile int i = 1;
1176
- __sync_fetch_and_sub (&i, 1);
1177
- return __sync_val_compare_and_swap (&i, 0, 1);
1178
- }
1179
- ] ] ) ] , [
1180
- AC_DEFINE ( [ HAVE___SYNC] , [ 1] , [ found __sync builtins] )
1181
- AC_MSG_RESULT ( [ yes] )
1182
-
1183
- AC_MSG_CHECKING ( [ for __sync_swap builtin] )
1184
- AC_LINK_IFELSE ( [ AC_LANG_SOURCE ( [ [
1185
- int main(int argc, char **argv) {
1186
- volatile int i = 1;
1187
- return __sync_swap (&i, 2);
1188
- }
1189
- ] ] ) ] , [
1190
- AC_DEFINE ( [ HAVE___SYNC_SWAP] , 1 , [ found __sync_swap builtin] )
1191
- AC_MSG_RESULT ( [ yes] )
1192
- ] , [
1193
- AC_MSG_RESULT ( [ no] )
1194
- ] )
1195
-
1196
- ] , [
1197
- AC_MSG_RESULT ( [ no] )
1198
- AC_MSG_FAILURE ( [ stdatomic.h unavailable and $CC has neither __atomic nor __sync builtins] )
1199
- ] )
1155
+ AC_MSG_ERROR ( [ building FRR requires an ISO C11 compliant compiler with atomics support] )
1200
1156
] )
1201
1157
] )
1202
1158
@@ -1310,7 +1266,7 @@ FRR_INCLUDES
1310
1266
1311
1267
AC_CHECK_HEADERS ( [ netinet/in_var.h \
1312
1268
net/if_dl.h net/netopt.h \
1313
- inet/nd.h netinet/ip_icmp.h \
1269
+ netinet/ip_icmp.h \
1314
1270
sys/sysctl.h sys/sockio.h sys/conf.h] ,
1315
1271
[ ] , [ ] , [ FRR_INCLUDES] )
1316
1272
@@ -1348,9 +1304,6 @@ FRR_INCLUDES
1348
1304
# include <net/netopt.h>
1349
1305
#endif
1350
1306
#include <net/route.h>
1351
- #ifdef HAVE_INET_ND_H
1352
- # include <inet/nd.h>
1353
- #endif
1354
1307
#include <arpa/inet.h>
1355
1308
/* Required for IDRP */
1356
1309
#ifdef HAVE_NETINET_IP_ICMP_H
@@ -1387,14 +1340,12 @@ case "$host_os" in
1387
1340
AC_MSG_RESULT ( [ OpenBSD] )
1388
1341
1389
1342
AC_DEFINE ( [ OPEN_BSD] , [ 1] , [ OpenBSD] )
1390
- AC_DEFINE ( [ KAME] , [ 1] , [ KAME IPv6] )
1391
1343
AC_DEFINE ( [ BSD_V6_SYSCTL] , [ 1] , [ BSD v6 sysctl to turn on and off forwarding] )
1392
1344
;;
1393
1345
*)
1394
1346
AC_MSG_RESULT ( [ BSD] )
1395
1347
1396
1348
AC_DEFINE ( [ HAVE_NET_RT_IFLIST] , [ 1] , [ NET_RT_IFLIST] )
1397
- AC_DEFINE ( [ KAME] , [ 1] , [ KAME IPv6] )
1398
1349
AC_DEFINE ( [ BSD_V6_SYSCTL] , [ 1] , [ BSD v6 sysctl to turn on and off forwarding] )
1399
1350
;;
1400
1351
esac
@@ -1430,6 +1381,32 @@ AC_CHECK_FUNCS([ \
1430
1381
explicit_bzero \
1431
1382
] )
1432
1383
1384
+ dnl note the trailing _ in the following macros; this is neccessary since
1385
+ dnl otherwise autoheader *replaces* the #define with the block...
1386
+ dnl
1387
+ dnl yes this might include stddef.h 3 times but who cares
1388
+
1389
+ AH_VERBATIM ( HAVE_STRLCAT_ , [
1390
+ #ifndef HAVE_STRLCAT
1391
+ #include <stddef.h>
1392
+ size_t strlcat(char *__restrict dest,
1393
+ const char *__restrict src, size_t destsize);
1394
+ #endif
1395
+ ] )
1396
+ AH_VERBATIM ( HAVE_STRLCPY_ , [
1397
+ #ifndef HAVE_STRLCPY
1398
+ #include <stddef.h>
1399
+ size_t strlcpy(char *__restrict dest,
1400
+ const char *__restrict src, size_t destsize);
1401
+ #endif
1402
+ ] )
1403
+ AH_VERBATIM ( HAVE_EXPLICIT_BZERO_ , [
1404
+ #ifndef HAVE_EXPLICIT_BZERO
1405
+ #include <stddef.h>
1406
+ void explicit_bzero(void *buf, size_t len);
1407
+ #endif
1408
+ ] )
1409
+
1433
1410
AC_CHECK_MEMBERS ( [ struct mmsghdr.msg_hdr] , [ ] , [ ] , FRR_INCLUDES )
1434
1411
1435
1412
dnl ##########################################################################
@@ -2359,7 +2336,7 @@ dnl ---------------------------
2359
2336
dnl IRDP/pktinfo/icmphdr checks
2360
2337
dnl ---------------------------
2361
2338
2362
- AC_CHECK_TYPES ( [ struct in_pktinfo] , [
2339
+ AC_CHECK_TYPE ( [ struct in_pktinfo] , [
2363
2340
AC_CHECK_TYPES ( [ struct icmphdr] , [
2364
2341
IRDP=true
2365
2342
] , [
@@ -2474,9 +2451,7 @@ AC_CHECK_DECLS([be32enc, be32dec], [], [], [
2474
2451
#ifdef HAVE_SYS_ENDIAN_H
2475
2452
#include <sys/endian.h>
2476
2453
#endif
2477
- #ifdef HAVE_ENDIAN_H
2478
2454
#include <endian.h>
2479
- #endif
2480
2455
] )
2481
2456
2482
2457
dnl --------------------------------------
0 commit comments