Spectral asymptotics for Sturm-Liouville equations