N = 1 geometries for M theory and type IIA strings with fluxes