I’m trying to build the git repo version of SDL on ghostBSD. I’ve tried using GCC 11, but I get this error:
[ 87%] Building C object CMakeFiles/SDL2-static.dir/src/core/linux/SDL_udev.c.o
/usr/home/mm/Desktop/SDL_port/lib/SDL/src/core/linux/SDL_udev.c:32:10: fatal error: linux/input.h: No such file or directory
32 | #include <linux/input.h>
| ^~~~~~~~~~~~~~~
linux/input.h: No such file or directory, it tries to find linux/input.h in the include directories and couldn’t find it.
This is because SDL/src/core/linux/SDL_udev.c is being told to be compiled (unsuccessfully) by cmake.
Since you’re using ghostbsd it shouldn’t try to compile a linux specific file (it should compile the freebsd file since ghostbsd is based of freebsd), so we’ll have to figure out why it cmake included it.
it’s included because HAVE_LIBUDEV_H is set to true. (A quick fix might be to comment this part out).
HAVE_LIBUDEV_H is set to true because it checked for libudev.h in the
include paths and found it.
Is there libudev.h in your include paths? libudev-devd seems to install libudev.h into the include path but doesn’t directly provide linux/input.h (it’s provided by its build dependency evdev-proto).
Though I don’t think SDL needs udev in freebsd / ghostbsd.