In a large frying pan, heat the olive oil over medium heat and cook the onions, stirring, until soft, about 8 minutes. Add the eggplant and cook until the rounds start to soften and the skins begin to brown lightly, about 10 minutes. Add the garlic and stir. Add the tomatoes, salt, pepper, and allspice. Pour in the wine and season, if desired, with a pinch of sugar. Simmer the eggplants, covered, until they are soft but not too mushy, about 20 minutes. Set aside.