Skip to content

Building on Haiku (OS) #2

@victroniko

Description

@victroniko

Hello there!

I'm on a quest for building and making rtl-sdr work on Haiku, AFAIK no one had tried it before. After fiddling a bit I've built and ran it (more or less) succesfully with autotool, from the original OSMOCOM repos. Sadly it doesn't build at all with cmake.

This fork looks really interesting and I want to port this one to Haiku, instead of the original... but it also fails to build with cmake, with the exact same error:

...
[ 75%] Linking C executable rtl_test
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/11.2.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find -lrt
collect2: error: ld returned 1 exit status
src/CMakeFiles/rtl_test.dir/build.make:99: recipe for target 'src/rtl_test' failed

With autotool, the script checks if function clock_gettime is available and fails gracefully when it's not, which allows the build to continue. OTOH, cmake forces the -lrt flag always, and bails out when it finds librt (which provides clock_gettime) isn't available.

Thing is, in Haiku librt does not exist. clock_gettime equivalent functionality resides in libroot (/system/lib/libroot.so)

Is it possible to add a provision for checking the target platform, and if it's Haiku then use libroot instead of librt? Maybe it's trivial but I fear it's a bit out of my coding knowledge, as I looked and fiddled w/many files (ie. CMakeLists.txt) with no success.

Here's a pic of rtl_test running on Haiku, to demonstrate a working build:

rtlsdr_rtl-test

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions