使用 openssl 支持构建 python

DTS*_*ode 5 compiling python openssl

我有以下目录结构:

nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la
2to3               cpp-5.3.0            gcov-5.3.0           grmid-5.3.0         objcopy-2.25.1    python3.5-config      .sources
2to3-3.5           elfedit-2.25.1       gcov-tool-5.3.0      grmiregistry-5.3.0  objdump-2.25.1    python3.5m            strings-2.25.1
addr2line-2.25.1   g++-5.3.0            gfortran-5.3.0       gserialver-5.3.0    pydoc             python3.5m-config     strip-2.25.1
aot-compile-5.3.0  gappletviewer-5.3.0  gij-5.3.0            gtnameserv-5.3.0    pydoc3            python3-config        x86_64-unknown-linux-gnu-c++-5.3.0
ar-2.25.1          gc-analyze-5.3.0     gjar-5.3.0           idle                pydoc3.5          python-config         x86_64-unknown-linux-gnu-g++-5.3.0
.archives          gcc-5.3.0            gjarsigner-5.3.0     idle3               python            pyvenv                x86_64-unknown-linux-gnu-gcc-5.3.0
as-2.25.1          gcc-ar-5.3.0         gjavah-5.3.0         idle3.5             python2           pyvenv-3.5            x86_64-unknown-linux-gnu-gcc-ar-5.3.0
bash               gcc-nm-5.3.0         gkeytool-5.3.0       jcf-dump-5.3.0      python2.7         ranlib-2.25.1         x86_64-unknown-linux-gnu-gcc-nm-5.3.0
.binaries          gcc-ranlib-5.3.0     gnative2ascii-5.3.0  jv-convert-5.3.0    python2.7-config  readelf-2.25.1        x86_64-unknown-linux-gnu-gcc-ranlib-5.3.0
.build             gcj-5.3.0            gorbd-5.3.0          ld-2.25.1           python2-config    rebuild-gcj-db-5.3.0  x86_64-unknown-linux-gnu-gcj-5.3.0
c++-5.3.0          gcj-dbtool-5.3.0     gprof-2.25.1         ld.bfd-2.25.1       python3           size-2.25.1           x86_64-unknown-linux-gnu-gfortran-5.3.0
c++filt-2.25.1     gcjh-5.3.0           grmic-5.3.0          nm-2.25.1           python3.5         smtpd.py
nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la .sources/
bash-4.4-beta  binutils-2.25.1  boost_1_60_0  gcc-5.3.0  Python-2.7.11  Python-3.5.1
nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la .build/
bash-4.4-beta  binutils-2.25.1  boost_1_60_0  gcc-5.3.0  Python-2.7.11  Python-3.5.1
nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la .binaries/
bash-4.4-beta  binutils-2.25.1  boost_1_60_0  gcc-5.3.0  Python-2.7.11  Python-3.5.1
nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ 
Run Code Online (Sandbox Code Playgroud)

通常,tar 球进入.archives,未打包的源进入.sources,构建发生在 中.build,最终的二进制文件存储在.binaries. 然后我将二进制文件符号链接.binaries~/mini-bin我的 $PATH 上。我知道这是一个奇怪的工作流程,但它对我有用。无论如何,我希望从源代码重建 python-2.7.11(和 3.4.0,但从 2.7.11 开始)。它在我的系统上构建得很好,但我需要使用 ncurses、readline、ssl 等支持来构建它。我是否必须从源代码编译这些库?如果是这样,我会把图书馆放在哪里?我如何告诉 python 与它们一起构建。谢谢你,有一个美好的一天!