Compiling Python 2.2 with GCC in HPUX 10.20 does not work

Mats Wichmann mats at laplaza.org
Wed Mar 6 10:03:35 EST 2002


On Tue, 05 Mar 2002 16:23:22 GMT, pekka niiranen <krissepu at vip.fi>
wrote:


I don't have access to an HPUX machine so this help is going to be
minimal.

h_errno normally comes out of <netdb.h>, check if it's there and if
it's being included.  C library constants are a bit of a problem, as
folks seem to keep inventing different ways to make them thread-safe.
You may have to root around a bit and see what HPUX has done.

In the other one, there's no shared ncurses lib,  and the snipped line
is explicitly building a position-independent (PIC) shared object, but
is linking it with a static library which containts non-PIC code.
Since you presumably had to build ncurses yourself (a guess since it's
being found in /usr/local), you might try rebuilding ncurses.

I know this is buried in the bit that is handled with distutils and
while I like what distutils brings us, it's sometimes a little harder
to trace how these decisions were made before the compilation actually
kicks off.

:
:--------------020604040107000300090304
:Content-Type: text/plain; charset=us-ascii; format=flowed
:Content-Transfer-Encoding: 7bit
:
:True, HP-UX's default compiler is only meant for compliling the kernel
:therefore  I installed  binutils v2.11.2,  gcc v3.01 and gmake v3.79.1 from
:HP's software repository and tried compiling with this script:
:
:#! /usr/bin/sh
:export CCOPTS='+z'
:unset LANG
:gmake distclean
:CC=gcc ./configure --with-gcc --with-threads=no --without-cxx 
:--prefix=/opt/python
:
:gmake fails twice:
:
:1)
:/osasto/home/niirape/python_softa/Python-2.2/Modules/getaddrinfo.c:544: 
:warning: `h_error' might be used uninitialized in this funcn
:In file included from 
:/osasto/home/niirape/python_softa/Python-2.2/Modules/socketmodule.c:239:
:/osasto/home/niirape/python_softa/Python-2.2/Modules/getnameinfo.c: In 
:function `getnameinfo':
:/osasto/home/niirape/python_softa/Python-2.2/Modules/getnameinfo.c:184: 
:`h_errno' undeclared (first use in this function)
:/osasto/home/niirape/python_softa/Python-2.2/Modules/socketmodule.c: In 
:function `gethost_common':
:/osasto/home/niirape/python_softa/Python-2.2/Modules/socketmodule.c:1975: 
:`h_errno' undeclared (first use in this function)
:WARNING: building of extension "_socket" failed: command 'gcc' failed 
:with exit status 1 
:
:2)
:gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I. 
:-I/osasto/home/niirape/python_softa/Python-2.2/./Include -I/usr/local/incluo
:ld -b build/temp.hp-ux-B.10.20-9000/777-2.2/_cursesmodule.o 
:-L/usr/local/lib -lncurses -o build/lib.hp-ux-B.10.20-9000/777-2.2/_curl
:ld: DP relative code in file /usr/local/lib/libncurses.a(lib_addch.o) - 
:shared library must be position
:    independent.  Use +z or +Z to recompile.
:WARNING: building of extension "_curses" failed: command 'ld' failed 
:with exit status 1 
:

Mats Wichmann




More information about the Python-list mailing list