Migrate to pkg-config -- much more robust
Move the global array code here as well