extract out a caffe2 macros library (#98156)
Slowly carving out the minimal caffe2 dependencies to build PyTorch.
Differential Revision: [D44609764](https://our.internmc.facebook.com/intern/diff/D44609764/)
**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D44609764/)!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98156
Approved by: https://github.com/ezyang, https://github.com/PaliC