detect presence of threads support in sqlite3 port

Alexander Botero-Lowry alexbl at
Sat Sep 30 10:10:36 PDT 2006

> Le Lun 25 sep 06 à 11:21:11 +0200, Alexander Zhuravlev <zaa at>
>  écrivait :
>> So, how can I determine the fact that the port was compiled with such 
>> option, so I can rise an error in my port or compile it with bundled
>> sqlite 3.2 library?
>> Any help will be much appreciated.
This is the exact issue that sparked my interest in some kind of OPTIONS 
dependency/checking mechanism in ports. One of my ports (audio/xmms2) requires
that sqlite3 be built threadsafe, and there is no way to detect this at runtime
so it would be possible to end up with a nastly corrupted medialib because of

So the idea would be to store the OPTIONS choices file in the pkgdb as +OPTIONS
or something, and then to be able to say NEED_OPTIONS=sqlite3:THREADS or 
something like that.

> sqlite supports pkg-config, so you could try something based upon
> pkg-config --libs sqlite3 | grep '\${PTHREAD_LIBS}'
This might not always work since sqlite3's thread safety is if I remember 
correctly a test to see if threads are using their own contexts or using a
global one, and asserting if they try to use a global one. It doesn't 
really requite pthreads and that is probably just there as a convenience.


More information about the freebsd-ports mailing list