Seismic analysis of complex masonry buildings