Is any solution to compile nginx or apache with external module (from source) using custom confirguration file?

For example
--with-custom-app=/usr/src/custom-stuff

Regards