Small patch to fix building librtlsdr on OpenBSD

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/.

Brian Waters brian at brianmwaters.net
Sat Nov 9 17:18:00 UTC 2019


Based on some cursory googling, it's _not_ needed for FreeBSD, but I haven't tested. I'm not sure about the others.

A check for librt.so would be good; something like autoconf's AC_SEARCH_LIBS that actually searches libs for clock_get time() would be best. I don't know what CMake has to offer in that regard.

BWOn Nov 9, 2019 11:56 AM, Adrian Chadd <adrian at freebsd.org> wrote:
>
> is this applicable to the other BSDs too? 
>
> Ideally the rule would be "only link in rt if it's present", right? 
>
>
> -adrian 
>
> On Sat, 9 Nov 2019 at 03:08, Brian Waters <brian at brianmwaters.net> wrote: 
> > 
> > Looks like I mistakenly included the patch as an attachment, so it may not have gone through. Here it is: 
> > 
> > diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt 
> > index 07d64ab..015fd48 100644 
> > --- a/src/CMakeLists.txt 
> > +++ b/src/CMakeLists.txt 
> > @@ -125,7 +125,7 @@ if(UNIX) 
> >  target_link_libraries(rtl_fm m) 
> >  target_link_libraries(rtl_adsb m) 
> >  target_link_libraries(rtl_power m) 
> > -if(APPLE) 
> > +if(APPLE OR CMAKE_SYSTEM MATCHES "OpenBSD") 
> >      target_link_libraries(rtl_test m) 
> >  else() 
> >      target_link_libraries(rtl_test m rt) 
> > 
> > Thanks, 
> > BW 
> > 
> > -- 
> > Brian M. Waters 
> > brian at brianmwaters.net 
> > 
> > On Tue, Nov 5, 2019, at 5:05 PM, Brian Waters wrote: 
> > > Gets rid of librt, which doesn't exist on OpenBSD. The version of 
> > > librtlsdr in the OpenBSD ports tree is extremely old (~2013), so this 
> > > should help some users. 
> > > 
> > > Tested against tag 0.6.0, but it should apply just fine to HEAD. 
> > > 
> > > Thanks, 
> > > Brian Waters 
> > > 
> > > -- 
> > > Brian M. Waters 
> > > brian at brianmwaters.net 
> > > Attachments: 
> > > * openbsd.patch 


More information about the osmocom-sdr mailing list