[Patches] [ python-Patches-1053879 ] mingw compile

SourceForge.net noreply at sourceforge.net
Mon Nov 1 03:21:45 CET 2004


Patches item #1053879, was opened at 2004-10-25 11:38
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1053879&group_id=5470

Category: Core (C code)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Kramm (kramm)
Assigned to: Nobody/Anonymous (nobody)
Summary: mingw compile

Initial Comment:
A cross-compile of a Win32 Python under Linux using
MingW (www.mingw.org) didn't work, as posixmodule.c
didn't know anything about MingW.
This patch fixes the various compile errors by
introducing a new local MINGW define in posixmodule.c,
and making several #ifdefs also take that variable into
account.

After this patch is applied, it's possible to compile
python.exe on Linux with MingW by doing

 CXX=i386-mingw32msvc-g++  CPP=i386-mingw32msvc-cpp  RANLIB=i386-mingw32msvc-ranlib  AR=i386-mingw32msvc-ar  CC="/opt/xmingw/bin/i386-mingw32msvc-gcc -DMS_WINDOWS
-DPy_WIN_WIDE_FILENAMES"  ./configure --host=i586-mingw32msvc 

 sed -i s/initposix/initnt/g Modules/config.c
 sed -i 's/#define HAVE_DEV_PTMX 1//g' pyconfig.h
   
 make


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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2004-10-31 21:21

Message:
Logged In: YES 
user_id=80475

I don't have a way of testing your patch and will have to
apply it on blind faith.  Be sure to get it right and read
it carefully to make sure it doesn't mess-up anyone else's
compilation.

The attached version won't compile for me (MSVC++ 6.0 on WinMe):

posixmodule.c
C:\py24\Modules\posixmodule.c(1175) : warning C4013:
'ttyname' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(1175) : warning C4047: '=' :
'char *' differs in levels of indirection from 'int '
C:\py24\Modules\posixmodule.c(1660) : error C2065: 'DIR' :
undeclared identifier
C:\py24\Modules\posixmodule.c(1660) : error C2065: 'dirp' :
undeclared identifier
C:\py24\Modules\posixmodule.c(1660) : warning C4552: '*' :
operator has no effect; expected operator with side-effect
C:\py24\Modules\posixmodule.c(1661) : error C2143: syntax
error : missing ';' before 'type'
C:\py24\Modules\posixmodule.c(1662) : error C2143: syntax
error : missing ';' before 'type'
C:\py24\Modules\posixmodule.c(1665) : error C2065:
'arg_is_unicode' : undeclared identifier
C:\py24\Modules\posixmodule.c(1670) : warning C4013:
'opendir' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(1670) : warning C4047: '==' :
'int ' differs in levels of indirection from 'void *'
C:\py24\Modules\posixmodule.c(1674) : warning C4013:
'closedir' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(1678) : error C2065: 'ep' :
undeclared identifier
C:\py24\Modules\posixmodule.c(1678) : warning C4013:
'readdir' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(1678) : warning C4047: '!=' :
'int ' differs in levels of indirection from 'void *'
C:\py24\Modules\posixmodule.c(1679) : error C2223: left of
'->d_name' must point to struct/union
C:\py24\Modules\posixmodule.c(1680) : error C2223: left of
'->d_namlen' must point to struct/union
C:\py24\Modules\posixmodule.c(1681) : error C2223: left of
'->d_name' must point to struct/union
C:\py24\Modules\posixmodule.c(1681) : error C2223: left of
'->d_namlen' must point to struct/union
C:\py24\Modules\posixmodule.c(1683) : error C2223: left of
'->d_name' must point to struct/union
C:\py24\Modules\posixmodule.c(1683) : error C2223: left of
'->d_namlen' must point to struct/union
C:\py24\Modules\posixmodule.c(1683) : error C2198:
'PyString_FromStringAndSize' : too few actual parameters
C:\py24\Modules\posixmodule.c(2860) : warning C4013: 'fork'
undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(2986) : warning C4013:
'getegid' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(2999) : warning C4013:
'geteuid' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(3012) : warning C4013:
'getgid' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(3134) : warning C4013:
'getppid' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(3176) : warning C4013:
'getuid' undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(3206) : warning C4013: 'kill'
undefined; assuming extern returning int
C:\py24\Modules\posixmodule.c(4959) : warning C4013: 'wait'
undefined; assuming extern returning int

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

Comment By: Matthias Kramm (kramm)
Date: 2004-10-31 04:11

Message:
Logged In: YES 
user_id=1146139

Ok, I've attached the full posixmodule.c.
It's based on the lastest CVS version (2.329, from 2004/10/13).


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

Comment By: Raymond Hettinger (rhettinger)
Date: 2004-10-31 00:40

Message:
Logged In: YES 
user_id=80475

Please attach a new posixmodule.c instead of the diff file.
 For some reason, my patch tool thinks the formatting is
malformed.

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

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


More information about the Patches mailing list