From 40819fd038fed55bf758a69aa5e84e37fdd93053 Mon Sep 17 00:00:00 2001 From: Juergen Borleis Date: Tue, 15 Oct 2019 15:05:29 +0200 Subject: [PATCH 1/3] lib.h: add forgotten declaration The compiler misses the structure in some source files. Signed-off-by: Juergen Borleis --- lib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib.h b/lib.h index 6cc58a2..b67cbcd 100644 --- a/lib.h +++ b/lib.h @@ -102,6 +102,7 @@ int hexstring2data(char *arg, unsigned char *data, int maxdlen); * */ +struct canfd_frame; int parse_canframe(char *cs, struct canfd_frame *cf); /* * Transfers a valid ASCII string describing a CAN frame into struct canfd_frame. From 3c88cfc1ec7a361b33977c447cd26139c9afdd95 Mon Sep 17 00:00:00 2001 From: Juergen Borleis Date: Thu, 17 Oct 2019 14:35:40 +0200 Subject: [PATCH 2/3] Buildsystem: don't define _GNU_SOURCE unconditionally The "AC_USE_SYSTEM_EXTENSIONS" macros tests it for us. Signed-off-by: Juergen Borleis --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f44a5e2..b10ab8a 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,9 @@ AC_CONFIG_AUX_DIR([config/autoconf]) AC_CANONICAL_BUILD AC_CANONICAL_HOST +# If possible, enable extensions to Posix +AC_USE_SYSTEM_EXTENSIONS + #AM_MAINTAINER_MODE CFLAGS="${CFLAGS} -Wall" @@ -91,7 +94,6 @@ AC_CHECK_DECL(N_SLCAN,, AC_CHECK_DECL(SCM_TIMESTAMPING_OPT_STATS,, [AC_DEFINE([SCM_TIMESTAMPING_OPT_STATS], [54], [SCM_TIMESTAMPING_OPT_STATS])] ) -AC_DEFINE(_GNU_SOURCE) # From 578f42aac8d7d191addf05234e0bbc9fd6cb23bb Mon Sep 17 00:00:00 2001 From: Juergen Borleis Date: Thu, 17 Oct 2019 13:45:14 +0200 Subject: [PATCH 3/3] Buildsystem: provide missing network/CAN related definitions on demand only Without the corresponding include file, these macros get always defined locally and thus, shadows the ones from the system. This change ensures, if the macros are found already defined in the system, then they are used. Signed-off-by: Juergen Borleis --- configure.ac | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index b10ab8a..c91d844 100644 --- a/configure.ac +++ b/configure.ac @@ -80,19 +80,24 @@ AC_CHECK_FUNCS([ \ AC_SEARCH_LIBS([clock_nanosleep], [rt]) AC_CHECK_DECL(SO_RXQ_OVFL,, - [AC_DEFINE([SO_RXQ_OVFL], [40], [SO_RXQ_OVFL])] + [AC_DEFINE([SO_RXQ_OVFL], [40], [SO_RXQ_OVFL])], + [[#include ]] ) AC_CHECK_DECL(PF_CAN,, - [AC_DEFINE([PF_CAN], [29], [PF_CAN])] + [AC_DEFINE([PF_CAN], [29], [PF_CAN])], + [[#include ]] ) AC_CHECK_DECL(AF_CAN,, - [AC_DEFINE([AF_CAN], [PF_CAN], [AF_CAN])] + [AC_DEFINE([AF_CAN], [PF_CAN], [AF_CAN])], + [[#include ]] ) AC_CHECK_DECL(N_SLCAN,, - [AC_DEFINE([N_SLCAN], [17], [N_SLCAN])] + [AC_DEFINE([N_SLCAN], [17], [N_SLCAN])], + [[#include ]] ) AC_CHECK_DECL(SCM_TIMESTAMPING_OPT_STATS,, - [AC_DEFINE([SCM_TIMESTAMPING_OPT_STATS], [54], [SCM_TIMESTAMPING_OPT_STATS])] + [AC_DEFINE([SCM_TIMESTAMPING_OPT_STATS], [54], [SCM_TIMESTAMPING_OPT_STATS])], + [[#include ]] )