mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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.
This commit is contained in:
parent
aef734b182
commit
b961920ff4
2 changed files with 23 additions and 1 deletions
|
|
@ -105,6 +105,7 @@ SYSLIBS= $(LIBM) $(LIBC)
|
||||||
|
|
||||||
LIBRARY= ../libpython$(VERSION).a
|
LIBRARY= ../libpython$(VERSION).a
|
||||||
LDLIBRARY= ../@LDLIBRARY@
|
LDLIBRARY= ../@LDLIBRARY@
|
||||||
|
@SET_DLLLIBRARY@
|
||||||
|
|
||||||
# === Rules ===
|
# === Rules ===
|
||||||
|
|
||||||
|
|
@ -127,6 +128,14 @@ link: $(MAINOBJ)
|
||||||
$(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python$(EXE) $(LDLAST)
|
$(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python$(EXE) $(LDLAST)
|
||||||
mv python$(EXE) ../python$(EXE)
|
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:
|
clean:
|
||||||
-rm -f *.o python$(EXE) core *~ [@,#]* *.old *.orig *.rej
|
-rm -f *.o python$(EXE) core *~ [@,#]* *.old *.orig *.rej
|
||||||
-rm -f add2lib hassignal
|
-rm -f add2lib hassignal
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,18 @@ esac
|
||||||
NL='\
|
NL='\
|
||||||
'
|
'
|
||||||
|
|
||||||
|
# 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
|
# Main loop
|
||||||
for i in ${*-Setup}
|
for i in ${*-Setup}
|
||||||
do
|
do
|
||||||
|
|
@ -149,6 +161,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
|
||||||
*.so) libs="$libs $arg";;
|
*.so) libs="$libs $arg";;
|
||||||
*.sl) libs="$libs $arg";;
|
*.sl) libs="$libs $arg";;
|
||||||
/*.o) libs="$libs $arg";;
|
/*.o) libs="$libs $arg";;
|
||||||
|
*.def) libs="$libs $arg";;
|
||||||
*.o) srcs="$srcs `basename $arg .o`.c";;
|
*.o) srcs="$srcs `basename $arg .o`.c";;
|
||||||
*.[cC]) srcs="$srcs $arg";;
|
*.[cC]) srcs="$srcs $arg";;
|
||||||
*.cc) srcs="$srcs $arg";;
|
*.cc) srcs="$srcs $arg";;
|
||||||
|
|
@ -213,7 +226,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
|
||||||
no) SHAREDMODS="$SHAREDMODS $file";;
|
no) SHAREDMODS="$SHAREDMODS $file";;
|
||||||
esac
|
esac
|
||||||
rule="$file: $objs"
|
rule="$file: $objs"
|
||||||
rule="$rule; \$(LDSHARED) $objs $libs -o $file"
|
rule="$rule; \$(LDSHARED) $objs $libs $ExtraLibs -o $file"
|
||||||
echo "$rule" >>$rulesf
|
echo "$rule" >>$rulesf
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue