aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2021-02-09 18:12:35 +0200
committerPetri Savolainen <petri.savolainen@nokia.com>2021-02-23 11:01:07 +0200
commitee9a6a9a9e46aac337b8b105ef5d2c7e754ce3c0 (patch)
treed53c0bea86128efcd2de64450563ded893c52b7e /helper
parente9aaa0c664582c137d17c764d9ef6f29c626a6fb (diff)
helper: create autoheader
Create autoheader_external for helper and move there the ODPH_* defines from odp autoheader_external. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'helper')
-rw-r--r--helper/Makefile.am1
-rw-r--r--helper/include/odp/helper/autoheader_external.h.in11
-rw-r--r--helper/include/odp/helper/odph_debug.h2
-rw-r--r--helper/m4/configure.m425
-rw-r--r--helper/test/debug.c2
5 files changed, 39 insertions, 2 deletions
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 <odp/autoheader_external.h>
+#include <odp/helper/autoheader_external.h>
#include <stdio.h>
#include <stdlib.h>
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 <odp/autoheader_external.h>
+#include <odp/helper/autoheader_external.h>
#include <odp_api.h>
#include <odp/helper/odph_api.h>