parent
bbcee244e8
commit
b055c8df62
@ -0,0 +1,55 @@
|
||||
python_version := 3.7.0
|
||||
python_tarball := Python-$(python_version).tar.xz
|
||||
python_tarball_path := src/$(python_tarball)
|
||||
build_dir := build/$(arch)
|
||||
python_dir := $(build_dir)/Python-$(python_version)
|
||||
prefix := $(arch)-linux-musl-
|
||||
prefix_dir := build/$(arch)/target
|
||||
bin_unstripped := $(prefix_dir)/bin/python3.7_unstripped
|
||||
bin := $(prefix_dir)/bin/python3.7
|
||||
|
||||
|
||||
ifeq ($(arch), mipsel)
|
||||
prefix := mipsel-linux-musln32-
|
||||
endif
|
||||
|
||||
cc := $(prefix)gcc
|
||||
strip := $(prefix)strip
|
||||
|
||||
$(python_tarball_path):
|
||||
wget https://www.python.org/ftp/python/$(python_version)/$(python_tarball) -O $(python_tarball_path)
|
||||
|
||||
$(python_dir): $(python_tarball_path)
|
||||
mkdir -p $(build_dir)
|
||||
cd $(build_dir) && tar xvf ../../$(python_tarball_path)
|
||||
|
||||
$(bin): $(python_dir)
|
||||
cd $(python_dir) && ./configure \
|
||||
CC=$(cc) \
|
||||
--host=$(arch)-linux-musl \
|
||||
--target=$(arch)-linux-musl \
|
||||
--build=x86_64-linux-gnu \
|
||||
--disable-ipv6 \
|
||||
--without-ensurepip \
|
||||
ac_cv_file__dev_ptmx=no \
|
||||
ac_cv_file__dev_ptc=no \
|
||||
ac_cv_have_long_long_format=yes \
|
||||
--prefix=`realpath ../target`
|
||||
|
||||
cd $(python_dir) && make -j8 build_all
|
||||
mkdir -p $(prefix_dir)
|
||||
cd $(python_dir) && make -j8 altinstall
|
||||
|
||||
# $(bin_unstripped): $(prefix_dir)/bin/python3.7
|
||||
# cp $(bin) $(bin_unstripped)
|
||||
|
||||
# $(bin): $(bin_unstripped)
|
||||
# cp $(bin_unstripped) $(bin)
|
||||
# $(strip) $(bin)
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
all: $(bin)
|
||||
|
||||
clean:
|
||||
rm -rf build/$(arch)
|
@ -0,0 +1 @@
|
||||
*.tar.xz
|
Loading…
Reference in new issue