Skip to content

Commit 1033bb3

Browse files
committed
unix: define OpenSSL build target in YAML config
I think it makes more sense to be defined here.
1 parent 1717c76 commit 1033bb3

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

cpython-unix/build-openssl.sh

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,6 @@ EXTRA_TARGET_CFLAGS=${EXTRA_TARGET_CFLAGS/\-arch x86_64/}
3030

3131
EXTRA_FLAGS="${EXTRA_FLAGS} ${EXTRA_TARGET_CFLAGS}"
3232

33-
if [ "${TARGET_TRIPLE}" = "x86_64-apple-darwin" ]; then
34-
OPENSSL_TARGET=darwin64-x86_64-cc
35-
elif [ "${TARGET_TRIPLE}" = "x86_64-apple-ios" ]; then
36-
OPENSSL_TARGET=darwin64-x86_64-cc
37-
elif [ "${TARGET_TRIPLE}" = "aarch64-apple-darwin" ]; then
38-
OPENSSL_TARGET=darwin64-arm64-cc
39-
elif [ "${TARGET_TRIPLE}" = "aarch64-apple-ios" ]; then
40-
OPENSSL_TARGET=ios64-cross
41-
elif [ "${TARGET_TRIPLE}" = "arm64-apple-tvos" ]; then
42-
OPENSSL_TARGET=tvos64-cross
43-
elif [ "${TARGET_TRIPLE}" = "x86_64-unknown-linux-gnu" ]; then
44-
OPENSSL_TARGET=linux-x86_64
45-
else
46-
echo "Error: unsupported target"
47-
exit 1
48-
fi
49-
5033
/usr/bin/perl ./Configure --prefix=/tools/deps ${OPENSSL_TARGET} no-shared no-tests ${EXTRA_FLAGS}
5134

5235
make -j ${NUM_CPUS}

cpython-unix/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ def simple_build(
278278

279279
add_target_env(env, host_platform, target_triple, build_env)
280280

281+
if entry == "openssl":
282+
settings = get_targets(TARGETS_CONFIG)[target_triple]
283+
env["OPENSSL_TARGET"] = settings["openssl_target"]
284+
281285
build_env.run("build-%s.sh" % entry, environment=env)
282286

283287
build_env.get_tools_archive(dest_archive, "deps")

cpython-unix/targets.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#
77
# needs
88
# Packages required to build Python.
9+
#
10+
# openssl_target
11+
# Name of OpenSSL platform build target.
912

1013
---
1114
aarch64-apple-darwin:
@@ -21,6 +24,7 @@ aarch64-apple-darwin:
2124
- uuid
2225
- xz
2326
- zlib
27+
openssl_target: darwin64-arm64-cc
2428

2529
aarch64-apple-ios:
2630
host_platforms:
@@ -31,6 +35,7 @@ aarch64-apple-ios:
3135
- sqlite
3236
- xz
3337
- zlib
38+
openssl_target: ios64-cross
3439

3540
arm64-apple-tvos:
3641
host_platforms:
@@ -40,6 +45,7 @@ arm64-apple-tvos:
4045
- sqlite
4146
- xz
4247
- zlib
48+
openssl_target: todo
4349

4450
thumb7k-apple-watchos:
4551
host_platforms:
@@ -49,6 +55,7 @@ thumb7k-apple-watchos:
4955
- sqlite
5056
- xz
5157
- zlib
58+
openssl_target: todo
5259

5360
x86_64-apple-darwin:
5461
host_platforms:
@@ -63,6 +70,7 @@ x86_64-apple-darwin:
6370
- uuid
6471
- xz
6572
- zlib
73+
openssl_target: darwin64-x86_64-cc
6674

6775
x86_64-apple-ios:
6876
host_platforms:
@@ -73,6 +81,7 @@ x86_64-apple-ios:
7381
- sqlite
7482
- xz
7583
- zlib
84+
openssl_target: darwin64-x86_64-cc
7685

7786
x86_64-apple-tvos:
7887
host_platforms:
@@ -81,6 +90,7 @@ x86_64-apple-tvos:
8190
- bzip2
8291
- sqlite
8392
- xz
93+
openssl_target: todo
8494

8595
x86_64-apple-watchos:
8696
host_platforms:
@@ -90,6 +100,7 @@ x86_64-apple-watchos:
90100
- sqlite
91101
- xz
92102
- zlib
103+
openssl_target: todo
93104

94105
x86_64-unknown-linux-gnu:
95106
host_platforms:
@@ -115,6 +126,7 @@ x86_64-unknown-linux-gnu:
115126
- xorgproto
116127
- xz
117128
- zlib
129+
openssl_target: linux-x86_64
118130

119131
x86_64-unknown-linux-musl:
120132
host_platforms:
@@ -141,3 +153,4 @@ x86_64-unknown-linux-musl:
141153
- xorgproto
142154
- xz
143155
- zlib
156+
openssl_target: unsupported

0 commit comments

Comments
 (0)