This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix socketmodule compile on NetBSD
Type: Stage:
Components: Build Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hyeshik.chang, nnorwitz, splitscreen
Priority: normal Keywords: patch

Created on 2006-07-21 13:25 by splitscreen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
comp.output splitscreen, 2006-07-24 23:28 Compilation messages
netbsd-bt.diff splitscreen, 2006-07-26 10:39 Patch
Messages (9)
msg50731 - (view) Author: Matt Fleming (splitscreen) Date: 2006-07-21 13:25
socketmodule tries to include bluetooth support is
bluetooth.h or bluetooth/bluetooth.h is found. However
NetBSD's bluetooth API (which is only available in the
-current development branch) is incompatible with,
afaik, any other.

This patch is taken from pkgsrc.

Matt
msg50732 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2006-07-21 15:43
Logged In: YES 
user_id=55188

The patch breaks the build on FreeBSD.
What does the second changeset in the patch do?
I think that it isn't necessary if you want to just disable
it in NetBSD.
msg50733 - (view) Author: Matt Fleming (splitscreen) Date: 2006-07-21 16:06
Logged In: YES 
user_id=1126061

Woa, my bad. That second changeset wasn't supposed to be
there. That'll teach me for not scrutinizing my patches more.

New version attached.

Matt
msg50734 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-07-23 18:22
Logged In: YES 
user_id=33168

Matt, the patch isn't maintainable.  For example what
happens when NetBSD does support bluetooth, how could both
situations be dealt with?

It would be much better to verify that the bluetooth
header(s) were usable at configure time.  If not, the
HAVE_BLUETOOTH* macros should not be defined.  This would
probably take a AC_TRY_COMPILE command in configure.in.  Do
you think you could try to work on a patch that does that?
msg50735 - (view) Author: Matt Fleming (splitscreen) Date: 2006-07-24 23:28
Logged In: YES 
user_id=1126061

I've spent quite a few hours today trying to write a patch
for this, but alas, this was my first look at autoconf, and
it won the battle. Perhaps someone with more autoconf
experience could take a look at this? 

I've attached the output from compiling Python. If anyone
needs me to run tests I'm more than happy to.

Matt
msg50736 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-07-25 03:28
Logged In: YES 
user_id=33168

Don't worry, autoconf always wins the first battle.  You
just gotta be more persistant than it. :-)

Seriously, autoconf can be a bitch.  The real trick is to
find out what about bluetooth is broken and build a little C
program that should work but doesn't.  That will be the key
to autoconf.

Here's a possible example that could get you going:

AC_MSG_CHECKING(for resizeterm)
AC_TRY_COMPILE([#include <curses.h>], void *x=resizeterm,
  AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have
the 'resizeterm' function.)
  AC_MSG_RESULT(yes),
  AC_MSG_RESULT(no)
)

That's taken from the current configure.in.  You would need
to adjust the names and the code as appropriate.

You will probably want to look at the resulting configure. 
That can help you find the names of vars.  For example, if
bluetooth is defined or not is something like
ac_cv_has_bluetooth_h and ac_cv_has_sys_bluetooth_h.  You
can find the actual values in configure.

Hope that's enough to get you going.  If not, feel free to
mail me about what you are trying and all the other details
and we can try to get this working.
msg50737 - (view) Author: Matt Fleming (splitscreen) Date: 2006-07-26 10:39
Logged In: YES 
user_id=1126061

Attaching patch. Turns out NetBSD does support all the
bluetooth stuff in Python. All bluetooth 'addresses' use a
single struct 'sockaddr_bt'.

Matt
msg50738 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-07-28 01:16
Logged In: YES 
user_id=33168

Yup, this looks good now.  Don't forget to add a note to
Misc/NEWS in the Extension Modules section.  If you aren't
already in Misc/ACKS, add yourself. :-)
msg50739 - (view) Author: Matt Fleming (splitscreen) Date: 2006-07-28 11:44
Logged In: YES 
user_id=1126061

Committed revision 50899.
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43705
2006-07-21 13:25:49splitscreencreate