copy from crossfire/code/arch/trunk