You should have online access to your unrealized gain/loss report for each position you own. On this report, you will see every purchase and reinvestment of dividends as single a line item. When you do a donation in kind, you specify which shares you want to donate. For example:
Donate XXXXX (ticker symbol) 300 shares purchased on 10 July 2013
My brokerage encouraged me to print this report and make a photocopy of the "Gifting of Securities" form that I send to my brokerage (which happens to be USAA, but it will be similar for Vanguard, Schwab, Fidelity, etc.) and give BOTH to my accountant when he does my taxes. He will then use the basis of those specific shares. I'll keep another copy in my files so that I don't try to donate the same set of shares twice (although the gain/loss report will be updated online to reflect my donation).
The alternatives are:
1. use the First In - First Out tax method and not specify which shares you donate. Problem here is accounting, ie I then have to go back and determine which shares actually left my account and calculate the basis.
2. use Average Cost method (most common for mutual funds). This is easy, but I can save more on capital gains tax by choosing specific shares that have increased most to harvest gains with each donation.
HOpefully helpful for the above question.