MCPcopy Index your code
hub / github.com/python/cpython / build_universal_openssl

Function build_universal_openssl

Mac/BuildScript/build-installer.py:819–949  ·  view source on GitHub ↗

Special case build recipe for universal build of openssl. The upstream OpenSSL build system does not directly support OS X universal builds. We need to build each architecture separately then lipo them together into fat libraries.

(basedir, archList)

Source from the content-addressed store, hash-verified

817 fatal('%s checksum mismatch for file %s' % (algo, fname))
818
819def build_universal_openssl(basedir, archList):
820 """
821 Special case build recipe for universal build of openssl.
822
823 The upstream OpenSSL build system does not directly support
824 OS X universal builds. We need to build each architecture
825 separately then lipo them together into fat libraries.
826 """
827
828 # OpenSSL fails to build with Xcode 2.5 (on OS X 10.4).
829 # If we are building on a 10.4.x or earlier system,
830 # unilaterally disable assembly code building to avoid the problem.
831 no_asm = int(platform.release().split(".")[0]) < 9
832
833 def build_openssl_arch(archbase, arch):
834 "Build one architecture of openssl"
835 arch_opts = {
836 "i386": ["darwin-i386-cc"],
837 "x86_64": ["darwin64-x86_64-cc", "enable-ec_nistp_64_gcc_128"],
838 "arm64": ["darwin64-arm64-cc"],
839 "ppc": ["darwin-ppc-cc"],
840 "ppc64": ["darwin64-ppc-cc"],
841 }
842
843 # Somewhere between OpenSSL 1.1.0j and 1.1.1c, changes cause the
844 # "enable-ec_nistp_64_gcc_128" option to get compile errors when
845 # building on our 10.6 gcc-4.2 environment. There have been other
846 # reports of projects running into this when using older compilers.
847 # So, for now, do not try to use "enable-ec_nistp_64_gcc_128" when
848 # building for 10.6.
849 if getDeptargetTuple() == (10, 6):
850 arch_opts['x86_64'].remove('enable-ec_nistp_64_gcc_128')
851
852 configure_opts = [
853 "no-idea",
854 "no-mdc2",
855 "no-rc5",
856 "no-zlib",
857 "no-ssl3",
858 # "enable-unit-test",
859 "shared",
860 "--prefix=%s"%os.path.join("/", *FW_VERSION_PREFIX),
861 "--openssldir=%s"%os.path.join("/", *FW_SSL_DIRECTORY),
862 ]
863 if no_asm:
864 configure_opts.append("no-asm")
865 runCommand(" ".join(["perl", "Configure"]
866 + arch_opts[arch] + configure_opts))
867 runCommand("make depend")
868 runCommand("make all")
869 runCommand("make install_sw DESTDIR=%s"%shellQuote(archbase))
870 # runCommand("make test")
871 return
872
873 srcdir = os.getcwd()
874 universalbase = os.path.join(srcdir, "..",
875 os.path.basename(srcdir) + "-universal")
876 os.mkdir(universalbase)

Callers

nothing calls this directly

Calls 12

build_openssl_archFunction · 0.85
grepValueFunction · 0.85
runCommandFunction · 0.85
shellQuoteFunction · 0.85
splitMethod · 0.45
releaseMethod · 0.45
joinMethod · 0.45
basenameMethod · 0.45
mkdirMethod · 0.45
appendMethod · 0.45
replaceMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…