Allow variants to define an initVariant() function that is called at startup.

See #2080
initVariant() is now declared as external "C" function.

See #2080 for more details.
Merge pull request #2139 from cmaglie/init-variant

Allow variants to define an initVariant() function that is called at startup