The diagonal metric tensor whose components are functions of one spatial coordinate is considered. Einstein's field equations for a perfect-fluid source are reduced to quadratures once a generating function, equal to the product of two of the metric components, is chosen. The solutions are either static fluid cylinders or walls depending on whether or not one of the spatial coordinates is periodic. Cylinder and wall sources are generated and matched to the vacuum (LeviCivita) space-time. A match to a cylinder source is achieved for − 1 2 < σ < 1 2 , where σ is the mass per unit length in the Newtonian limit σ → 0, and a match to a wall source is possible for |σ| > 1 2 , this case being without a Newtonian limit; the positive (negative) values of σ correspond to a positive (negative) fluid density. The range of σ for which a source has previously been matched to the Levi-Civita metric is 0 ≤ σ < 1 2 for a cylinder source.