If you've held your stock long-term, use the fair market value on the date you gave it away.
This, from IRS Publication 526,
Property is capital gain property if you would have recognized long-term capital gain had you sold it at fair market value on the date of the contribution. Capital gain property includes capital assets held more than 1 year.
Amount of deduction—General rule.
When figuring your deduction for a contribution of capital gain property, you generally can use the fair market value of the property.