Density-functional theory of the crystallization of hard polymeric chains