I have a very large codebase (read: thousands of modules) that has code shared across numerous projects that all run on different operating systems with different C++ compil
So far as I know cpp does not have a directive regarding the existence of a file.
You might be able to accomplish this with a bit of help from the Makefile, if you're using the same make across platforms. You can detect the presence of a file in the Makefile:
foo.o: foo.c
if [ -f header1.h ]; then CFLAGS+=-DHEADER1_INC
As @Greg Hewgill mentions, you can then make your #includes be conditional:
#ifdef HEADER1_INC
#include
#endif