Smectic ordering of homogeneous semiflexible polymers and rod–coil diblock copolymers