Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Thu, 5 Jul 2001 14:33:15 -0400 From: Jason Tishler To: David Abrahams Cc: Cygwin Subject: Re: Cygwin 2.1 and Python modules Message-ID: <20010705143315.B6324@dothill.com> Mail-Followup-To: David Abrahams , Cygwin Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="wGuMYjrLaRphGfNo" Content-Disposition: inline In-Reply-To: <004901c10563$042d1890$01000001@abeast1.com> User-Agent: Mutt/1.3.18i Organization: Dot Hill Systems Corp. --wGuMYjrLaRphGfNo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Dave, On Thu, Jul 05, 2001 at 10:58:56AM -0400, David Abrahams wrote: > > The above is usually done to build straight Win32 extension modules with > > Mingw or Cygwin -mno-cygwin -- not to build Cygwin extension modules. > > Oh! So if I built my extension modules with -mno-cygwin and used pexports to > generate the import library, you think I might be able to link with the > regular Windows Python release? Yes, see the following: http://starship.python.net/crew/kernr/mingw32/Notes.html If you are willing to use a non-standard way of building extension modules (neither Misc/Makefile.pre.in or Distutils), then see attached. This makefile builds the readline extension module for the Win32 Python. It takes advantage of somewhat recent Cygwin gcc enhancements: 1. binding to msvcrt.dll instead of crtdll.dll 2. ability to link directly to a DLL (instead of requiring an import library) You can use this as an example and modify it to suit your needs. Note that it obviates the need for pexports. Jason -- Jason Tishler Director, Software Engineering Phone: 732.264.8770 x235 Dot Hill Systems Corp. Fax: 732.264.8798 82 Bethany Road, Suite 7 Email: Jason DOT Tishler AT dothill DOT com Hazlet, NJ 07730 USA WWW: http://www.dothill.com --wGuMYjrLaRphGfNo Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Makefile # Directory definitions PythonDistDir = /mnt/d/Program\ Files/Python21 PythonDllDir = /mnt/c/WINNT/system32 PythonSourceDir = /home/jt/src/Python-2.1 MingwDir = /apps/mingw # Constant definitions CC = gcc -mno-cygwin CPPFLAGS = -D__READLINE_IMPORT__ -I $(PythonDistDir)/Include \ -I $(MingwDir)/include LDFLAGS = -s -shared -Wl,--enable-auto-image-base LDLIBS = $(PythonDllDir)/python21.dll $(MingwDir)/bin/libreadline.dll INSTALL = install INSTALLFLAGS = -s # VPATH definitions vpath %.c $(PythonSourceDir)/Modules # all target all: readline.pyd # install target install: all $(INSTALL) $(INSTALLFLAGS) readline.pyd $(PythonDistDir)/DLLs $(INSTALL) $(INSTALLFLAGS) $(MingwDir)/bin/libreadline.dll $(PythonDistDir)/DLLs # clean target clean: $(RM) $(RMFLAGS) readline.* # readline.def target readline.def: echo LIBRARY readline.pyd >$@ echo EXPORTS >>$@ echo initreadline >>$@ # Win32 Python readline module target readline.pyd: readline.o readline.def # .pyd rule %.pyd: %.o $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ --wGuMYjrLaRphGfNo Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ --wGuMYjrLaRphGfNo--