This paper presents a general framework for the design of linear controllers for linear systems subject to time-domain constraints. The design framework exploits sums-of-squares techniques to incorporate the time-domain constraints on closed-loop signals and leads to conditions in terms of linear matrix inequalities (LMIs). This control design framework offers, in addition to constraint satisfaction, also the possibility of including an optimization objective that can be used to minimize steady state (tracking) errors, to decrease the settling time, to reduce overshoot and so on. The effectiveness of the framework is shown via a numerical example