On 20/10/2018 02:04, Chris Johns wrote:
On 19/10/18 5:47 pm, Sebastian Huber wrote:
----- Am 18. Okt 2018 um 19:56 schrieb Chris Johns chr...@rtems.org:

On 18/10/18 6:38 pm, Sebastian Huber wrote:
Use a test body with a proper RTEMS application configuration to avoid a
dependency on the default configuration.  Do not include
<rtems/score/cpuopts.h> directly since this header file is an
implementation detail.

Update #3551.
---
  rtems.py | 30 +++++++++++++++++-------------
  1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/rtems.py b/rtems.py
index 1b0da60..c7a1966 100644
--- a/rtems.py
+++ b/rtems.py
@@ -259,13 +259,18 @@ def configure(conf, bsp_configure = None):
          #
          # Checks for various RTEMS features.
          #
-        conf.multicheck({ 'header_name': 'rtems/score/cpuopts.h'},
-                        msg = 'Checking for RTEMS CPU options header',
-                        mandatory = True)
-        load_cpuopts(conf, ab, rtems_path)
OK.

-        conf.multicheck({ 'header_name': 'rtems.h'},
-                        msg = 'Checking for RTEMS header',
-                        mandatory = True)
Why remove the test? I see the app test below checks for the header however the
test creates a nice specific error message.
The test is not a simple compile test and dosen't only check that you can include 
<rtems.h>. In addition it checks that you can link a sample application 
successfully.
The test you have added is a good addition. I am asking, why not keep both
tests? It comes down to the error message and how user friendly it is. If
'rtems.h' is present we can assume it is an installed RTEMS. The second test can
check the quality of the install. I would like to avoid users needing to dig
into a config log to find an error and then try to understand it to figure out
they have a bad path on the command line.

Waf doesn't simply check that you can include a header file. In addition it tries to link an executable:

Checking for header rtems.h
==>
#include <rtems.h>

int main(int argc, char **argv) {
    (void)argc; (void)argv;
    return 0;
}

<==
[1/2] Compiling build/.conf_check_ff53a9f7519945ffcad9ed062861cb10/test.cpp

['/build/rtems/5/bin/powerpc-rtems5-g++', '-qrtems', '-B/build/rtems/5/powerpc-rtems5/lib/', '-B/build/rtems/5/powerpc-rtems5/qoriq_e500/lib/', '--specs', 'bsp_specs', '-mcpu=8540', '-mcpu=8540', '-meabi', '-meabi', '-msdata=sysv', '-msdata=sysv', '-fno-common', '-fno-common', '-mstrict-align', '-mstrict-align', '-mspe', '-mspe', '-mabi=spe', '-mabi=spe', '-mfloat-gprs=double', '-mfloat-gprs=double', '-ffunction-sections', '-ffunction-sections', '-fdata-sections', '-fdata-sections', '../test.cpp', '-c', '-o', '/scratch/git-rtems-libbsd/build/.conf_check_ff53a9f7519945ffcad9ed062861cb10/testbuild/test.cpp.1.o'] [2/2] Linking build/.conf_check_ff53a9f7519945ffcad9ed062861cb10/testbuild/testprog

['/build/rtems/5/bin/powerpc-rtems5-g++', '-qrtems', '-B/build/rtems/5/powerpc-rtems5/lib/', '-B/build/rtems/5/powerpc-rtems5/qoriq_e500/lib/', '--specs', 'bsp_specs', '-mcpu=8540', '-mcpu=8540', '-meabi', '-meabi', '-msdata=sysv', '-msdata=sysv', '-fno-common', '-fno-common', '-mstrict-align', '-mstrict-align', '-mspe', '-mspe', '-mabi=spe', '-mabi=spe', '-mfloat-gprs=double', '-mfloat-gprs=double', '-ffunction-sections', '-ffunction-sections', '-fdata-sections', '-fdata-sections', 'test.cpp.1.o', '-o', '/scratch/git-rtems-libbsd/build/.conf_check_ff53a9f7519945ffcad9ed062861cb10/testbuild/testprog', '-Wl,-Bstatic', '-Wl,-Bdynamic']

Using a simple main() requires the default configuration.


What is the error report with just the 'main' test you added and an invalid
RTEMS path?

When I remove the rtems.h from the BSP installation, then I get this:

Building a trivial RTEMS application          : no
The configuration failed
(complete log in /scratch/git-rtems-libbsd/build/config.log)

In config.log:

Building a trivial RTEMS application
==>
#include <rtems.h>
void Init(rtems_task_argument arg) { (void)arg; }
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER 1
#define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>

<==
[1/2] Compiling build/.conf_check_506c35a0aa2e9f571a9e7ed38df523b2/test.c

['/build/rtems/5/bin/powerpc-rtems5-gcc', '-qrtems', '-B/build/rtems/5/powerpc-rtems5/lib/', '-B/build/rtems/5/powerpc-rtems5/qoriq_e500/lib/', '--specs', 'bsp_specs', '-mcpu=8540', '-mcpu=8540', '-meabi', '-meabi', '-msdata=sysv', '-msdata=sysv', '-fno-common', '-fno-common', '-mstrict-align', '-mstrict-align', '-mspe', '-mspe', '-mabi=spe', '-mabi=spe', '-mfloat-gprs=double', '-mfloat-gprs=double', '-ffunction-sections', '-ffunction-sections', '-fdata-sections', '-fdata-sections', '../test.c', '-c', '-o', '/scratch/git-rtems-libbsd/build/.conf_check_506c35a0aa2e9f571a9e7ed38df523b2/testbuild/test.c.1.o']
err: ../test.c:1:10: fatal error: rtems.h: No such file or directory
 #include <rtems.h>
          ^~~~~~~~~
compilation terminated.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to