[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-10 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

I tested Michael test in msg115868 on my AIX system (AIX 6.1 with flock 
correctly present in libbsd) with py3k and it works fine:

checking for flock declaration... yes
checking for flock... no
checking for flock in -lbsd... yes

[103/344] test_fcntl
= OK

I attach it as a patch against py3k.

--
Added file: 
http://bugs.python.org/file18830/patch_Michael_Haubenwallner_flock_msg115868.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-10 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Ok, thank you. The improvement has been committed in all three branches (3.2, 
3.1, 2.7).

--
stage:  - committed/rejected
status: open - closed
versions:  -Python 2.6, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-08 Thread Michael Haubenwallner

Michael Haubenwallner michael.haubenwall...@salomon.at added the comment:

Sébastien, while this gives expected results on the AIX box here, it still has 
one subtle problem:
AC_TRY_LINK may fail due to missing declaration in sys/file.h _or_ due to 
missing implementation in libc.
The subsequent AC_CHECK_LIB won't fail when the implementation is in libbsd but 
the declaration is missing - this is the case on not-so-recent AIX5.3 (and the 
reason python worked there before).

Another minor nit is configure's output when libbsd is needed:
 checking for flock... checking for flock in -lbsd... yes
 yes

Anyway - I've hacked up another variant (with recent autoconf manual at hand), 
which really should cover all known situations now (additionally using 
cache-checks):

AC_CACHE_CHECK([for flock declaration], [ac_cv_flock_decl],
  [AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
  [#include sys/file.h],
  [void* p = flock]
)],
[ac_cv_flock_decl=yes],
[ac_cv_flock_decl=no]
  )
])
if test x${ac_cv_flock_decl} = xyes; then
  AC_CHECK_FUNCS(flock,,
AC_CHECK_LIB(bsd,flock,
  [AC_DEFINE(HAVE_FLOCK)
   AC_DEFINE(FLOCK_NEEDS_LIBBSD, 1, Define if flock needs to be linked with 
bsd library.)
])
  )
fi

Thank you anyway!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-08 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

Thanks Michael, your new test looks fine to me.

I wanted to test it on my AIX system with branch py3k but I had some other 
issues (issue 9799), but I will test it tomorrow.

--
versions: +Python 2.6, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-07 Thread Michael Haubenwallner

Michael Haubenwallner michael.haubenwall...@salomon.at added the comment:

While I do agree this being an AIX bug, it is not a blocker here:
fcntl extension does not _depend_ on flock, it just does _prefer_ flock:
If not available, fcntl extension uses something else (fcntl IIRC), as it did 
(even without linking libbsd) before the AIX5.3-patch, which just added flock 
to the headers (the implementation in libbsd already has been there before the 
patch).
The problem after that AIX5.3-patch was that the compile-check found flock, and 
then fcntl extension failed to link due to missing libbsd.
So it's just for how to detect flock, where the most safe variant is both the 
compile- and link-check. When one of them fails, flock should not be flagged as 
available and the alternative gets used.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-07 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

Here is a new test for flock. HAVE_FLOCK is defined if we can link a C 
application calling flock, or if flock is defined in libbsd.
FLOCK_NEEDS_LIBBSD is also defined in the second case.

AC_MSG_CHECKING(for flock)
have_flock=no
AC_TRY_LINK([
#include confdefs.h 
#include sys/file.h
], [void* p = flock; flock(0, 0)],
  [AC_CHECK_LIB(bsd,flock, [
AC_DEFINE(FLOCK_NEEDS_LIBBSD, 1, Define if flock needs to be linked with 
bsd library.)
have_flock=yes
])],
  [have_flock=yes]
)
if test $have_flock = yes ; then
  AC_DEFINE(HAVE_FLOCK, 1, Define if you have the 'flock' function.)
fi
AC_MSG_RESULT($have_flock)

I think that this new test would also cover your case with a broken AIX libbsd? 
[I haven't actually tried to compile it yet, if the behavior is OK I will test 
it in both autoconf formats and provide some new patches tomorrow]

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-07 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I've just merged Sébastien's patches in r84584 (3.x), r84585 (2.7) and r84586 
(3.1). If you'd like to improve the fixes (as per your latest message), please 
say so, otherwise I'll close the issue.

(and thanks for your contributions!)

--
resolution:  - fixed
status: open - pending
versions:  -Python 2.6, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-07 Thread Michael Haubenwallner

Michael Haubenwallner michael.haubenwall...@salomon.at added the comment:

Sorry to be pedantic - but it looks like (don't have a build environment at 
hand at the moment) it will fail to build as 64bit on the not-so-up-to-date AIX 
with missing 64bit flock implementation:
There, the compile-check will succeed and define HAVE_FLOCK, but the link-check 
will fail - which really should reset have_flock to 'no'.
IMO, HAVE_FLOCK should be defined when _both_ checks succeed only, not upon the 
compile-check only as it is done now.
Thank you!

--
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-07 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Sorry to be pedantic - but it looks like (don't have a build
 environment at hand at the moment) it will fail to build as 64bit on
 the not-so-up-to-date AIX with missing 64bit flock implementation:
 There, the compile-check will succeed and define HAVE_FLOCK, but the
 link-check will fail - which really should reset have_flock to 'no'.
 IMO, HAVE_FLOCK should be defined when _both_ checks succeed only, not
 upon the compile-check only as it is done now.

It might be better indeed. Patches against the current SVN branches are
welcome (I don't have an AIX system to test them on, and besides I'm not
an autoconf expert).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-07 Thread Michael Haubenwallner

Michael Haubenwallner michael.haubenwall...@salomon.at added the comment:

Using this patch based on current py3k branch I've been able now to build the 
fcntl module for 32bit aix5.3 (with flock) and 64bit aix5.3 (without flock), 
both using an old gcc-3.3.6, as well as for 64bit linux.
If necessary, I should be able to create a similar patch for the other branches 
tomorrow.

--
Added file: http://bugs.python.org/file18787/flock-check-py3k.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-07 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

I inverted the actions in the test I proposed in msg115768 (quick note from 
home, should have tested at work before posting). It should be:

AC_MSG_CHECKING(for flock)
have_flock=no
AC_TRY_LINK([
#include confdefs.h 
#include sys/file.h
], [void* p = flock; flock(0, 0)],
  [have_flock=yes],
  [AC_CHECK_LIB(bsd,flock, [
AC_DEFINE(FLOCK_NEEDS_LIBBSD, 1, Define if flock needs to be linked with 
bsd library.)
have_flock=yes
])]
)
if test $have_flock = yes ; then
  AC_DEFINE(HAVE_FLOCK, 1, Define if you have the 'flock' function.)
fi
AC_MSG_RESULT($have_flock)

Mickael, does that new test works for you? I am not sure I follow your 
explanation: there is no more 'compile-check' (AC_TRY_COMPILE) in the new test 
I provided; just a 'link-check' (AC_TRY_LINK - which tests that compilation and 
link did work).
HAVE_FLOCK is undefined by default.
If the link-check succeeds, then HAVE_FLOCK is defined.
If it fails, then we try to look for flock in libbsd; if that test works, then 
HAVE_FLOCK is defined as well as FLOCK_NEEDS_LIBBSD.

In the case of broken AIX 64 bits, the link-check will fail (no flock in 
default C libraries); then the test to find flock in libbsd will also fail (no 
64 bits objets in libbsd). So HAVE_FLOCK will be undefined, which is what you 
expect.

m4/autoconf is quite unintuitive so I may have made a mistake, or it may be 
easily misunderstood. But I intend my test to define HAVE_FLOCK only if 
compilation _and_ linking works, like you expect.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-06 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

Here is the version of the patch for Python 2.7.
I had to change AC_TRY_COMPILE to AC_COMPILE_IFELSE and AC_TRY_LINK to 
AC_LINK_IFELSE.

The syntax in configure.in is the same between Python 2.7 and the trunk. It is 
also the same between Python 2.6.6 and Python 3.1.2.

So this patch can be applied on the trunk and the patch 
Python-2.6.6_flock_AIX.diff can be applied on Python 3.1.2.

--
Added file: http://bugs.python.org/file18766/Python-2.7_flock_AIX.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-06 Thread Michael Haubenwallner

Michael Haubenwallner michael.haubenwall...@salomon.at added the comment:

While I've not tested these patches myself, I do think there still is an 
unhandled case: building a 64bit python.
As libbsd.a contains 32bit objects only, there is no 64bit flock().
So AC_CHECK_LIB(bsd,flock) may still fail, which should result in have_flock=no 
then.
Thank you!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-06 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

[rant: grrr, AIX is really a crappy platform; no consistency between releases; 
there are dozens of obvious bugs like that... anyway...]

The fact that there is no 64 bits objects in libbsd.a on AIX 6.1 is a 
documented bug:
http://www-01.ibm.com/support/docview.wss?uid=isg1IZ45155

They recommend to install patch APAR IZ45155.

I suppose there is nothing more we can do if the function is not available on 
the system. Maybe we could display a warning or error message and suggest to 
upgrade to a more recent patchlevel if we are on AIX and flock cannot be found?

Though if the installation is relatively up to date, there should be no problem.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Well, I suppose if flock needs libbsd on AIX (which is quite weird in itself), 
and AIX fails to ship libbsd for some executable formats, then it's AIX's 
problem.

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-02 Thread Sébastien Sablé

Sébastien Sablé sa...@users.sourceforge.net added the comment:

Hi,

Here is a patch that solves this problem. It was tested with Python 2.6.6 on 
AIX 6.1.

The same problem applies to Python 2.7 and 3.x, but since the syntax has been 
changed in configure.in for Python 2.7 and 3.x, I need to adapt a little bit my 
patch (coming soon).

regards

--
keywords: +patch
nosy: +sable
versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file18709/Python-2.6.6_flock_AIX.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-04-07 Thread Michael Haubenwallner

Michael Haubenwallner michael.haubenwall...@salomon.at added the comment:

This very same problem happens (with Python-2.6.2) on AIX5.3 now too, after 
upgrading to:
$ oslevel -s
5300-08-09-1013

Unlike before (comparing with old build logs), this AIX5.3 now provides flock() 
in sys/file.h and libbsd.a[shr.o] like AIX6.1.

Interesting enough, /usr/lib/libbsd.a contains 32bit shared objects only, so 
-lbsd does not help in 64bit mode (don't know if python actually supports 64bit 
on AIX). I don't have an AIX6.1 to check this.

Because of this, upgrading checking for flock from compile- to link-check 
(eventually trying -lbsd a second time) might help?

--
nosy: +haubi

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2010-04-07 Thread Michael Haubenwallner

Michael Haubenwallner michael.haubenwall...@salomon.at added the comment:

Ohw, looking on another machine, being AIX5.3 TL6:
$ oslevel -s
5300-06-00-

Here flock() is provided in libbsd.a(shr.o) (32bit only) too, but it isn't 
declared in any header-file. So that recent AIX5.3 patchset just adds the 
flock() declaration, not the function itself (is already there).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2009-01-07 Thread Jeremy Olexa

Jeremy Olexa darks...@gentoo.org added the comment:

I have now confirmed that the fix described here[1] works as desired. I
don't know if this is proper or not but it matches what inkblotter said.

[1]: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=226339

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2009-01-06 Thread Jeremy Olexa

Jeremy Olexa darks...@gentoo.org added the comment:

This also happens with Python 2.5.2 (not the latest 2.5 series, I know)
on AIX 6.1.

--
nosy: +darkside

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2008-10-27 Thread inkblotter

inkblotter [EMAIL PROTECTED] added the comment:

This occurs because it must link with -lbsd on AIX 6.1.  If you hand
link the failing module by adding -lbsd it builds quietly.

If you build the prerequisites for the _tkinter module on AIX 6.1, you
will also encounter an error becuase this module is not linked with the
-lXext library.  Again, you can hand link it with that library.  

Notice that the modules ignore these two libraries when they are passed
to the python build.  The modules should build against the libraries
that are mentioned in the --with-libs=LIBS argument to python configure.

I will eventually figure out how to modify setup.py so that these two
failures no longer occur on AIX 6.1.

--
nosy: +inkblotter

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4026] fcntl extension fails to build on AIX 6.1

2008-10-03 Thread David Jones

New submission from David Jones [EMAIL PROTECTED]:

After hacking the configure script to work around the issues 
http://bugs.python.org/issue4025 and http://bugs.python.org/issue1633863 
the build still fails:

building 'fcntl' extension
xlc_r -DNDEBUG -O -I. -I/home/u0006584/Python-2.6/./Include -I. -
IInclude -I./Include -I/home/u0006584/Python-2.6/Include -
I/home/u0006584/Python-2.6 -c /home/u0006584/Python-
2.6/Modules/fcntlmodule.c -o build/temp.aix-6.1-
2.6/home/u0006584/Python-2.6/Modules/fcntlmodule.o
./Modules/ld_so_aix xlc_r -bI:Modules/python.exp build/temp.aix-6.1-
2.6/home/u0006584/Python-2.6/Modules/fcntlmodule.o -o build/lib.aix-6.1-
2.6/fcntl.so
ld: 0711-317 ERROR: Undefined symbol: .flock
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more 
information.
*** WARNING: renaming fcntl since importing it failed:0509-022 
Cannot load module build/lib.aix-6.1-2.6.
0509-026 System error: A file or directory in the path name does 
not exist.
error: No such file or directory
make: 1254-004 The error code from the last command is 1.

(Full transcript attached)

I'm mystified and I can't log in to the AIX box right now.

This does not appear to be the same as http://bugs.python.org/issue1756343 and 
http://bugs.python.org/issue1694442 which both appear to be the same, 
but documenting a differen AIX build problem.

--
files: py26aix61script2
messages: 74231
nosy: drj
severity: normal
status: open
title: fcntl extension fails to build on AIX 6.1
type: compile error
versions: Python 2.6
Added file: http://bugs.python.org/file11688/py26aix61script2

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4026
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com