bpo-43466: Add --with-openssl-rpath configure option (GH-24820) by tiran · Pull Request #24820 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions Doc/using/unix.rst
6 changes: 6 additions & 0 deletions Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,12 @@ Build Changes
and ``--with-tcltk-libs`` configuration options.
(Contributed by Manolis Stamatogiannakis in :issue:`42603`.)

* Add ``--with-openssl-rpath`` option to ``configure`` script. The option
simplifies building Python with a custom OpenSSL installation, e.g.
``./configure --with-openssl=/path/to/openssl --with-openssl-rpath=auto``.
(Contributed by Christian Heimes in :issue:`43466`.)



C API Changes
=============
Expand Down
1 change: 1 addition & 0 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ ENSUREPIP= @ENSUREPIP@
OPENSSL_INCLUDES=@OPENSSL_INCLUDES@
OPENSSL_LIBS=@OPENSSL_LIBS@
OPENSSL_LDFLAGS=@OPENSSL_LDFLAGS@
OPENSSL_RPATH=@OPENSSL_RPATH@

# Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var
TZPATH=@TZPATH@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The ``configure`` script now supports ``--with-openssl-rpath`` option.
26 changes: 16 additions & 10 deletions Tools/ssl/multissltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@
]

OPENSSL_RECENT_VERSIONS = [
"1.1.1g",
# "3.0.0-alpha2"
"1.1.1j",
# "3.0.0-alpha12"
]

LIBRESSL_OLD_VERSIONS = [
"2.9.2",
]

LIBRESSL_RECENT_VERSIONS = [
"3.1.0",
"3.2.4",
]

# store files in ../multissl
Expand Down Expand Up @@ -169,7 +169,9 @@ class AbstractBuilder(object):
url_templates = None
src_template = None
build_template = None
depend_target = None
install_target = 'install'
jobs = os.cpu_count()

module_files = ("Modules/_ssl.c",
"Modules/_hashopenssl.c")
Expand Down Expand Up @@ -321,8 +323,11 @@ def _build_src(self):
if self.system:
env['SYSTEM'] = self.system
self._subprocess_call(cmd, cwd=cwd, env=env)
# Old OpenSSL versions do not support parallel builds.
self._subprocess_call(["make", "-j1"], cwd=cwd, env=env)
if self.depend_target:
self._subprocess_call(
["make", "-j1", self.depend_target], cwd=cwd, env=env
)
self._subprocess_call(["make", f"-j{self.jobs}"], cwd=cwd, env=env)

def _make_install(self):
self._subprocess_call(
Expand Down Expand Up @@ -409,6 +414,7 @@ class BuildOpenSSL(AbstractBuilder):
build_template = "openssl-{}"
# only install software, skip docs
install_target = 'install_sw'
depend_target = 'depend'

def _post_install(self):
if self.version.startswith("3.0"):
Expand All @@ -434,11 +440,11 @@ def _post_install_300(self):
self.openssl_cli, "fipsinstall",
"-out", fipsinstall_cnf,
"-module", fips_mod,
"-provider_name", "fips",
"-mac_name", "HMAC",
"-macopt", "digest:SHA256",
"-macopt", "hexkey:00",
"-section_name", "fips_sect"
# "-provider_name", "fips",
# "-mac_name", "HMAC",
# "-macopt", "digest:SHA256",
# "-macopt", "hexkey:00",
# "-section_name", "fips_sect"
]
)
with open(openssl_fips_cnf, "w") as f:
Expand Down
80 changes: 74 additions & 6 deletions aclocal.m4
Loading