Slice the eggplants about 1/3" thick. Place the slices on a rack over a baking sheet. Sprinkle both sides with salt. Let the eggplant sweat for 30 minutes, then wipe off the liquid with paper towels.
Preheat oven to 425°F. Line two baking sheets with parchment paper. Brush the eggplant with 2 tbsp olive oil on both sides and lay them on the sheets.
Bake for 25 to 30 minutes until soft and caramelized. You may flip the eggplant halfway if you want, but it's not absolutely necessary.
While the eggplant is baking, heat the remaining 2 tbsp olive oil in a sauté pan or Dutch oven on medium high heat. Add onion and cook until it barely starts to brown.
Add garlic, oregano and red pepper flakes and cook another minute.
If using whole tomatoes, crush them by hand or with an immersion blender.
Add tomatoes to the pan, stir and cook, uncovered, for 15 to 20 minutes.
Once the eggplant is ready, transfer it to a cutting board and cut into bite size pieces. Add them to the sauce and keep warm.
Cook pasta according to package directions for al dente. Drain.
Serve the eggplant sauce over the pasta. Top with grated cheese and basil or parsley.