Some changes to allow compilation on MinGW on Windows
This MR adds the following:
- MinGW requires adding
share.h. Otherwise, it complains about
- We also check if we are using MinGW to not define
fprintf_s. Previously, it failed to compile.
- Pass CXXFLAGS to CPPFLAGS to allow the user to pass additional flags he or she may want.
- Pass ADDITIONAL_LDFLAGS to ALL_LDFLAGS. Similar to above, this allows the user to pass additional linker flags.