r2: build the extra definitions only once