Defender:
R380 gearbox for manual
ZF4HP22 for automatic
LT230 Transfer Case with right side front axle output and the option for diff locking, depending on model.
P38A:
ZF4HP22 or 24 depending on model.
Borg Warner transfer case with left side front axle output. No diff lock, it has a viscous coupling instead.
As for the axles, there are a number of choices available, being Salisbury, Rover and P38 types. You are going to need to crawl under the vehicle to identify the type fitted and then look at this list to see what you have on your car.
https://www.landroverworkshop.com/axles ... /axlecodes
The long and short of it, though, is that the Range Rover P38 axles are the same as the Disco2 with the exception that the RR front is a left input and the D2 is right input. The pumpkins will interchange, but the body of the axles is obviously different due to the input handing sides.
There are also internal differences between the diesel box and the V8 ones due to engine characteristics, so you will need a Land Rover gearbox to mate to your Range Rover engine. The Landy box is also physically different to the Rangie one, the bellhousing is different and the output is different due to the shaft/mounting requirements for the LT230/Borg Warner transfer cases.
Just for the P38, there are (I think) 3 choices of torque converter, depending on engine choice and capacity, so another difference to contend with.
I would suggest that you get a LAND ROVER V8 gearbox and use your current transfer case. This will keep your shift lever the same and all the mountings etc will stay unmolested. If you have a P38 engine, it will bolt straight onto the box.
Your biggest challenge is going to be the electronics. I am a bit vague on this area, sorry, but you will need to remove the Td5 electronics from the car and then rewire it with the V8 ECU and ancillary wiring.
For that, I'd suggest you find a scrapped vehicle and remove the wiring harnesses and swap them over in totality, with the associated ECUs. Then, you are going to need to find someone with either a Hawkeye or Nanocom OBD reader to reprogramme the various boxes to the new installation vis-a-vis serial numbers and configuration.
The BCU (body ECU) in your car is right now coded for Td5 and the associated box, so it will need to be told that there are new bits fitted and it needs to talk to them.
An alternative would be Mega Squirt or similar aftermarket control for the engine and gearbox, but then you will lose some features of the vehicle that source from the current OEM fit. You could parallel a lot of them, but that is way over my head.
If you are going to all this trouble, remember the V8s have liner issues, so you will be well advised to top-hat liner the engine while it is out to prevent heartache down the line if it suddenly starts blowing into the cooling system, and requires removal and repair.
Good luck, mate! You have a serious challenge ahead of you. I'd love to tackle something like that, just for the experience.