apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.82k stars 1.17k forks source link

[BSD] include paths (/usr/local/include). #8579

Open cederom opened 1 year ago

cederom commented 1 year ago

Hello world :-)

I have tried to build the sim:nxwm example, but got this on FreeBSD:

./sim/posix/sim_x11framebuffer.c:29:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.

This file exist but in the /usr/local include prefix:

% ls -al /usr/local/include/X11/Xlib.h
-rw-r--r--  1 root  wheel  99811  1 gru 02:14 /usr/local/include/X11/Xlib.h

What would be the best way to add this path to global includes? :-)

xiaoxiang781216 commented 1 year ago

you can add the search to HOSTCFLAGS here: https://github.com/apache/nuttx/blob/master/arch/sim/src/Makefile#L142-L156 But it's strange that /usr/local/include/ isn't on your default toolchain search path.

cederom commented 1 year ago

Thank you @xiaoxiang781216 that should provide a quickfix :-)

Here on BSD we usually include .include <bsd.prog.mk> that holds all defaults.. but NuttX uses GNU make so this won't work.. unless I find elegant workaround to use both BSD and GNU make files :-P

cederom commented 1 year ago

Its alive! :-)

% gmake
LD:  nuttx
ld: warning: arch_setjmp_x86_64.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

% ./nuttx
nxwm_main: Initialize the NSH library
createTaskbar: Create CTaskbar instance
createTaskbar: Connect CTaskbar instance to the NX server
createTaskbar: Initialize CTaskbar instance
createStartWindow: Start the start window application
createNxTerm: Creating the NxTerm application
createNxTerm: Adding the NxTerm application to the start window
createHexCalculator: Creating the hex calculator application
createHexCalculator: Adding the hex calculator application to the start window
startWindowManager: Start the window manager
pkarashchenko commented 1 year ago

@cederom Congrats! Do we need any patch to NuttX or that is purely host system tuning?

cederom commented 1 year ago

Thanks @pkarashchenko :-)