Cut the tomatoes into small cubes and place them in a pan with olive oil and garlic. Let them soften for about 20 minutes with basil, salt, pepper, and half a teaspoon of sugar.
Remove from heat and pass through a food mill. Return the tomato sauce to the heat and reduce until it reaches the right consistency.
Cut the eggplants into medium-sized cubes. Deep fry the eggplant pieces until golden brown. Drain well on paper towels to remove excess oil.
Cook the pasta until al dente and toss with the tomato sauce.
Serve the pasta and top each portion with the fried eggplant and freshly grated ricotta salata.