()
| 1131 | |
| 1132 | |
| 1133 | def buildPython(): |
| 1134 | print("Building a universal python for %s architectures" % UNIVERSALARCHS) |
| 1135 | |
| 1136 | buildDir = os.path.join(WORKDIR, '_bld', 'python') |
| 1137 | rootDir = os.path.join(WORKDIR, '_root') |
| 1138 | |
| 1139 | if os.path.exists(buildDir): |
| 1140 | shutil.rmtree(buildDir) |
| 1141 | if os.path.exists(rootDir): |
| 1142 | shutil.rmtree(rootDir) |
| 1143 | os.makedirs(buildDir) |
| 1144 | os.makedirs(rootDir) |
| 1145 | os.makedirs(os.path.join(rootDir, 'empty-dir')) |
| 1146 | curdir = os.getcwd() |
| 1147 | os.chdir(buildDir) |
| 1148 | |
| 1149 | # Extract the version from the configure file, needed to calculate |
| 1150 | # several paths. |
| 1151 | version = getVersion() |
| 1152 | |
| 1153 | # Since the extra libs are not in their installed framework location |
| 1154 | # during the build, augment the library path so that the interpreter |
| 1155 | # will find them during its extension import sanity checks. |
| 1156 | |
| 1157 | print("Running configure...") |
| 1158 | print(" NOTE: --with-mimalloc=no pending resolution of weak linking issues") |
| 1159 | runCommand("%s -C --enable-framework --enable-universalsdk=/ " |
| 1160 | "--with-mimalloc=no " |
| 1161 | "--with-system-libmpdec " |
| 1162 | "--with-universal-archs=%s " |
| 1163 | "%s " |
| 1164 | "%s " |
| 1165 | "%s " |
| 1166 | "%s " |
| 1167 | "%s " |
| 1168 | "%s " |
| 1169 | "LDFLAGS='-g -L%s/libraries/usr/local/lib' " |
| 1170 | "CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"%( |
| 1171 | shellQuote(os.path.join(SRCDIR, 'configure')), |
| 1172 | UNIVERSALARCHS, |
| 1173 | (' ', '--with-computed-gotos ')[PYTHON_3], |
| 1174 | (' ', '--without-ensurepip ')[PYTHON_3], |
| 1175 | (' ', "--with-openssl='%s/libraries/usr/local'"%( |
| 1176 | shellQuote(WORKDIR)[1:-1],))[PYTHON_3], |
| 1177 | (' ', "--enable-optimizations --with-lto")[compilerCanOptimize()], |
| 1178 | (' ', "TCLTK_CFLAGS='-I%s/libraries/usr/local/include'"%( |
| 1179 | shellQuote(WORKDIR)[1:-1],))[internalTk()], |
| 1180 | (' ', "TCLTK_LIBS='-L%s/libraries/usr/local/lib -ltcl8.6 -ltk8.6'"%( |
| 1181 | shellQuote(WORKDIR)[1:-1],))[internalTk()], |
| 1182 | shellQuote(WORKDIR)[1:-1], |
| 1183 | shellQuote(WORKDIR)[1:-1])) |
| 1184 | |
| 1185 | # As of macOS 10.11 with SYSTEM INTEGRITY PROTECTION, DYLD_* |
| 1186 | # environment variables are no longer automatically inherited |
| 1187 | # by child processes from their parents. We used to just set |
| 1188 | # DYLD_LIBRARY_PATH, pointing to the third-party libs, |
| 1189 | # in build-installer.py's process environment and it was |
| 1190 | # passed through the make utility into the environment of |
no test coverage detected
searching dependent graphs…