[Python-bugs-list] [ python-Bugs-634444 ] Python does not build on OpenBSD

noreply@sourceforge.net noreply@sourceforge.net
Thu, 07 Nov 2002 07:12:57 -0800


Bugs item #634444, was opened at 2002-11-06 14:17
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=634444&group_id=5470

Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 7
Submitted By: Jon Ribbens (jribbens)
>Assigned to: Martin v. Löwis (loewis)
Summary: Python does not build on OpenBSD

Initial Comment:
The new makedev/major/minor feature in posixmodule.c 
breaks the build on OpenBSD.

These macros come from /usr/include/sys/types.h, and 
are conditional on:

#if !defined(_POSIX_SOURCE) && !defined
(_XOPEN_SOURCE)

When ./configure is testing to find makedev etc, neither 
of these macros is defined so it finds them in types.h. 
However when posixmodule.c is compiled, 
_XOPEN_SOURCE is defined, so makedev etc are not 
available and the link fails.


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

>Comment By: Jon Ribbens (jribbens)
Date: 2002-11-07 15:12

Message:
Logged In: YES 
user_id=76089

Groovy, works now (in that Python builds and works, although 
it doesn't have the posix.makedev/major/minor features, 
which do appear to be available on OpenBSD).

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-07 07:43

Message:
Logged In: YES 
user_id=21627

Ok, I have now changed configure to link the test program,
in configure 1.353, configure.in 1.364.

Can you please confirm that this solves the problem?

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

Comment By: Jon Ribbens (jribbens)
Date: 2002-11-06 23:32

Message:
Logged In: YES 
user_id=76089

I am using OpenBSD 2.7, but I think the very latest OpenBSD 
is just the same.

I have investigated a bit more and you are right that 
_XOPEN_SOURCE is defined during configure. I *think* the 
problem is that the configure test used to detect 
HAVE_DEVICE_MACROS is broken. It is just trying to 
compile, but not link, "makedev(major(0),minor(0))", and it is 
not an error to try and compile that line even if makedev, 
major and minor are not defined since the compiler assumes 
they are unknown functions returning int. It is only an error at 
link time, and the configure test does not try to link the test 
code.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-06 22:13

Message:
Logged In: YES 
user_id=21627

On what version of OpenBSD does that happen?

Also, can you find out why _XOPEN_SOURCE is not defined when
testing for makedev? configure ought to define it while
running the tests, and does that on my system. To be
certain, you can add a line

cp confdefs.h foo.h

immediately before the test for makedev is run.

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

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