[rtems commit] build: Add testopts.h to configure script

Sebastian Huber sebh at rtems.org
Mon Oct 5 10:00:57 UTC 2020


Module:    rtems
Branch:    master
Commit:    2c367617688edd17d41fc8d837d53d27838d9ef6
Changeset: http://git.rtems.org/rtems/commit/?id=2c367617688edd17d41fc8d837d53d27838d9ef6

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Oct  5 11:58:11 2020 +0200

build: Add testopts.h to configure script

Close #4120.

---

 cpukit/acinclude.m4 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 cpukit/configure.ac |  7 ++++++
 2 files changed, 70 insertions(+)

diff --git a/cpukit/acinclude.m4 b/cpukit/acinclude.m4
index f1889b6..54d1a39 100644
--- a/cpukit/acinclude.m4
+++ b/cpukit/acinclude.m4
@@ -60,3 +60,66 @@ AS_IF([test -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h],
     mv cpuopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
 ])
 ])
+
+# RTEMS_TESTOPT(NAME,CONDITION,VALUE,EXPLANATION)
+
+AC_DEFUN([_RTEMS_TESTOPT_INIT],[
+AC_BEFORE([_RTEMS_TESTOPT])
+cat >>testopts.tmp <<\_ACEOF
+/**
+ * @file rtems/testopts.h
+ */
+
+/* target test dependent options file */
+/* automatically generated -- DO NOT EDIT!! */
+#ifndef _RTEMS_TESTOPTS_H
+#define _RTEMS_TESTOPTS_H
+_ACEOF
+])
+
+AC_DEFUN([RTEMS_TESTOPT],[
+AC_REQUIRE([_RTEMS_TESTOPT_INIT])
+AC_BEFORE([_RTEMS_TESTOPT_FINI])
+  if $2; then
+cat >>testopts.tmp <<_ACEOF
+
+/* $4 */
+#define $1 $3
+_ACEOF
+## FIXME: Duplicate the define to the autoheader
+## Sanity check - Should be removed in future
+    AC_DEFINE_UNQUOTED([$1],[$3],[$4])
+  else
+cat >>testopts.tmp <<\_ACEOF
+
+/* $4 */
+/* #undef $1 */
+_ACEOF
+  fi
+])
+
+AC_DEFUN([_RTEMS_TESTOPT_FINI],[
+AC_REQUIRE([RTEMS_BUILD_TOP])
+cat >>testopts.tmp <<\_ACEOF
+
+#endif /* _RTEMS_TESTOPTS_H */
+_ACEOF
+
+AS_MKDIR_P(${RTEMS_BUILD_ROOT}/include/rtems)
+AS_IF([test -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h],
+[
+  AS_IF([cmp -s ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h testopts.tmp 2>/dev/null],
+  [
+    AC_MSG_NOTICE([${RTEMS_BUILD_ROOT}/include/rtems/testopts.h is unchanged])
+    rm -f testopts.tmp
+  ],[
+    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h])
+    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
+    mv testopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
+  ])
+],[
+    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h])
+    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
+    mv testopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
+])
+])
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 16213d9..9c25c37 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -258,6 +258,13 @@ RTEMS_CPUOPT([__RTEMS_REVISION__],
 
 _RTEMS_CPUOPT_FINI
 
+_RTEMS_TESTOPT_INIT
+RTEMS_TESTOPT([RTEMS_TEST_VERBOSITY],
+  [true],
+  [T_NORMAL],
+  [RTEMS Test Framework verbosity])
+_RTEMS_TESTOPT_FINI
+
 AC_ENABLE_MULTILIB([Makefile],[..])
 
 # libmisc/shell/* wants to assign file descriptors to stdio file descriptors.



More information about the vc mailing list