Honor PRE_COMPILE_HOOK and POST_COMPILE_HOOK in environment