[Patches] [ python-Patches-1526460 ] Fix socketmodule compile on NetBSD

SourceForge.net noreply at sourceforge.net
Tue Jul 25 05:28:34 CEST 2006


Patches item #1526460, was opened at 2006-07-21 06:25
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1526460&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Matt Fleming (splitscreen)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix socketmodule compile on NetBSD

Initial Comment:
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

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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2006-07-24 20:28

Message:
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.

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

Comment By: Matt Fleming (splitscreen)
Date: 2006-07-24 16:28

Message:
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

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2006-07-23 11:22

Message:
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?

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

Comment By: Matt Fleming (splitscreen)
Date: 2006-07-21 09:06

Message:
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

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

Comment By: Hye-Shik Chang (perky)
Date: 2006-07-21 08:43

Message:
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.

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

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


More information about the Patches mailing list