Re: How to disable EV_FORK_ENABLE when building lib?

2022-02-09 Thread Marc Lehmann
On Wed, Feb 09, 2022 at 09:55:11AM -0500, Olivier Langlois 
 wrote:
> Sorry for the silly question...

It's actually not an obvious question :)

> I usually find the answer to that type of questions by doing .configure
> --help or reading a build.txt file or something like that.

That's likely because confiure is meant to built the standard version of
libev, and disabling fork watchers would be unexpected - e.g. if we had
tests for that watcher for testsuite, it would fail to test.

However, you shoulöd be able to do what you want simply by specifyingt the
right CFLAGS, e.g.:

   ./configure CFLAGS=-DEV_FORK_ENABLE=0

I haven't tested this, and you would normally need to also #define this
every time you #include ev.h (although it might work without in the case
of disabling fork watchers, it will not work with anything that changes
the data structure layout).

Since the resulting libev library is incompatible with a normal libev, you
would have to be careful not to install it anywhere where other programs
might find it, though.

If your gial is simply to have a non-standard libev for your project, it
would normally be easier to embed libev, and have your own wrapper files. For
example, rxvt-unicode has two files, a header called ev_cpp.h, which looks
similar to this:

   #define ECB_NO_THREADS 1

   #define EV_COMPAT3 0
   #define EV_USE_SELECT 1
   #define EV_USE_EPOLL 1
   #define EV_USE_KQUEUE 1
   #define EV_USE_PORT 1

   #include "ev.h"

And you would include this file whenever you normally would use ev.h.
Additionally, there is a ev_cpp.C file, which looks like this:

   #include "ev_cpp.h"
   #include "ev.c"

And this is the file that gets compiled into your program.

-- 
The choice of a   Deliantra, the free code+content MORPG
  -==- _GNU_  http://www.deliantra.net
  ==-- _   generation
  ---==---(_)__  __   __  Marc Lehmann
  --==---/ / _ \/ // /\ \/ /  schm...@schmorp.de
  -=/_/_//_/\_,_/ /_/\_\

___
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/mailman/listinfo/libev


How to disable EV_FORK_ENABLE when building lib?

2022-02-09 Thread Olivier Langlois
Sorry for the silly question...
I usually find the answer to that type of questions by doing .configure
--help or reading a build.txt file or something like that.

I did not find the answer for libev...

thx!
Olivier

___
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/mailman/listinfo/libev