I'm trying to figure out how to cross-compile GPSD 3.16 as external package in a buildroot environment. I'm already able to tell scons which compiler it should use and it produces correct compiled files.
scons target=arm-buildroot-linux-gnueabihf-gcc
file gpsd
gpsd: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 4.9.0, not stripped
So it is generally working but the build fails when scons try to link cgps against ncurses. Of course scons produces an error because it tries to link against the buildroot host ncurses library.
arm-buildroot-linux-gnueabihf-gcc -o cgps -pthread -Wl,-rpath,/buildroot/host/usr/lib -Wl,-rpath,/buildroot/host/lib cgps.o -L. -L/buildroot/host/usr/lib -lgps_static -lm -lrt -lncurses /buildroot/host/usr/lib/libncurses.so: file not recognized: File format not recognized
First I tried to use the command line options includedir and libdir which point to the target files but still scons uses only the host ncurses library. But it seems that scons is using the correct includedir when compiling other gpsd components.
arm-buildroot-linux-gnueabihf-gcc -o lcdgps.o -c -Wmissing-prototypes -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wreturn-type -pthread -Wmissing-declarations -O2 -pthread "-I/target/usr/local/include -I/target/usr/local/include/ncurses"
I also tried to use the pkgconfig command line option, but I get the same result.
So far I can't get scons to use the target ncurses library instead of the host ones. Using GPSD as an internal buildroot package is not possible in this project, so I'm looking for a solution based on the external GPSD package without having to change the construct file.