(a) Owners of adjoining lands owe to each other the lateral support of the soil of each to that of the other in its natural state. If they derive title from a common grantor, the lateral support shall include the weight of walls and other burdens that may be on it. If, at the time of the sale by such common grantor, there are buildings adjoining each other, the right shall extend to the lateral support which each adjacent wall gives to the other.
(b) On giving reasonable notice of his intention to the adjoining landowner, the owner of land has the right to make proper and needful excavations up to the boundary line for purposes of construction, provided that he uses ordinary care and takes reasonable precautions to sustain the land of the other.