The straight six has been around since the CJ days. When the YJ model came into existence they made some changes to the I-6 which made it a 4.2L carb engine. I believe the next changes weren't made until 97 when the TJ was put into production and that is when they reigned it into the 4.0L model you see in all TJ's. Unfortunately the I-6 bid it's good byes for the 3.8L V6 that is in the JK of today (however that motor does have plenty of power)
Now of course I'm not going thru all of the changes in the block/heads/etc... from the 258 thru the 4.2 and then to the 4.0, but you get the drift.