  The Poisson bracket algebra corresponding to the second Hamiltonian structure
of a large class of generalized KdV and mKdV integrable hierarchies is
carefully analysed. These algebras are known to have conformal properties, and
their relation to $\cal W$-algebras has been previously investigated in some
particular cases. The class of equations that is considered includes
practically all the generalizations of the Drinfel'd-Sokolov hierarchies
constructed in the literature. In particular, it has been recently shown that
it includes matrix generalizations of the Gelfand-Dickey and the constrained KP
hierarchies. Therefore, our results provide a unified description of the
relation between the Hamiltonian structure of soliton equations and $\cal
W$-algebras, and it comprises almost all the results formerly obtained by other
authors. The main result of this paper is an explicit general equation showing
that the second Poisson bracket algebra is a deformation of the Dirac bracket
algebra corresponding to the $\cal W$-algebras obtained through Hamiltonian
reduction.
