Unable to find ucontext.h

I am trying to compile cppcheck version 2.5 (make cppcheck), and it bombs because it cannot find ucontext.h.
This software is in HaikuDepot (version 1.87), so I checked the package and source for it and it appears to have the same issue when compiling manually. Is the package supposed to contain information on how its compiled?
Any ideas on how I work around this?
I see we have ucontext.h here but I dont see it present on the installed system?

Any help would be appreciated!

It should be patched out.

Next time you should read the recipe in the HaikuPorts repo.

1 Like

Ah, I was expecting it to be in the HPKG file. Thanks for the heads up!

There is a treasure of patches around at haikuports, if I run into any build problems it’s the first place I look if someone else encountered the same thing :slight_smile:
Second place would be the source pages (mostly on github were available)
Third place at repology (some other OS’s can provide solutions also)
Then the web :slight_smile:


I was able to get cppcheck 2.5 up and running using 2 of the 3 patches linked. The 3rd one involved compileroptions.cmake which was too different for me to figure out.
With the two trying to build would bomb with " unrecognized command line option ‘-rdynamic’".

I commented it out in the makefil and it compiles and is running basic checks now (woohoo!).

###### Targets

cppcheck: $(LIBOBJ) $(CLIOBJ) $(EXTOBJ)

Question: I’ve read about this error and rdynamic but dont fully grasp it yet. What do we lose by commenting this out? Is there a better way to handle this situation (I assume so).

On Haiku, executables are always dynamic, position independent code (PIC). The -rdynamic option probably defines it as a shared object on some systems but I haven’t looked it up.