File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ SYSLIBS= $(LIBM) $(LIBC)
105105
106106LIBRARY= ../libpython$(VERSION).a
107107LDLIBRARY= ../@LDLIBRARY@
108+ @SET_DLLLIBRARY@
108109
109110# === Rules ===
110111
@@ -127,6 +128,14 @@ link: $(MAINOBJ)
127128 $(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python$(EXE) $(LDLAST)
128129 mv python$(EXE) ../python$(EXE)
129130
131+ # This rule builds the Cygwin Python DLL
132+ $(DLLLIBRARY): $(LIBRARY)
133+ test -d cygwin || mkdir cygwin
134+ (cd cygwin; ar x ../$^)
135+ dlltool --export-all --output-def $(basename $@).def cygwin/*.o
136+ $(LDSHARED) -Wl,--out-implib=$(LDLIBRARY) -o $@ $(basename $@).def cygwin/*.o $(MODLIBS) $(LIBS) $(SYSLIBS)
137+ rm -fr cygwin
138+
130139clean:
131140 -rm -f *.o python$(EXE) core *~ [@,#]* *.old *.orig *.rej
132141 -rm -f add2lib hassignal
Original file line number Diff line number Diff line change 7979NL=' \
8080'
8181
82+ # Setup to link with extra libraries when makeing shared extensions.
83+ # Currently, only Cygwin needs this baggage.
84+ case ` uname -s` in
85+ CYGWIN* ) if test $srcdir = .
86+ then
87+ ExtraLibDir=..
88+ else
89+ ExtraLibDir=' $(LIBPL)'
90+ fi
91+ ExtraLibs=" -L$ExtraLibDir -lpython\$ (VERSION)" ;;
92+ esac
93+
8294# Main loop
8395for i in ${* -Setup}
8496do
@@ -149,6 +161,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
149161 * .so) libs=" $libs $arg " ;;
150162 * .sl) libs=" $libs $arg " ;;
151163 /* .o) libs=" $libs $arg " ;;
164+ * .def) libs=" $libs $arg " ;;
152165 * .o) srcs=" $srcs ` basename $arg .o` .c" ;;
153166 * .[cC]) srcs=" $srcs $arg " ;;
154167 * .cc) srcs=" $srcs $arg " ;;
@@ -213,7 +226,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
213226 no) SHAREDMODS=" $SHAREDMODS $file " ;;
214227 esac
215228 rule=" $file : $objs "
216- rule=" $rule ; \$ (LDSHARED) $objs $libs -o $file "
229+ rule=" $rule ; \$ (LDSHARED) $objs $libs $ExtraLibs -o $file "
217230 echo " $rule " >> $rulesf
218231 done
219232 done
You can’t perform that action at this time.
0 commit comments