An asymptotic theory is developed for the generation of boundary-layer instability waves due to the interaction of acoustic free-stream disturbances with wall waviness in the vicinity of the lower-branch neutral stability point. This leads to a very efficient mechanism for the generation of boundary-layer instability waves provided that the wavelength of the wall waviness is close to the instability wavelength. The analysis relies on an expansion of the nondimensional Navier-Stokes equations in two small parameters corresponding to wall waviness of small amplitude relative to the boundary layer thickness, and to small amplitude acoustic waves. The resulting equations are then examined in the limit as Reynolds number tends to infinity. The results will be applied to the case of large but finite Reynolds number. The analysis is developed for a general basic state with a nonzero pressure gradient, allowing for streamwise variations in the inviscid slip velocity at the outer edge of the boundary layer. The amplitude of the instability wave is obtained via a quasi-Green function approach, which is evaluated asymptotically by the method of steepest descents. Preliminary results are presented for the case of zero mean pressure gradient. In this case the instability wave amplitude decreases exponentially with detuning from the case of perfect resonance. This analysis should be helpful in our overall understanding of predicting the location where laminar flow will make its transition to turbulence on airfoils and other bodies of practical interest.