Australia and Japan have signed a raft of new agreements after talks between the leaders in Canberra shaped by wars raging across the globe.