Slice the eggplant about 1/3" thick and sprinkle with a generous amount of salt. Let sit for 30 minutes.
Heat the oven to 500 degrees.
Blot the eggplant slices dry and cut them into dice. Toss with 1 T of the olive oil and place in a baking pan or on a baking sheet. Bake for 10-15 minutes, tossing every 5 minutes, until until just about soft and beginning to brown.
Heat 1 T oil in a large, heavy nonstick skillet over medium heat and add the onions. Cook, stirring, until tender, about 5 minutes. Add the garlic and stir for another minute, until the garlic begins to color and smell fragrant. Stir in the eggplant, tomatoes, sugar, thyme, salt, and pepper. Reduce the heat to low, cover, and cook, stirring from time to time, for 1 to 1 1/2 hours, until the mixture has cooked down to a thick, fragrant mixture. Taste and adjust seasonings.
Oil a 2 qt gratin dish and turn the oven down to 400 degrees.
Stir the basil, flour, eggs, and 1/2 c of the Parmesan into the eggplant mixture, then scrape into the gratin dish and top with the remaining Parmesan and the bread crumbs. Drizzle on the remaining 1 T oil. Bake 20-30 minutes, until the top browns and the mixture is bubbling.