There are possible solution customizing setup.ml/_tags/myocamlbuild.ml. Basically, what you need to do:- add your own detection code in setup.ml to be run at configure. Just run pkg-config and save cflags/libs in ev_cflags/ev_libs (it will go to setup.data- add a use_libev in _tags to the matching files/libraries in _tags- load ev_cflags/ev_libs and apply them to flag[use_libev;...] & ... in myocamlbuild.ml