Equation of state of polymer melts: General formulation of a microscopic integral equation theory