add GEN_DIRNAME support