"The city was a thousand years a-building."
What does "a-building" (in building) modify in that sentence?
Abuilding is a predicative adjective meaning that something is in the process of being built. The Oxford English Dictionary describes it as being chiefly North American. It seems to be quite rare, with only seven records for it in the Corpus of Contemporary American English.
It is an old form of the present participle. 'He was a-running, she was a-courting, they were a-building a house, it was a-raining.
It means 'in the process of' doing something.
It is still used in some regional dialects in Britain e.g. in Norfolk. 'What are yew a-dewun on'? meaning 'What are you a-doing of'?, or simply 'What are you doing?'
I would dare to say that "a-building" is no adjective and "a-hunting no participle but an old gerund form with the rest of a preposition as prefix.
a) We went a+hunting. Compare German: Wir gingen zum Jagen (word-for-word translation: We went to the hunting.) So we may assume that in English "to hunting" was reduced to "a-hunting". These old forms of a- + gerund can be found in older literature.
Occasionally you find expressions such as "A storm was brewing". In this expression "brewing" has no active meaning but rather a reflexive meaning. One might give the idea by saying: "A storm was brewing itself". And such expressions were at first used with a preposition such as "in/on/at". Let us assume it was: A storm was in (the act of) brewing itself.
This is meant to give an understanding of such curious expressions as in the above sentence: "The city was a thousand years a-building."