Custom compilation flag for an nginx module
mdounin at mdounin.ru
Wed Dec 3 18:42:15 UTC 2014
On Wed, Dec 03, 2014 at 11:28:28AM -0500, erankor2 wrote:
> Thank you Maxim, your suggestion will definitely work for me.
> Are you familiar with any simple "non-core" module that does it ? I will
> need to test for the existence of this function or the need to explicitly
> add librt, and update CORE_LIBS accordingly + define some preprocessor macro
> that I can later #ifdef on in my code.
The code as in feature tests in auto/unix is more or less the same
you'll need in your module config file, e.g.:
if [ $ngx_found != yes ]; then
ngx_feature="sched_yield() in librt"
if [ $ngx_found = yes ]; then
Replacing sched_yield() here with clock_gettime() as appropriate
should do the trick.
Note well that the whole configure system is in shell, so it's
easy to read and understand.
More information about the nginx