Browse Source

Merge pull request #445 from commodo/python-update-2

Python update 2
sbyx 10 years ago
parent
commit
eb3ccec265
2 changed files with 13 additions and 8 deletions
  1. 6
    6
      lang/python/Makefile
  2. 7
    2
      lang/python/files/python-package.mk

+ 6
- 6
lang/python/Makefile View File

@@ -126,13 +126,13 @@ endef
126 126
 define Package/python-readline
127 127
 $(call Package/python/Default)
128 128
  TITLE:=Python support for readline
129
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libreadline +libncurses @BROKEN
129
+ DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libreadline +libncursesw @BROKEN
130 130
 endef
131 131
 
132 132
 define Package/python-ncurses
133 133
 $(call Package/python/Default)
134 134
  TITLE:=Python support for readline
135
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libncurses
135
+ DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libncursesw
136 136
 endef
137 137
 
138 138
 MAKE_FLAGS:=\
@@ -140,7 +140,7 @@ MAKE_FLAGS:=\
140 140
 	DESTDIR="$(PKG_INSTALL_DIR)" \
141 141
 	CROSS_COMPILE=yes \
142 142
 	CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \
143
-	LDFLAGS="$(TARGET_LDFLAGS)" \
143
+	LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR)" \
144 144
 	LD="$(TARGET_CC)" \
145 145
 	PGEN=pgen2
146 146
 
@@ -155,7 +155,7 @@ define Build/Configure
155 155
 	$(CP) ./files/config.site $(PKG_BUILD_DIR)
156 156
 	$(call Build/Configure/Default, \
157 157
 		--sysconfdir=/etc \
158
-		--disable-shared \
158
+		--enable-shared \
159 159
 		--without-cxx-main \
160 160
 		--with-threads \
161 161
 		--with-system-ffi="$(STAGING_DIR)/usr" \
@@ -176,7 +176,7 @@ define Build/InstallDev
176 176
 		$(1)/usr/include/
177 177
 	$(CP) \
178 178
 		$(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION) \
179
-		$(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \
179
+		$(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).so* \
180 180
 		$(1)/usr/lib/
181 181
 	$(CP) \
182 182
 		$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
@@ -384,12 +384,12 @@ define PyPackage/python/filespec
384 384
 +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so
385 385
 +|/usr/lib/python$(PYTHON_VERSION)/bisect.py
386 386
 +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so
387
-+|/usr/include/python$(PYTHON_VERSION)/pyconfig.h
388 387
 endef
389 388
 
390 389
 define PyPackage/python/install
391 390
 	$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python
392 391
 	$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python2
392
+	$(CP) $(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
393 393
 endef
394 394
 
395 395
 define PyPackage/python-doc/filespec

+ 7
- 2
lang/python/files/python-package.mk View File

@@ -72,9 +72,14 @@ endef
72 72
 define Build/Compile/PyMod
73 73
 	$(call HostPython, \
74 74
 		cd $(PKG_BUILD_DIR)/$(strip $(1)); \
75
+		CC="$(TARGET_CC)" \
76
+		CCSHARED="$(TARGET_CC) $(FPIC)" \
77
+		LD="$(TARGET_CC)" \
78
+		LDSHARED="$(TARGET_CC) -shared" \
75 79
 		CFLAGS="$(TARGET_CFLAGS)" \
76
-		CPPFLAGS="$(TARGET_CPPFLAGS)" \
77
-		LDFLAGS="$(TARGET_LDFLAGS)" \
80
+		CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON_INC_DIR)" \
81
+		LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)" \
82
+		_PYTHON_HOST_PLATFORM="linux-$(ARCH)" \
78 83
 		$(3) \
79 84
 		, \
80 85
 		./setup.py $(2) \