Skip to content

Commit 68db618

Browse files
committed
AFic linux build.
1 parent 1b41a1b commit 68db618

2 files changed

Lines changed: 36 additions & 48 deletions

File tree

Modules/Setup

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ PYTHONPATH=$(COREPYTHONPATH)
127127
# detail; also note that *static* or *disabled* cancels this effect):
128128

129129
#*shared*
130+
*static*
130131

131132
# Modules that should always be present (POSIX and Windows):
132133

@@ -211,11 +212,8 @@ zlib zlibmodule.c -l:libz.a
211212
#_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) -lcrypto
212213

213214
# To statically link OpenSSL:
214-
_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \
215-
-l:libssl.a \
216-
-l:libcrypto.a
217-
_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \
218-
-l:libcrypto.a
215+
_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) -l:libssl.a -l:libcrypto.a
216+
_hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) -l:libcrypto.a
219217

220218
# The _tkinter module.
221219
#
@@ -228,37 +226,7 @@ _hashlib _hashopenssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) \
228226
# done by the shell's "read" command and it may not be implemented on
229227
# every system.
230228

231-
# *** Always uncomment this (leave the leading underscore in!):
232-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT $(TCLTK_INCLUDES) $(TCLTK_LIBS) \
233-
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
234-
# -L/usr/local/lib \
235-
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
236-
# -I/usr/include/tcl8.6 \
237-
# *** Uncomment and edit to reflect where your X11 header files are:
238-
# -I/usr/X11R6/include \
239-
# *** Or uncomment this for Solaris:
240-
# -I/usr/openwin/include \
241-
# *** Uncomment and edit for Tix extension only:
242-
# -DWITH_TIX -ltix8.1.8.2 \
243-
# *** Uncomment and edit for BLT extension only:
244-
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
245-
# *** Uncomment and edit for PIL (TkImaging) extension only:
246-
# (See http://www.pythonware.com/products/pil/ for more info)
247-
# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
248-
# *** Uncomment and edit for TOGL extension only:
249-
# -DWITH_TOGL togl.c \
250-
# *** Uncomment and edit to reflect your Tcl/Tk versions:
251-
-l:libtk8.6.a -l:libtcl8.6.a \
252-
# *** Uncomment and edit to reflect where your X11 libraries are:
253-
# -L/usr/X11R6/lib \
254-
# *** Or uncomment this for Solaris:
255-
# -L/usr/openwin/lib \
256-
# *** Uncomment these for TOGL extension only:
257-
# -lGL -lGLU -lXext -lXmu \
258-
# *** Uncomment for AIX:
259-
# -lld \
260-
# *** Always uncomment this; X11 libraries to link with:
261-
-l:libX11.a -l:libxcb.a -l:libXss.a -l:libfontconfig.a -l:libXft.a -l:libXext.a -l:libXrandr.a -l:libXau.a -l:libXrender.a -l:libXdmcp.a -l:libfreetype.a -l:libexpat.a -l:libpng.a -l:libharfbuzz.a -l:libX11.a -l:libxcb.a
229+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT $(TCLTK_INCLUDES) $(TCLTK_LIBS) -l:libtk8.6.a -l:libtcl8.6.a -l:libX11.a -l:libxcb.a -l:libXss.a -l:libfontconfig.a -l:libXft.a -l:libXext.a -l:libXrandr.a -l:libXau.a -l:libXrender.a -l:libXdmcp.a -l:libfreetype.a -l:libexpat.a -l:libpng.a -l:libharfbuzz.a -l:libX11.a -l:libxcb.a
262230

263231
# Some system have -lcurses
264232
_curses -l:libncursesw.a _cursesmodule.c
@@ -310,6 +278,20 @@ nis
310278
_ctypes_test
311279
ossaudiodev
312280
xxlimited
281+
-lcrypto
282+
-lssl
283+
-ltk8.6
284+
-lz
285+
_sqlite3
286+
_testclinic
287+
_testclinic_limited
288+
_testinternalcapi
289+
_testlimitedcapi
290+
_uuid
291+
xxlimited_35
292+
xxsubtype
293+
_gdbm
294+
readline
313295
#_lzma
314296
#
315297
# _sqlite3 _tkinter _curses pyexpat

build.sh

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ download_file() {
8383
return 1
8484
}
8585

86-
if [ ! -d ncurses-6.4 ]; then
87-
download_file https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz ncurses.tar.gz
86+
if [ ! -d ncurses-6.5 ]; then
87+
download_file https://ftp.gnu.org/gnu/ncurses/ncurses-6.5.tar.gz ncurses.tar.gz
8888
tar -xf ncurses.tar.gz
89-
cd ncurses-6.4
89+
cd ncurses-6.5
9090
./configure --prefix=${PREFIX} --disable-shared --enable-termcap --enable-widec --enable-getcap --without-cxx-binding
9191
make libs -j$(nproc --all)
9292
make install.libs install.includes
@@ -342,10 +342,10 @@ make install
342342
cd ..
343343
fi
344344

345-
if [ ! -d tcl8.6.13 ]; then
346-
download_file http://downloads.sourceforge.net/project/tcl/Tcl/8.6.13/tcl8.6.13-src.tar.gz tcl.tar.gz
345+
if [ ! -d tcl8.6.15 ]; then
346+
download_file http://downloads.sourceforge.net/project/tcl/Tcl/8.6.15/tcl8.6.15-src.tar.gz tcl.tar.gz
347347
tar -xf tcl.tar.gz
348-
cd tcl8.6.13
348+
cd tcl8.6.15
349349
rm -rf pkgs/tdbc* pkgs/sqlite*
350350
cd unix
351351
./configure --prefix=${PREFIX} --enable-shared=no --enable-threads
@@ -364,10 +364,10 @@ make install
364364
cd ..
365365
fi
366366

367-
if [ ! -d tk8.6.13 ]; then
368-
download_file http://downloads.sourceforge.net/project/tcl/Tcl/8.6.13/tk8.6.13-src.tar.gz tk.tar.gz
367+
if [ ! -d tk8.6.15 ]; then
368+
download_file http://downloads.sourceforge.net/project/tcl/Tcl/8.6.15/tk8.6.15-src.tar.gz tk.tar.gz
369369
tar -xf tk.tar.gz
370-
cd tk8.6.13/unix
370+
cd tk8.6.15/unix
371371
./configure --prefix=${PREFIX} --enable-shared=no --enable-threads --with-tcl=${PREFIX}/lib
372372
make -j$(nproc --all) "X11_LIB_SWITCHES=-l:libX11.a -l:libxcb.a -l:libXss.a -l:libfontconfig.a -l:libXft.a -l:libXext.a -l:libXrandr.a -l:libXau.a -l:libXrender.a -l:libXdmcp.a -l:libfreetype.a -l:libexpat.a -l:libpng.a -l:libharfbuzz.a -l:libX11.a -l:libxcb.a -l:libbz2.a"
373373
make install
@@ -432,18 +432,23 @@ make -j $(nproc --all) \
432432
EXTRA_CFLAGS="-flto -fuse-linker-plugin -fno-fat-lto-objects" \
433433
profile-opt
434434

435-
make build_all_merge_profile
436-
437435
# Delayed deletion of old installation, to avoid having it not there for testing purposes
438436
# while compiling, which is slow due to PGO beign applied.
439-
$ELEVATE rm -rf "$target" && $ELEVATE make install
437+
$ELEVATE rm -rf "$target" && $ELEVATE make libinstall install
438+
439+
rm pybuilddir.txt
440440

441441
# Make sure to have pip installed, might even remove it afterwards, Debian
442442
# e.g. doesn't include it.
443443
$ELEVATE mv "$target/lib/python${long_version}/pip.py" "$target/lib/python${long_version}/pip.py.bak" && \
444444
$ELEVATE "$target/bin/python${long_version}" -m ensurepip && \
445445
$ELEVATE mv "$target/lib/python${long_version}/pip.py.bak" "$target/lib/python${long_version}/pip.py"
446446

447+
# Copy embedded data
448+
$ELEVATE mv ${PREFIX}/lib/libmp_embed.a "$target/lib/libmp_embed.a"
449+
450+
cp -v Modules/_hacl/libHacl_Hash_SHA2.a "$target/lib/"
451+
447452
$ELEVATE mkdir -p "$target/Embedded"
448453
# The object file usually gets deleted during the build, so make sure to recompile here just in case.
449454
rm -f Embedded/mp_embed.o
@@ -474,5 +479,6 @@ $ELEVATE ln -s base "$target/dependency_libs/xtrans"
474479
$ELEVATE ln -s base "$target/dependency_libs/xz"
475480
$ELEVATE ln -s base "$target/dependency_libs/zlib"
476481

482+
find "$target" \( -iname '*.la' -o -iname '*.pc' -o -iname '__pycache__' -o -iname 'link.json' \) | xargs $ELEVATE rm -rf
477483

478484
$ELEVATE "$target/bin/python${long_version}" -m rebuildpython

0 commit comments

Comments
 (0)