Skip to content

Commit 91ccdd2

Browse files
committed
Created Python static compilation files & configuration
1 parent 0b05ead commit 91ccdd2

File tree

3 files changed

+36
-22
lines changed

3 files changed

+36
-22
lines changed

Modules/Setup.stdlib.in

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -159,25 +159,3 @@
159159

160160
# _scproxy needs SystemConfiguration and CoreFoundation framework
161161
@MODULE__SCPROXY_TRUE@_scproxy _scproxy.c
162-
163-
164-
############################################################################
165-
# Test modules
166-
167-
@MODULE_XXSUBTYPE_TRUE@xxsubtype xxsubtype.c
168-
@MODULE__XXTESTFUZZ_TRUE@_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
169-
@MODULE__TESTBUFFER_TRUE@_testbuffer _testbuffer.c
170-
@MODULE__TESTINTERNALCAPI_TRUE@_testinternalcapi _testinternalcapi.c
171-
@MODULE__TESTCAPI_TRUE@_testcapi _testcapimodule.c _testcapi/vectorcall.c _testcapi/vectorcall_limited.c _testcapi/heaptype.c _testcapi/abstract.c _testcapi/bytearray.c _testcapi/bytes.c _testcapi/unicode.c _testcapi/dict.c _testcapi/set.c _testcapi/list.c _testcapi/tuple.c _testcapi/getargs.c _testcapi/pytime.c _testcapi/datetime.c _testcapi/docstring.c _testcapi/mem.c _testcapi/watchers.c _testcapi/long.c _testcapi/float.c _testcapi/complex.c _testcapi/numbers.c _testcapi/structmember.c _testcapi/exceptions.c _testcapi/code.c _testcapi/buffer.c _testcapi/pyos.c _testcapi/run.c _testcapi/file.c _testcapi/codec.c _testcapi/immortal.c _testcapi/heaptype_relative.c _testcapi/gc.c _testcapi/sys.c
172-
@MODULE__TESTCLINIC_TRUE@_testclinic _testclinic.c
173-
174-
# Some testing modules MUST be built as shared libraries.
175-
*shared*
176-
@MODULE__TESTIMPORTMULTIPLE_TRUE@_testimportmultiple _testimportmultiple.c
177-
@MODULE__TESTMULTIPHASE_TRUE@_testmultiphase _testmultiphase.c
178-
@MODULE__TESTMULTIPHASE_TRUE@_testsinglephase _testsinglephase.c
179-
@MODULE__CTYPES_TEST_TRUE@_ctypes_test _ctypes/_ctypes_test.c
180-
181-
# Limited API template modules; must be built as shared modules.
182-
@MODULE_XXLIMITED_TRUE@xxlimited xxlimited.c
183-
@MODULE_XXLIMITED_35_TRUE@xxlimited_35 xxlimited_35.c

compile_static.bash

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
export LIBS="-lc -lgcc"
4+
export LDFLAGS="-static"
5+
export LINKFORSHARED=" "
6+
7+
export MODULE_BUILDTYPE="static"
8+
export CONFIG_SITE="config.site-static"
9+
10+
CROSS_COMPILE_PREFIX="${CROSS_COMPILE_PREFIX:-x86_64-linux-gnu}"
11+
12+
./configure \
13+
-C \
14+
--disable-test-modules \
15+
--with-ensurepip=no \
16+
--without-decimal-contextvar \
17+
--build=x86_64-pc-linux-gnu \
18+
--host="${CROSS_COMPILE_PREFIX}" \
19+
--with-build-python=/usr/bin/python3.12 \
20+
--disable-ipv6 \
21+
--disable-shared
22+
23+
make -j $(nproc)

config.site-static

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ac_cv_buggy_getaddrinfo=no
2+
ac_cv_file__dev_ptmx=yes
3+
ac_cv_file__dev_ptc=no
4+
py_cv_module__decimal=n/a
5+
py_cv_module__ctypes=n/a
6+
py_cv_module__curses=n/a
7+
py_cv_module__curses_panel=n/a
8+
py_cv_module_zlib=n/a
9+
py_cv_module_binascii=n/a
10+
py_cv_module_xxlimited=n/a
11+
py_cv_module_pyexpat=n/a
12+
py_cv_module__sha2=n/a
13+
py_cv_module__crypt=n/a

0 commit comments

Comments
 (0)