We characterize compact eight-manifolds M which arise as internal spaces in
N=1 flux compactifications of M-theory down to AdS3 using the theory of
foliations, for the case when the internal part of the supersymmetry generator
is everywhere non-chiral. We prove that specifying such a supersymmetric
background is equivalent with giving a codimension one foliation of M which
carries a leafwise G2 structure, such that the O'Neill-Gray tensors,
non-adapted part of the normal connection and torsion classes of the G2
structure are given in terms of the supergravity four-form field strength by
explicit formulas which we derive. We discuss the topology of such foliations,
showing that the C star algebra of the foliation is a noncommutative torus of
dimension given by the irrationality rank of a certain cohomology class
constructed from the four-form field strength, which must satisfy the Latour
obstruction. We also give a criterion in terms of this class for when such
foliations are fibrations over the circle. When the criterion is not satisfied,
each leaf of the foliation is dense in M.Comment: 63 pages, 2 figure