I am working on a C library that has SWIG bindings to Python. In my autotools configuration, I check for the gettimeofday function. I have discovered that I can't compile the Python portion of my project because it conflicts with a file pyconfig.h
, which also defines HAVE_GETTIMEOFDAY.
This seems like a very general problem, I was surprised to see Python's config.h
conflicting with my own. In my project I keep config.h
private---i.e., not installed with make install
. My impression is that this is correct. I found at least one blog post where this opinion is shared.
Is it a bug that Python conflicts with my config.h
?
Edit: I solved it by adding
AC_DEFINE(Py_PYCONFIG_H,[],[Defined here to avoid conflicts with pyconfig.h])
to my configure.ac
. Question still stands, should config.h
be public in your project, or kept private, only available to implementation files during build?