From ee9a6a9a9e46aac337b8b105ef5d2c7e754ce3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Tue, 9 Feb 2021 18:12:35 +0200 Subject: helper: create autoheader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create autoheader_external for helper and move there the ODPH_* defines from odp autoheader_external. Signed-off-by: Jere Leppänen Reviewed-by: Matias Elo --- helper/Makefile.am | 1 + helper/include/odp/helper/autoheader_external.h.in | 11 ++++++++++ helper/include/odp/helper/odph_debug.h | 2 +- helper/m4/configure.m4 | 25 ++++++++++++++++++++++ helper/test/debug.c | 2 +- 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 helper/include/odp/helper/autoheader_external.h.in (limited to 'helper') diff --git a/helper/Makefile.am b/helper/Makefile.am index 8c1c0ffc5..fc5090852 100644 --- a/helper/Makefile.am +++ b/helper/Makefile.am @@ -12,6 +12,7 @@ AM_LDFLAGS = -version-number '$(ODPHELPER_LIBSO_VERSION)' helperincludedir = $(includedir)/odp/helper/ helperinclude_HEADERS = \ + include/odp/helper/autoheader_external.h\ include/odp/helper/chksum.h\ include/odp/helper/odph_debug.h \ include/odp/helper/eth.h\ diff --git a/helper/include/odp/helper/autoheader_external.h.in b/helper/include/odp/helper/autoheader_external.h.in new file mode 100644 index 000000000..987b1027e --- /dev/null +++ b/helper/include/odp/helper/autoheader_external.h.in @@ -0,0 +1,11 @@ + +#ifndef ODPH_AUTOHEADER_EXTERNAL_H_ +#define ODPH_AUTOHEADER_EXTERNAL_H_ + +/* Define to 1 to include additional helper debug code */ +#undef ODPH_DEBUG + +/* Define to 1 to display helper debug information */ +#undef ODPH_DEBUG_PRINT + +#endif diff --git a/helper/include/odp/helper/odph_debug.h b/helper/include/odp/helper/odph_debug.h index 2fa89d8ab..39ce3f0d9 100644 --- a/helper/include/odp/helper/odph_debug.h +++ b/helper/include/odp/helper/odph_debug.h @@ -15,7 +15,7 @@ #ifndef ODPH_DEBUG_H_ #define ODPH_DEBUG_H_ -#include +#include #include #include diff --git a/helper/m4/configure.m4 b/helper/m4/configure.m4 index c25f8fe68..426dcd8ff 100644 --- a/helper/m4/configure.m4 +++ b/helper/m4/configure.m4 @@ -17,5 +17,30 @@ AC_ARG_ENABLE([helper-linux], [helper_linux=$enableval], [helper_linux=yes]) +########################################################################## +# Enable/disable ODPH_DEBUG +########################################################################## +AC_ARG_ENABLE([helper-debug], + [AS_HELP_STRING([--enable-helper-debug], + [helpers include additional debugging code [default=disabled]])], + [], [AS_IF([test "x$enable_debug" = "xfull"], [enable_helper_debug=yes], + [enable_helper_debug=no])]) +AS_IF([test "x$enable_helper_debug" != "xno"], [ODPH_DEBUG=1], [ODPH_DEBUG=0]) +AC_DEFINE_UNQUOTED([ODPH_DEBUG], [$ODPH_DEBUG], + [Define to 1 to include additional helper debug code]) + +########################################################################## +# Enable/disable ODPH_DEBUG_PRINT +########################################################################## +AC_ARG_ENABLE([helper-debug-print], + [AS_HELP_STRING([--enable-helper-debug-print], + [display helper debugging information [default=disabled]])], + [], [AS_IF([test "x$enable_debug" = "xfull"], [enable_helper_debug_print=yes], + [enable_helper_debug_print=no])]) +AS_IF([test "x$enable_helper_debug_print" != "xno"], [ODPH_DEBUG_PRINT=1], + [ODPH_DEBUG_PRINT=0]) +AC_DEFINE_UNQUOTED([ODPH_DEBUG_PRINT], [$ODPH_DEBUG_PRINT], + [Define to 1 to display helper debug information]) + AC_CONFIG_FILES([helper/libodphelper.pc helper/test/Makefile]) diff --git a/helper/test/debug.c b/helper/test/debug.c index 2431b0ecd..3b8a69d8b 100644 --- a/helper/test/debug.c +++ b/helper/test/debug.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include +#include #include #include -- cgit v1.2.3