delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/07/03:08:25

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <000801c04891$d8b25ec0$12f0fea9@mitsu5>
From: "Mitsuo Igarashi" <mitsu5 AT ruby DOT famille DOT ne DOT jp>
To: <cygwin AT sources DOT redhat DOT com>
Subject: RE: How to make an extension of Python
Date: Tue, 7 Nov 2000 17:07:54 +0900
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

Hello Jason

|See attached for my patch.  The following is the procedure to apply and
|build Python with it:
|
|    $ tar -xvzf Python-2.0.tar.gz
|    $ gunzip CygwinPython-2.0-full.patch.gz  # ***
|    $ cd Python-2.0
|    $ patch -p1 <../CygwinPython-2.0-full.patch  # ***
|    $ configure --with-threads=no --with-libm= --with-suffix=.exe 2>&1 |
tee configure.out
|    $ make 2>&1 | tee make.out
|    $ make install 2>&1 | tee make-install.out
|
|Note that only the steps marked with "# ***" above are different from
|the normal build procedure.
|
|To test out shared extensions, try the following:
|
|    $ cd Demo/extend
|    $ make_shared 2>&1 | tee make_shared.out
|    $ python
|    Python 2.0 (#1, Nov  1 2000, 08:51:39)
|    [GCC 2.95.2 19991024 (release-2)] on cygwin_nt-4.01
|    Type "copyright", "credits" or "license" for more information.
|    >>> import xx
|    >>> dir(xx)
|    ['__doc__', '__file__', '__name__', 'bug', 'error', 'foo', 'new',
'roj']
|    >>> xx.foo(2, 3)
|    5
|
|Please let me know you make out.  So far, only one other has tried my
|patch and I'm looking for any feedback -- both good and bad.

Wonderful !!!
This method is completely successful in my enviroment.

I have tried another usual build up of python2.0 without your patch and make
the extension of xx.dll by the make_shared method. Then I get an error
message when importing xx.dll: "Fatal Python error: Interpreter not
initialized".

May I have questions?

Question 1).
  Why does the usual build up of python end in a failure in making an
extension? What is your patch doing to correct the failure?

In another mail on "RE: How to make an extension of Python", Anthony
Tuininga tells
>I do not use anything from DLL helpers but rather simply use dllwrap
(version 0.2.4) with> the following command (NOT UNDER CYGWIN, btw); P.S.
Note that double dashes which were m>issing in your post (may be a typing
error but just in case.... :-)
>
>dllwrap --def cx_Oracle.def --output-lib libcx_Oracle.a --dllname
cx_Oracle.dll \
>        cx_Oracle.o -L/Tools/Library/Win32 -loci -lpython20

I tried the following written procedure that ended up in the error message:

dllwrap -o myEnviron.pyd -def myEnviron.def myEnviron.o -lpython2.0
"Importerror: dynamic modules does not define init
function ( initmyEnviron)".

I could create the extension of "environ.c" according to the following
instruction by Mingw32.

http://starship.python.net/crew/kernr/mingw32/Notes.html
Instructions for Python Extensions with GCC/mingw32 by Robert Kern.

>dllwrap --dllname foo.pyd --driver-name gcc --def foo.def -o foo.pyd \
>foomodule.o -s --entry _DllMain AT 12 --target=i386-mingw32 -L<py-lib-dir> \
>-lpython15
However, the same "environ.c" could not be a successful dll binary in
Cygwin.

Question 2)
Why did the simple dllwrap smoetimes successfully create an extension
and another time unsuccessfully in Cygwin?

Than you very much.
----------=========---------
Mitsuo Igarashi
mitsu5 AT ruby DOT famille DOT ne DOT jp





--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019