1 |
commit: fb002e4bedb20a1d5c52788530e084ffc5ca430f |
2 |
Author: Michael Haubenwallner <michael.haubenwallner <AT> ssi-schaefer <DOT> com> |
3 |
AuthorDate: Wed Apr 27 13:41:04 2016 +0000 |
4 |
Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 28 15:05:43 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=fb002e4b |
7 |
|
8 |
bootstrap-prefix.sh: patch python to use dlltool for Cygwin |
9 |
|
10 |
scripts/bootstrap-prefix.sh | 24 ++++++++++++++++++++++++ |
11 |
1 file changed, 24 insertions(+) |
12 |
|
13 |
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh |
14 |
index f24baa9..074276d 100755 |
15 |
--- a/scripts/bootstrap-prefix.sh |
16 |
+++ b/scripts/bootstrap-prefix.sh |
17 |
@@ -691,6 +691,7 @@ bootstrap_python() { |
18 |
# --disable-shared causes modules to probably link against the |
19 |
# executable name, which must be the real executable at runtime |
20 |
# as well rather than some symlink (for Cygwin at least). |
21 |
+ # And with dlltool, find_library("c") can return "cygwin1.dll". |
22 |
patch -p0 <<'EOP' |
23 |
--- Makefile.pre.in |
24 |
+++ Makefile.pre.in |
25 |
@@ -705,6 +706,29 @@ bootstrap_python() { |
26 |
@@ -3,1 +3,1 @@ |
27 |
-python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h |
28 |
+$HOSTPYTHON ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h |
29 |
+--- Lib/ctypes/util.py |
30 |
++++ Lib/ctypes/util.py |
31 |
+@@ -41,6 +41,20 @@ |
32 |
+ continue |
33 |
+ return None |
34 |
+ |
35 |
++elif sys.platform == "cygwin": |
36 |
++ def find_library(name): |
37 |
++ for libdir in ['/usr/lib', '/usr/local/lib']: |
38 |
++ for libext in ['lib%s.dll.a' % name, 'lib%s.a' % name]: |
39 |
++ implib = os.path.join(libdir, libext) |
40 |
++ if not os.path.exists(implib): |
41 |
++ continue |
42 |
++ cmd = "dlltool -I " + implib + " 2>/dev/null" |
43 |
++ res = os.popen(cmd).read().replace("\n","") |
44 |
++ if not res: |
45 |
++ continue |
46 |
++ return res |
47 |
++ return None |
48 |
++ |
49 |
+ elif os.name == "posix": |
50 |
+ # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump |
51 |
+ import re, tempfile, errno |
52 |
EOP |
53 |
local myconf="" |