  Suppression of superconductivity in favour of a striped phase, and its
coincidence with a structural transition from a low-temperature orthorhombic
(LTO) to a low-temperature tetragonal (LTT) phase, is a ubiquitous feature of
hole-doped lanthanum cuprates. We study the effect of anisotropic strain on
this transition using density-functional theory on both La$_2$CuO$_4$ and the
recently-synthesised surrogate La$_2$MgO$_4$ to decouple electronic and
structural effects. Strikingly, we find that compressive strain applied
diagonally to the in-plane metal-oxygen bonds dramatically stabilises the LTO
phase. Given the mutual exclusivity of 3D superconductivity and long-range
static stripe order, we thereby suggest a structural mechanism for
understanding experimentally-observed trends in the superconducting
$T_{\mathrm{c}}$ under uniaxial pressure, and suggest principles for tuning it.
