[Python-bugs-list] [ python-Bugs-771479 ] pyconfig.h duplicates common defines

SourceForge.net noreply@sourceforge.net
Tue, 15 Jul 2003 14:26:48 -0700


Bugs item #771479, was opened at 2003-07-15 09:23
Message generated for change (Comment added) made by michielu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=771479&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Michiel Uitdehaag (michielu)
Assigned to: Nobody/Anonymous (nobody)
Summary: pyconfig.h duplicates common defines

Initial Comment:
When combining the Python library with other packages,
or with your own 'configure'-d package, warnings like:
/home/michielu/pybuild/config.h:402: warning:
`PACKAGE_VERSION' redefined
/usr/include/python2.3/pyconfig.h:663: warning: this is
the location of the previous definition

The same goes for stuff like PACKAGE_STRING,
PACKAGE_TARNAME and PACKAGE_NAME.

It is likely that more defines like HAVE_FORK, etc, can
be duplicated.

Such configuration values should not be installed
'as-is' from the ./configure output. Instead, it is
suggested the installation preprocesses a header
configuration file and uses and installs that.


----------------------------------------------------------------------

>Comment By: Michiel Uitdehaag (michielu)
Date: 2003-07-15 21:26

Message:
Logged In: YES 
user_id=35033

I checked the CVS version through the CVS browser. The
PACKAGE_ macro's are still there, but only the pyconfig.h.in
is available obviously and it features an #undef there. The
configure will likely convert that to a #define.

Anyway, the _real_ problem is not the PACKAGE_ macro's,
which happen to be identical between the Python and the
ImageMagick applications (where I submitted a similar bug
report). The _real_ problem is that the defines used in
pyconfig.h are very general, like HAVE_TERM or HAVE_THREAD.
It is likely that a package will define those macro's
itself, especially if it is a 'configure'-d package.

These macro's need to be prepended with PY_ for example.
Because most of these macro's are not needed for the include
files (if any at all ofcourse, in which case the entire file
need not be installed), I suggest that only the macro's
needed for install are duplicated in a separate file,
prefixed with PY_ and have the source code check for both
versions of the macro.

Or, alternatively, preprocess the pyconfig.h after creation
and before building (the root Makefile seems a logical
place) and convert it to a new pyconfig.h with the proper
PY_ prefix. And use these macro's exclusively in the python
code.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-07-15 18:54

Message:
Logged In: YES 
user_id=33168

Michiel can you try the version in CVS?  I believe many of
the PACKAGE_* macros have been removed.  I don't know if
this is a problem any longer.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=771479&group_id=5470