enable compilation as shared lib, when NOMAIN defined