  Evidence for the onset of deconfinement in central Pb+Pb collisions was
reported by NA49 in fixed target measurements at beam momentum 30A GeV/c. This
observation motivated the NA61/SHINE program started in 2009 at the CERN SPS,
which, in particular, aims to study properties of the onset of deconfinement by
measurements of hadron production in proton-proton, proton-nucleus and
nucleus-nucleus collisions.
  This contribution presents spectra of charged pions produced in p+p
interactions and $^7$Be+$^9$Be collisions at 20A-158A GeV/c beam momentum. The
NA61/SHINE results are compared with the corresponding NA49 data from central
Pb+Pb collisions at the same beam momenta per nucleon.
