Browse Source

python3: enable shared python3 lib; make this the norm

This will reduce the bloat when users will want to compile in their
Python C extensions.
There will be a initial bloat (several kb) if just Python
is installed, but that will be compensated when users will add more
C extensions.

During the build we also have to add Python's PKG_BUILD_DIR
so that the shared lib is found when compiling Python's
built-in C extensions.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean 10 years ago
parent
commit
1a0e9b3786
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      lang/python3/Makefile

+ 4
- 3
lang/python3/Makefile View File

@@ -70,7 +70,7 @@ MAKE_FLAGS:=\
70 70
 	DESTDIR="$(PKG_INSTALL_DIR)" \
71 71
 	CROSS_COMPILE=yes \
72 72
 	CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \
73
-	LDFLAGS="$(TARGET_LDFLAGS)" \
73
+	LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR)" \
74 74
 	LD="$(TARGET_CC)"
75 75
 
76 76
 ENABLE_IPV6:=
@@ -102,7 +102,7 @@ define Build/Configure
102 102
 	$(CP) ./files/config.site $(PKG_BUILD_DIR)
103 103
 	$(call Build/Configure/Default, \
104 104
 		--sysconfdir=/etc \
105
-		--disable-shared \
105
+		--enable-shared \
106 106
 		--without-cxx-main \
107 107
 		--with-threads \
108 108
 		--with-system-ffi="$(STAGING_DIR)/usr" \
@@ -123,7 +123,7 @@ define Build/InstallDev
123 123
 		$(1)/usr/include/
124 124
 	$(CP) \
125 125
 		$(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION) \
126
-		$(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \
126
+		$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
127 127
 		$(1)/usr/lib/
128 128
 	$(CP) \
129 129
 		$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
@@ -157,6 +157,7 @@ define Py3Package/python3/install
157 157
 	# Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
158 158
 	$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
159 159
 	$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3
160
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
160 161
 endef
161 162
 
162 163
 define Host/Configure