Spirits firm Allied Domecq has agreed to a takeover bid from smaller rival Pernod Ricard, subject to agreement from Allied shareholders.