More flexible generation of ffi_lib