diff --git a/configure.ac b/configure.ac index 492da2c..9a807ec 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,23 @@ else fi +# +# Error logging +# +AC_MSG_CHECKING([whether to enable error logging]) +AC_ARG_ENABLE(error-log, + AS_HELP_STRING([--enable-error-log], [enable error log @<:@default=yes@:>@]), + [case "$enableval" in + y | yes) CONFIG_ERROR_LOG=yes ;; + *) CONFIG_ERROR_LOG=no ;; + esac], + [CONFIG_ERROR_LOG=yes]) +AC_MSG_RESULT([${CONFIG_ERROR_LOG}]) +if test "${CONFIG_ERROR_LOG}" = "no"; then + AC_DEFINE(DISABLE_ERROR_LOG, 1, [disable error logging]) +fi + + AC_CONFIG_FILES([ GNUmakefile config/libsocketcan.pc diff --git a/src/libsocketcan.c b/src/libsocketcan.c index 5c7665c..c802849 100644 --- a/src/libsocketcan.c +++ b/src/libsocketcan.c @@ -22,6 +22,10 @@ * @brief library code */ +#ifdef HAVE_CONFIG_H +#include "libsocketcan_config.h" +#endif + #include #include #include