Preheat oven to 425F.
Cut ends off garlic bulbs, exposing the tops of the cloves. Place on a piece of foil then drizzle with EVOO, salt and pepper. Wrap garlic up in the foil and roast 45 minutes. Let cool then squish out the garlic cloves from the skins in a bowl and mash with fork. Cover with EVOO, about 1/3 to 1/2 cup.
Place a cooling rack on a baking sheet. Slice eggplant lengthwise into slices 1/2-inch thick. Paint each piece with some of the roasted garlic oil and season with salt and pepper. Place eggplant in oven and roast 15-20 minutes until golden and tender. Remove, let cool then cut into bite-sized pieces.
While eggplant roasts, bring a large pot of water to a boil. Add salt and cook pasta to al dente.
Place remaining oil with the roasted garlic in a large skillet over medium to medium-high heat. Add red chili peppers or flakes and onion, saut to tender, 5-6 minutes. Add wine or stock and stir. Add tomatoes and mash with potato masher. Season sauce with salt and pepper. Stir in eggplant and heat through. Add basil and wilt into sauce.
Drain pasta and toss with sauce. Adjust salt and pepper to taste and top with crumbled ricotta salata.