  We study how the ferroelastic domain structure sets in in an epitaxial film
of a material with second order proper ferroelastic transition. The domain
structures considered are similar to either $a_{1}/a_{2}/a_{1}/a_{2}$ or
$c/a/c/a$ structures in perovskite ferroelectrics. If the "extrinsic" misfit
strain, not associated with the transition, does not break the symmetry of the
high-temperature phase, the phase transition in the film occurs at somewhat
lower temperature compared to the bulk. The loss of stability then occurs with
respect to a sinusoidal strain wave, which evolves into the domain structure
with practically the same geometry and approximately the same period. In the
presence of the symmetry-breaking component of the misfit strain ("extrinsic"
misfit) the character of the phase transition is qualitatively different. In
this case it is a {\em topological} transition between single-domain and
multi-domain states, which starts from a low density of the domain walls.
