[Python-checkins] CVS: python/dist/src/Modules makesetup,1.29,1.30 Makefile.pre.in,1.71,1.72

Guido van Rossum python-dev@python.org
Wed, 10 Jan 2001 13:12:20 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv2991

Modified Files:
	makesetup Makefile.pre.in 
Log Message:
Final part of SF patch #102409 by jlt63: Cygwin Python DLL and Shared
Extension Patch.

These are the changes to the Modules Makefile and makesetup script for
Cygwin.



Index: makesetup
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/makesetup,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** makesetup	2000/12/06 23:46:29	1.29
--- makesetup	2001/01/10 21:12:18	1.30
***************
*** 80,83 ****
--- 80,95 ----
  '
  
+ # Setup to link with extra libraries when makeing shared extensions.
+ # Currently, only Cygwin needs this baggage.
+ case `uname -s` in
+ CYGWIN*) if test $srcdir = .
+ 	 then
+ 	 	ExtraLibDir=..
+ 	 else
+ 	 	ExtraLibDir='$(LIBPL)'
+ 	 fi
+ 	 ExtraLibs="-L$ExtraLibDir -lpython\$(VERSION)";;
+ esac
+ 
  # Main loop
  for i in ${*-Setup}
***************
*** 150,153 ****
--- 162,166 ----
  			*.sl)		libs="$libs $arg";;
  			/*.o)		libs="$libs $arg";;
+ 			*.def)		libs="$libs $arg";;
  			*.o)		srcs="$srcs `basename $arg .o`.c";;
  			*.[cC])		srcs="$srcs $arg";;
***************
*** 214,218 ****
  			esac
  			rule="$file: $objs"
! 			rule="$rule; \$(LDSHARED) $objs $libs -o $file"
  			echo "$rule" >>$rulesf
  		done
--- 227,231 ----
  			esac
  			rule="$file: $objs"
! 			rule="$rule; \$(LDSHARED) $objs $libs $ExtraLibs -o $file"
  			echo "$rule" >>$rulesf
  		done

Index: Makefile.pre.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/Makefile.pre.in,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -r1.71 -r1.72
*** Makefile.pre.in	2000/11/28 12:09:18	1.71
--- Makefile.pre.in	2001/01/10 21:12:18	1.72
***************
*** 106,109 ****
--- 106,110 ----
  LIBRARY=	../libpython$(VERSION).a
  LDLIBRARY=	../@LDLIBRARY@
+ @SET_DLLLIBRARY@
  
  # === Rules ===
***************
*** 127,130 ****
--- 128,139 ----
  		  $(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python$(EXE) $(LDLAST)
  		mv python$(EXE) ../python$(EXE)
+ 
+ # This rule builds the Cygwin Python DLL
+ $(DLLLIBRARY): $(LIBRARY)
+ 		test -d cygwin || mkdir cygwin
+ 		(cd cygwin; ar x ../$^)
+ 		dlltool --export-all --output-def $(basename $@).def cygwin/*.o
+ 		$(LDSHARED) -Wl,--out-implib=$(LDLIBRARY) -o $@ $(basename $@).def cygwin/*.o $(MODLIBS) $(LIBS) $(SYSLIBS)
+ 		rm -fr cygwin
  
  clean: