Moved most compile-time logic to config script