After your one successful build of FPC, did you test it on some thing simple before tackling Lazarus ?
Never try to script something you cannot do by hand. Small steps, test if possible after each step.
You have a message about not being able to build FPC322 with FPC322, maybe that is the case ? Worth looking into.
Davo