Welcome! Log In Create A New Profile

Advanced

Custom compilation flag for an nginx module

December 03, 2014 10:47AM
Hi all,

Is it possible for an nginx module to define custom compilation switches that add external libs / preprocessor macros ? Is there some example of a module that does it ?
Specifically, what I'm trying to do is measure time accurately in my module for benchmarking purposes. Since I use Linux, I was planning to use clock_gettime(CLOCK_MONOTONIC) for that. This function is Linux-specific, and so I would like to make it optional at compilation time:
* if nginx is compile with --with-clock-gettime (or something like that) I will use clock_gettime and link against the required library (librt)
* otherwise, I will fall back to using gettimeofday or drop the feature altogether

Thanks,

Eran
Subject Author Posted

Custom compilation flag for an nginx module

erankor2 December 03, 2014 10:47AM

Re: Custom compilation flag for an nginx module

Maxim Dounin December 03, 2014 11:06AM

Re: Custom compilation flag for an nginx module

erankor2 December 03, 2014 11:28AM

Re: Custom compilation flag for an nginx module

Maxim Dounin December 03, 2014 01:44PM

Re: Custom compilation flag for an nginx module

erankor2 December 04, 2014 09:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 242
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready