If the trans is from a Cherokee, then it's an AW4. If it's from a Grand Cherokee, it's a 42RE and I would RUN away from it! There is no direct swap (same size, etc) 4 speed auto to fit the Eagle.
The AW4 is 3.5" longer than the 998 or 727 (from a Grand Wagoneer '84 to '91) You need a 1" spacer/clocking ring to use the Eagle tcase and it will only work if the trans is '91 or newer. (23 spline. They are 21 spline before that) Somewhere around '96 they twisted the 23 spline outputs as well to make them quieter.
You will need a custom trans crossbar and driveshafts.
You will need the 4.0L flexplate and starter too. And add the TPS (throttle position sensor) and computer as well as the TVS cable.
I forget the name of the company that makes a manual controller for the AW4, but unless you swap in the EFI and harness from an XJ (with auto) the trans won't shift on it's own (neither would the 42RE)
The 4.0, 258 (4.2L) and 232 are the same bell pattern ('71 and newer), same balance (zero) and many things interchange externally.