Skip to content

Commit 3161893

Browse files
committed
The device/emulator distributions include now only the shared libraries from the external libraries
1 parent 7a2fc54 commit 3161893

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

Android/README.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,8 @@ Build and run on termux
159159

160160
4. Run the Python interpreter on termux::
161161

162+
$ export TERM=linux; export TERMINFO=$HOME/../usr/lib/terminfo
162163
$ export SYS_EXEC_PREFIX=/data/data/com.termux/files/usr/local
163-
$ export TERM=linux
164-
$ export TERMINFO=$SYS_EXEC_PREFIX/share/terminfo
165164
$ LD_LIBRARY_PATH=$SYS_EXEC_PREFIX/lib:$LD_LIBRARY_PATH $SYS_EXEC_PREFIX/bin/python3
166165

167166
Requirements
@@ -316,10 +315,10 @@ Common Makefile targets
316315

317316
*distclean*
318317
Make things clean, before making a distribution. This also removes the
319-
``PY_DESTDIR`` directory where the external libraries have been installed
318+
DESTDIR directory where the external libraries have been copied
320319
and where the cross-compiled Python has been installed by the command ``make
321-
DESTDIR=$(PY_DESTDIR) install`` run on Python own Makefile. As a side effect
322-
the external libraries will be rebuilt on the next make invocation.
320+
DESTDIR=$(PY_DESTDIR) install`` run on Python own Makefile. The external
321+
libraries will not be rebuilt on the next make invocation.
323322

324323
*clean*
325324
Remove everything for the given (api, architecture) except the AVD.

Android/build.mk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ native_build_dir := $(BUILD_DIR)/python-native
88
py_name := python$(py_version)
99
export BUILD_TYPE := android-$(ANDROID_API)-$(ANDROID_ARCH)
1010
py_host_dir := $(BUILD_DIR)/$(py_name)-$(BUILD_TYPE)
11-
export PY_DESTDIR := $(BUILD_DIR)/$(py_name)-install-$(BUILD_TYPE)
11+
export PY_EXTDIR := $(BUILD_DIR)/$(py_name)-extlibs-$(BUILD_TYPE)
12+
PY_DESTDIR := $(BUILD_DIR)/$(py_name)-install-$(BUILD_TYPE)
1213
abiflags = $(shell echo $$(cat $(py_host_dir)/Makefile | \
1314
sed -e "s/^ABIFLAGS[= \t]*\(.*\)[ \t]*$$\|^.*$$/\1/" -e "/^$$/d"))
1415
py_fullname = python$(py_version)$(abiflags)
@@ -59,8 +60,8 @@ native_python: $(native_build_dir)/config.status $(native_build_dir)/Modules/Set
5960
$(MAKE) -C $(native_build_dir)
6061

6162
# Target-specific exported variables.
62-
$(config_status): export CPPFLAGS := -I$(PY_DESTDIR)/$(SYS_EXEC_PREFIX)/include
63-
$(config_status): export LDFLAGS := -L$(PY_DESTDIR)/$(SYS_EXEC_PREFIX)/lib
63+
$(config_status): export CPPFLAGS := -I$(PY_EXTDIR)/$(SYS_EXEC_PREFIX)/include
64+
$(config_status): export LDFLAGS := -L$(PY_EXTDIR)/$(SYS_EXEC_PREFIX)/lib
6465
build configure host python_dist: \
6566
export PATH := $(native_build_dir):$(PATH)
6667
external_libraries: export CC := $(CC)
@@ -118,6 +119,8 @@ host:
118119
python_dist: $(python)
119120
@echo "---> Install Python for $(BUILD_TYPE)."
120121
$(MAKE) DESTDIR=$(PY_DESTDIR) -C $(py_host_dir) install
122+
cp --no-dereference $(PY_EXTDIR)/$(SYS_EXEC_PREFIX)/lib/*.so* $(PY_DESTDIR)/$(SYS_EXEC_PREFIX)/lib
123+
chmod u+w $(PY_DESTDIR)/$(SYS_EXEC_PREFIX)/lib/*.so*
121124
ifdef DEVICE_PREFIXES
122125
# This won't be needed anymore when issue 31046 is fixed.
123126
rm -rf $(PY_DESTDIR)/usr
@@ -184,6 +187,7 @@ clean: distclean
184187
rm -rf $(py_host_dir)
185188
rm -rf $(BUILD_DIR)/external-libraries/*-$(BUILD_TYPE)
186189
-rmdir $(BUILD_DIR)/external-libraries
190+
rm -rf $(PY_EXTDIR)
187191
-rmdir $(BUILD_DIR)
188192
-rmdir $(avd_dir)
189193
rm -rf $(DIST_DIR)/gdb/android-$(ANDROID_API)-$(ANDROID_ARCH)

Android/external-libraries/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SQLITE := sqlite3
66
SQLITE_FNAME := sqlite-autoconf-3080803
77
LIBFFI := libffi-3.2.1
88
BUILD_DIR := $(BUILD_DIR)/external-libraries
9-
py_install_dir := $(PY_DESTDIR)/$(SYS_EXEC_PREFIX)
9+
py_install_dir := $(PY_EXTDIR)/$(SYS_EXEC_PREFIX)
1010

1111
all: $(py_install_dir)/lib/libncursesw.a $(py_install_dir)/lib/libreadline.a \
1212
$(py_install_dir)/lib/libsqlite3.a $(py_install_dir)/lib/libffi.a

Android/external-libraries/Makefile.openssl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export HOSTCC := gcc
1414
export CROSS_COMPILE := $(ANDROID_HOST)-
1515

1616
BUILD_DIR := $(BUILD_DIR)/external-libraries
17-
py_install_dir := $(PY_DESTDIR)/$(SYS_EXEC_PREFIX)
17+
py_install_dir := $(PY_EXTDIR)/$(SYS_EXEC_PREFIX)
1818
BUILD_OPENSSL := $(py_install_dir)/lib/libcrypto.so
1919
ifeq ($(ANDROID_ARCH), x86)
2020
export MACHINE := i686

0 commit comments

Comments
 (0)