From 863465d8ad95407a59afcefcedafd1124cdede16 Mon Sep 17 00:00:00 2001 From: icanhasmath Date: Wed, 31 Mar 2021 18:14:19 -0400 Subject: [PATCH 1/5] v2.7.18rc1 patched from apy/2.7/* Author: Shaun Lowry Date: Tue Apr 14 13:26:52 2020 -0600 13f5a71819 activepython: Brand Python as ActivePython. Updated 2016 dates to 2020. (ActivePython-branding-2016.patch) d83596b402 activepython: Merge tag 'v2.7.18rc1' into apy/2.7/activepython ef729b98b9 activepython: Brand IDLE shell as ActivePython (branding_idle.patch) 876ce71844 aix: Add /usr/lib to library search path on AIX 99ab051cf1 aix: Drop symbols on AIX systems 73e035d212 aix: (setup.py.aix_exp.patch) Use AIX's .exp file mechanism instead of '-ltcl8.4 -ltk8.4' to avoid problems with .a vs .so for shared object extensions 20aa8b3adf aix: (multiprocessing_aix.patch) 8fbfd004f6 aix: (ld_so_aix.patch) 39a7649918 aix: Patch to fix MemoryError when trying to open files in AIX 64-bit, see http://bugs.python.org/issue6600 (aix_memoryerror_fix.patch, aix_memoryerror_fix2.patch) 0ae86bd418 aix: fix for inline on AIX cc (aix_inline.patch) 3b521b8e8e darwin: (setup.py.openssl_p.patch) *UNSAFE* Link our OpenSSL, originally used only on darwin but thispatch definitely affects all platforms fa77a8ecce nix: Add changes to link zlib into python c1fa334184 nix: (setup.py.bsddb.patch) Link statically to the locally built libdb a395f6de8f nix: (setup.py.tcltk.patch) Use a local Tcl/Tk for '_tkinter' 2583ec7f89 nix: (setup.py.use_usr_local_always.patch) Always use /usr/local f1f76e2943 nix: (setup.py.00.patch) ActivePython builds some external libraries into a private build directory for controlled use by common Python extension modules 93ec4f3db1 nix: (gcc_fPIC_basecflags.patch) Add -fPIC CFLAG for our GCC-based Python builds f34994c8dc solaris: (setup.py.solaris_libc.patch) It has been necessary to explicitly link in libc before libcrypt on Solaris d10bcbc3c6 win32: Can override version of openssl a94d4aaf4c win32: Support downloading externals directly from cpython-source-deps d131fd1972 win32: Update to openssl 1.0.2t 0e90927c50 win32: Update tcl and tk to 8.5.19 for python 2.7.16 cfb346b377 win32: Fix sqlite in props to rebase to 2.7.16 tag f4e295451a win32: Add openssl 1.0.2s 2958e043aa win32: Add openssl 1.0.2q 69ff5017b5 win32: Move python.props patches to win32-extras branch 70d6235b9e win32: Upgrade sqlite3 to 3.24.0.0 e9ea3be35b win32: Replaces git-fetch with s3 URL in get_externals_activestate.bat 13a61c7543 win32: Rev OpenSSL version to 1.0.2o db5ca72aea win32: Bump OpenSSL version 4a35d7d42e win32: (Python-3.5.2-avoid-svn.python.org.patch) Alternate version of get_externals.bat that fetches library tarballs from our repo instead of svn.python.org. The 3.5 version of this patch is used in 2.7 intentionally 87ec200693 win32: (build_bat.patch) Added ActiveState build.bat, which is a copy of 3.5.1 build.bat, to work around x64 failure on Windows (3.5.2 gets confused and fails to find toolset properly) --- Lib/idlelib/PyShell.py | 4 +- Modules/_multiprocessing/multiprocessing.c | 10 + Modules/ld_so_aix.in | 37 ++-- Modules/posixmodule.c | 6 + Modules/signalmodule.c | 12 ++ Objects/fileobject.c | 6 + PCbuild/build_activestate.bat | 110 +++++++++++ PCbuild/get_externals_activestate.bat | 84 +++++++++ Python/getcopyright.c | 2 + configure | 11 +- configure.ac | 8 +- setup.py | 207 ++++++++++++++------- 12 files changed, 407 insertions(+), 90 deletions(-) create mode 100644 PCbuild/build_activestate.bat create mode 100644 PCbuild/get_externals_activestate.bat diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 2ea7e6b939a637..939d75d9ee57ef 100755 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1052,7 +1052,9 @@ def begin(self): return False else: nosub = "==== No Subprocess ====" - self.write("Python %s on %s\n%s\n%s" % + self.write( + ("ActivePython PT_CONFIG_fullver (ActiveState Software Inc.) " + \ + "based on\nPython %s on %s\n%s\n%s") % (sys.version, sys.platform, self.COPYRIGHT, nosub)) self.text.focus_force() self.showprompt() diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c index eecace887e6270..39300ef6166a85 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -14,6 +14,16 @@ #define HAVE_FD_TRANSFER 0 #endif +#ifndef _CMSG_ALIGN +#define _CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & ~(sizeof (size_t) - 1)) +#endif +#ifndef CMSG_SPACE +#define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len)) +#endif +#ifndef CMSG_LEN +#define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) +#endif + PyObject *create_win32_namespace(void); PyObject *pickle_dumps, *pickle_loads, *pickle_protocol; diff --git a/Modules/ld_so_aix.in b/Modules/ld_so_aix.in index e8e98b142faf09..53ca57cc2ffa63 100644 --- a/Modules/ld_so_aix.in +++ b/Modules/ld_so_aix.in @@ -85,10 +85,6 @@ if test ! -n "$*"; then echo $usage; exit 2 fi -# Default import file for Python -# Can be overridden by providing a -bI: argument. -impfile="./python.exp" - # Parse arguments while test -n "$1" do @@ -114,7 +110,15 @@ do objfile=`echo $1 | sed "s/-o//"` ;; -bI:* | -Wl,-bI:*) - impfile=`echo $1 | sed -e "s/-Wl,//" -e "s/-bI://"` + if test -z "$impfile"; then + # The first -bI:* is specially processed. + impfile=`echo $1 | sed -e "s/-Wl,//" -e "s/-bI://"` + else + #args="$args -Wl,$1" + x=`echo $1 | sed -e "s/-Wl,//" -e "s/-bI://"` + x=`dirname $x`/`basename $x .exp`.so + args="$args $x" + fi ;; -bE:* | -Wl,-bE:*) expfile=`echo $1 | sed -e "s/-Wl,//" -e "s/-bE://"` @@ -136,6 +140,11 @@ if test "$objfile" = "libpython@VERSION@.so"; then ldsocoremode="true" fi +# Default import file for Python +# Can be overriden by providing a -bI: argument. +if test -z "$impfile"; then + impfile="./python.exp" +fi if test -z "$objs"; then echo "ld_so_aix: No input files; exiting." exit 2 @@ -162,13 +171,13 @@ if test -z "$entry"; then entry=init`echo $filename | sed "s/module.*//"` fi -#echo "ld_so_aix: Debug info section" -#echo " -> output file : $objfile" -#echo " -> import file : $impfile" -#echo " -> export file : $expfile" -#echo " -> entry point : $entry" -#echo " -> object files: $objs" -#echo " -> CC arguments: $args" +echo "ld_so_aix: Debug info section" +echo " -> output file : $objfile" +echo " -> import file : $impfile" +echo " -> export file : $expfile" +echo " -> entry point : $entry" +echo " -> object files: $objs" +echo " -> CC arguments: $args" if test -z "$ldsocoremode"; then CCOPT="-Wl,-e$entry -Wl,-bE:$expfile -Wl,-bI:$impfile -Wl,-bhalt:4" @@ -184,7 +193,9 @@ CCARGS="$args" $makexp $expfile "$objfile" $objs # Perform the link. -#echo $CC $CCOPT $CCARGS +echo %%%%%%%%%%%%%%%%%%%%%% +echo $CC -L/usr/lib $CCOPT $CCARGS +echo %%%%%%%%%%%%%%%%%%%%%% $CC $CCOPT $CCARGS retval=$? diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7a1a6945c102eb..d25abe0e2305e4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6901,7 +6901,13 @@ posix_fdopen(PyObject *self, PyObject *args) return NULL; /* Sanitize mode. See fileobject.c */ +#ifdef _AIX + /* Patch to fix MemoryError when trying to open files in AIX 64-bit + See http://bugs.python.org/issue6600 */ + mode = PyMem_MALLOC(3+strlen(orgmode)); +#else mode = PyMem_MALLOC(strlen(orgmode)+3); +#endif if (!mode) { PyErr_NoMemory(); return NULL; diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 88b471193214d5..8aa7e56b0a185e 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -81,6 +81,18 @@ static long main_thread; static pid_t main_pid; #endif +/* Code copied from _hotshot.c. Aix's cc dislikes inline in the function definitions. */ +#if !defined(__cplusplus) && !defined(inline) +#ifdef __GNUC__ +#define inline __inline +#endif +#endif + +#ifndef inline +#define inline +#endif + + static struct { int tripped; PyObject *func; diff --git a/Objects/fileobject.c b/Objects/fileobject.c index b524f09e0a396e..5aacd11fb1638c 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -336,7 +336,13 @@ open_the_file(PyFileObject *f, char *name, char *mode) assert(f->f_fp == NULL); /* probably need to replace 'U' by 'rb' */ +#ifdef _AIX + /* Patch to fix MemoryError when trying to open files in AIX 64-bit + See http://bugs.python.org/issue6600 */ + newmode = PyMem_MALLOC(3 + strlen(mode)); +#else newmode = PyMem_MALLOC(strlen(mode) + 3); +#endif if (!newmode) { PyErr_NoMemory(); return NULL; diff --git a/PCbuild/build_activestate.bat b/PCbuild/build_activestate.bat new file mode 100644 index 00000000000000..00607c44b82d2d --- /dev/null +++ b/PCbuild/build_activestate.bat @@ -0,0 +1,110 @@ +@echo off +goto Run +:Usage +echo.%~nx0 [flags and arguments] [quoted MSBuild options] +echo. +echo.Build CPython from the command line. Requires the appropriate +echo.version(s) of Microsoft Visual Studio to be installed (see readme.txt). +echo.Also requires Subversion (svn.exe) to be on PATH if the '-e' flag is +echo.given. +echo. +echo.After the flags recognized by this script, up to 9 arguments to be passed +echo.directly to MSBuild may be passed. If the argument contains an '=', the +echo.entire argument must be quoted (e.g. `%~nx0 "/p:PlatformToolset=v100"`) +echo. +echo.Available flags: +echo. -h Display this help message +echo. -V Display version information for the current build +echo. -r Target Rebuild instead of Build +echo. -d Set the configuration to Debug +echo. -e Build external libraries fetched by get_externals.bat +echo. Extension modules that depend on external libraries will not attempt +echo. to build if this flag is not present +echo. -m Enable parallel build (enabled by default) +echo. -M Disable parallel build +echo. -v Increased output messages +echo. -k Attempt to kill any running Pythons before building (usually done +echo. automatically by the pythoncore project) +echo. +echo.Available flags to avoid building certain modules. +echo.These flags have no effect if '-e' is not given: +echo. --no-ssl Do not attempt to build _ssl +echo. --no-tkinter Do not attempt to build Tkinter +echo. --no-bsddb Do not attempt to build _bsddb +echo. +echo.Available arguments: +echo. -c Release ^| Debug ^| PGInstrument ^| PGUpdate +echo. Set the configuration (default: Release) +echo. -p x64 ^| Win32 +echo. Set the platform (default: Win32) +echo. -t Build ^| Rebuild ^| Clean ^| CleanAll +echo. Set the target manually +echo. --test-marker Enable the test marker within the build. +exit /b 127 + +:Run +setlocal +set platf=Win32 +set vs_platf=x86 +set conf=Release +set target=Build +set dir=%~dp0 +set parallel=/m +set verbose=/nologo /v:m +set kill= + +:CheckOpts +if "%~1"=="-h" goto Usage +if "%~1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts +if "%~1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts +if "%~1"=="-r" (set target=Rebuild) & shift & goto CheckOpts +if "%~1"=="-t" (set target=%2) & shift & shift & goto CheckOpts +if "%~1"=="-d" (set conf=Debug) & shift & goto CheckOpts +if "%~1"=="-m" (set parallel=/m) & shift & goto CheckOpts +if "%~1"=="-M" (set parallel=) & shift & goto CheckOpts +if "%~1"=="-v" (set verbose=/v:n) & shift & goto CheckOpts +if "%~1"=="-k" (set kill=true) & shift & goto CheckOpts +if "%~1"=="--test-marker" (set UseTestMarker=true) & shift & goto CheckOpts +if "%~1"=="-V" shift & goto Version +rem These use the actual property names used by MSBuild. We could just let +rem them in through the environment, but we specify them on the command line +rem anyway for visibility so set defaults after this +if "%~1"=="-e" (set IncludeExternals=true) & shift & goto CheckOpts +if "%~1"=="--no-ssl" (set IncludeSSL=false) & shift & goto CheckOpts +if "%~1"=="--no-tkinter" (set IncludeTkinter=false) & shift & goto CheckOpts +if "%~1"=="--no-bsddb" (set IncludeBsddb=false) & shift & goto CheckOpts + +if "%IncludeExternals%"=="" set IncludeExternals=false +if "%IncludeSSL%"=="" set IncludeSSL=true +if "%IncludeTkinter%"=="" set IncludeTkinter=true +if "%IncludeBsddb%"=="" set IncludeBsddb=true + +rem UBS has called get_externals_activestate.bat before running the build +rem if "%IncludeExternals%"=="true" call "%dir%get_externals_activestate.bat" + +if "%platf%"=="x64" (set vs_platf=x86_amd64) + +rem Setup the environment +call "%dir%env.bat" %vs_platf% >nul + +if "%kill%"=="true" ( + msbuild /v:m /nologo /target:KillPython "%dir%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true +) + +rem Call on MSBuild to do the work, echo the command. +rem Passing %1-9 is not the preferred option, but argument parsing in +rem batch is, shall we say, "lackluster" +echo on +msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^ + /p:Configuration=%conf% /p:Platform=%platf%^ + /p:IncludeExternals=%IncludeExternals%^ + /p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^ + /p:IncludeBsddb=%IncludeBsddb%^ + /p:UseTestMarker=%UseTestMarker%^ + %1 %2 %3 %4 %5 %6 %7 %8 %9 + +@goto :eof + +:Version +rem Display the current build version information +msbuild "%dir%python.props" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/PCbuild/get_externals_activestate.bat b/PCbuild/get_externals_activestate.bat new file mode 100644 index 00000000000000..91f6ec37ee6f97 --- /dev/null +++ b/PCbuild/get_externals_activestate.bat @@ -0,0 +1,84 @@ +@echo off +setlocal +rem Simple script to fetch source for external libraries + +if not exist "%~dp0..\externals" mkdir "%~dp0..\externals" +pushd "%~dp0..\externals" + +echo.Fetching external libraries... + +rem *** IMPORTANT *** +rem If updating bzip2, db, nasm, openssl, or sqlite you must also edit their directory names in python.props. +rem If updating tcl/tk/tix you must also update their versions/directories in tcltk.props. + +set default_OpenSSL=1.0.2t +if "%OpenSSL_version%"=="" set OpenSSL_version=%default_OpenSSL% + +set libraries= +set libraries=%libraries% bzip2-1.0.6 +if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0 +if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-%OpenSSL_version% +set libraries=%libraries% sqlite-3.33.0.0 +if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0 +if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0 +if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tix-8.4.3.5 + +rem CAMEL_GIT_SHA contains the commit SHA used for the current build. +rem Note that the branch 'master' in the below URL is ignored by the server because sha is present. + +for %%e in (%libraries%) do ( + if exist %%e ( + echo.%%e already exists, skipping. + ) else ( + echo.Fetching %%e... + call lwp-download https://s3.amazonaws.com/camel-sources/src/vendor-sources/python-core/%%e-pysvn.tar.gz ..\externals\%%e.tar.gz + cd ..\externals + call tar zxf %%e.tar.gz + del %%e.tar.gz + if exist cpython-source-deps-%%e ( + move cpython-source-deps-%%e %%e + ) + cd ..\PCbuild + ) +) + +cd ..\externals +if NOT "%OpenSSL_version%"=="%default_OpenSSL%" ( + if exist openssl-%OpenSSL_version% ( + move openssl-%OpenSSL_version% openssl-%default_OpenSSL% + ) +) +cd ..\PCbuild + +goto end + +:usage +echo.invalid argument: %1 +echo.usage: %~n0 [[ -c ^| --clean ] ^| --clean-only ] +echo. +echo.Pull all sources necessary for compiling optional extension modules +echo.that rely on external libraries. Requires svn.exe to be on your PATH +echo.and pulls sources from %SVNROOT%. +echo. +echo.Use the -c or --clean option to clean up all external library sources +echo.before pulling in the current versions. +echo. +echo.Use the --clean-only option to do the same cleaning, without pulling in +echo.anything new. +echo. +echo.Only the first argument is checked, all others are ignored. +echo. +echo.**WARNING**: the cleaning options unconditionally remove any directory +echo.that is a child of +echo. %CD% +echo.and matches wildcard patterns beginning with bzip2-, db-, nasm-, openssl-, +echo.tcl-, tcltk, tk-, tix-, sqlite-, or xz-, and as such has the potential +echo.to be very destructive if you are not aware of what it is doing. Use with +echo.caution! +popd +exit /b -1 + + +:end +echo Finished. +popd diff --git a/Python/getcopyright.c b/Python/getcopyright.c index 3362ed59842aed..669aa4cd845020 100644 --- a/Python/getcopyright.c +++ b/Python/getcopyright.c @@ -4,6 +4,8 @@ static char cprt[] = "\ +Copyright (c) 2000-2020 ActiveState Software Inc.\n\ +\n\ Copyright (c) 2001-2020 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ diff --git a/configure b/configure index 63d675312da960..54917e303460b1 100755 --- a/configure +++ b/configure @@ -3511,6 +3511,7 @@ EXPORT_MACOSX_DEPLOYMENT_TARGET='#' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --without-gcc" >&5 $as_echo_n "checking for --without-gcc... " >&6; } +DEBUGFLAG='-g' # Check whether --with-gcc was given. if test "${with_gcc+set}" = set; then : withval=$with_gcc; @@ -3526,6 +3527,7 @@ else case $ac_sys_system in AIX*) CC=${CC:-xlc_r} + DEBUGFLAG='' without_gcc=;; BeOS*) case $BE_HOST_CPU in @@ -6018,9 +6020,9 @@ then if test "$Py_DEBUG" = 'true' ; then # Optimization messes up debuggers, so turn it off for # debug builds. - OPT="-g -O0 -Wall $STRICT_PROTO" + OPT="$DEBUGFLAG -O0 -Wall $STRICT_PROTO" else - OPT="-g $WRAP -O3 -Wall $STRICT_PROTO" + OPT="$DEBUGFLAG $WRAP -O3 -Wall $STRICT_PROTO" fi ;; *) @@ -6048,6 +6050,9 @@ UNIVERSAL_ARCH_FLAGS= # tweak BASECFLAGS based on compiler and platform case $GCC in yes) + # ActivePython change: add -fPIC to all GCC builds of Python. + BASECFLAGS="$BASECFLAGS -fPIC" + # Python violates C99 rules, by casting between incompatible # pointer types. GCC may generate bad code as a result of that, # so use -fno-strict-aliasing if supported. @@ -8763,7 +8768,7 @@ $as_echo_n "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in - AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';; + AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld -L/usr/lib';; hp*|HP*) LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; diff --git a/configure.ac b/configure.ac index efe6922b5de25f..6c1225b22578a4 100644 --- a/configure.ac +++ b/configure.ac @@ -551,6 +551,7 @@ EXPORT_MACOSX_DEPLOYMENT_TARGET='#' # XXX shouldn't some/most/all of this code be merged with the stuff later # on that fiddles with OPT and BASECFLAGS? +DEBUGFLAG='-g' AC_MSG_CHECKING(for --without-gcc) AC_ARG_WITH(gcc, AS_HELP_STRING([--without-gcc], [never use gcc]), @@ -565,6 +566,7 @@ AC_ARG_WITH(gcc, esac], [ case $ac_sys_system in AIX*) CC=${CC:-xlc_r} + DEBUGFLAG='' without_gcc=;; BeOS*) case $BE_HOST_CPU in @@ -1090,9 +1092,9 @@ then if test "$Py_DEBUG" = 'true' ; then # Optimization messes up debuggers, so turn it off for # debug builds. - OPT="-g -O0 -Wall $STRICT_PROTO" + OPT="$DEBUGFLAG -O0 -Wall $STRICT_PROTO" else - OPT="-g $WRAP -O3 -Wall $STRICT_PROTO" + OPT="$DEBUGFLAG $WRAP -O3 -Wall $STRICT_PROTO" fi ;; *) @@ -2339,7 +2341,7 @@ AC_MSG_CHECKING(LINKFORSHARED) if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in - AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';; + AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld -L/usr/lib';; hp*|HP*) LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; diff --git a/setup.py b/setup.py index f764223d0627ce..d96942a1455d37 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,13 @@ def get_platform(): return sys.platform host_platform = get_platform() +# ActivePython change: +# ActivePython builds some external libraries into a private build +# directory for controlled use by common Python extension modules. +apy_prefix_dir = r"PT_CONFIG_build_prefix_abs_dir" +apy_inc_dir = os.path.join(apy_prefix_dir, "include") +apy_lib_dir = os.path.join(apy_prefix_dir, "lib") + # Were we compiled --with-pydebug or with #define Py_DEBUG? COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) @@ -500,13 +507,7 @@ def add_gcc_paths(self): os.unlink(tmpfile) def detect_modules(self): - # Ensure that /usr/local is always used - if not cross_compiling: - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') - if cross_compiling: - self.add_gcc_paths() - self.add_multiarch_paths() + self.add_gcc_paths() # Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files. @@ -844,6 +845,11 @@ def detect_modules(self): libs = ['crypt'] else: libs = [] + # ActivePython change: + # It has been necessary to explicitly link in libc + # *before* libcrypt on Solaris. + if sys.platform.startswith("sunos"): + libs.insert(0, "c") exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) ) # CSV files @@ -854,30 +860,55 @@ def detect_modules(self): depends=['socketmodule.h'], libraries=math_libs) ) # Detect SSL support for the socket module (via _ssl) - search_for_ssl_incs_in = [ - '/usr/local/ssl/include', - '/usr/contrib/ssl/include/' - ] - ssl_incs = find_file('openssl/ssl.h', inc_dirs, - search_for_ssl_incs_in - ) + # ActivePython change: + # SSL support must explicitly be found in the ActivePython + # extension build dir. This way ActivePython's build can + # control whether the _ssl module is included. + if sys.platform == "darwin": + if True: + search_for_ssl_incs_in = [apy_inc_dir] + search_for_ssl_libs_in = [apy_lib_dir] + else: + search_for_ssl_incs_in = [] + search_for_ssl_libs_in = [] + else: + search_for_ssl_incs_in = [apy_inc_dir] + search_for_ssl_libs_in = [apy_lib_dir] + ssl_incs = find_file('openssl/ssl.h', [], search_for_ssl_incs_in) + ssl_libs = find_library_file(self.compiler, 'ssl', [], + search_for_ssl_libs_in) + + #XXX I don't know how this is affecting the ActivePython build. if ssl_incs is not None: krb5_h = find_file('krb5.h', inc_dirs, ['/usr/kerberos/include']) if krb5_h: ssl_incs += krb5_h - ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, - ['/usr/local/ssl/lib', - '/usr/contrib/ssl/lib/' - ] ) if (ssl_incs is not None and ssl_libs is not None): - exts.append( Extension('_ssl', ['_ssl.c'], - include_dirs = ssl_incs, - library_dirs = ssl_libs, - libraries = ['ssl', 'crypto'], - depends = ['socketmodule.h']), ) + if sys.platform == "darwin": + # On darwin we always link the system-supplied SSL + exts.append( Extension('_ssl', ['_ssl.c'], + include_dirs = ssl_incs, + library_dirs = ssl_libs, + libraries = ['ssl', 'crypto'], + depends = ['socketmodule.h']), ) + else: + extra_objects = [ + os.path.join(apy_lib_dir, "libssl.a"), + os.path.join(apy_lib_dir, "libcrypto.a"), + ] + if sys.platform.startswith("linux") and os.uname()[4] == "x86_64": + # http://rt.openssl.org/Ticket/Display.html?id=1521&user=guest&pass=guest + extra_link_args = ["-Wl,-Bsymbolic"] + else: + extra_link_args = [] + exts.append( Extension('_ssl', ['_ssl.c'], + include_dirs = ssl_incs, + extra_link_args=extra_link_args, + extra_objects=extra_objects, + depends = ['socketmodule.h']) ) else: missing.append('_ssl') @@ -888,7 +919,7 @@ def detect_modules(self): # look for the openssl version header on the compiler search path. opensslv_h = find_file('openssl/opensslv.h', [], - inc_dirs + search_for_ssl_incs_in) + search_for_ssl_incs_in) if opensslv_h: name = os.path.join(opensslv_h[0], 'openssl/opensslv.h') if host_platform == 'darwin' and is_macosx_sdk_path(name): @@ -910,12 +941,28 @@ def detect_modules(self): if have_any_openssl: if have_usable_openssl: - # The _hashlib module wraps optimized implementations - # of hash functions from the OpenSSL library. - exts.append( Extension('_hashlib', ['_hashopenssl.c'], - include_dirs = ssl_incs, - library_dirs = ssl_libs, - libraries = ['ssl', 'crypto']) ) + if sys.platform == "darwin": + # On darwin we always link the system-supplied SSL + exts.append( Extension('_hashlib', ['_hashopenssl.c'], + include_dirs = ssl_incs, + library_dirs = ssl_libs, + libraries = ['ssl', 'crypto']) ) + else: + # The _hashlib module wraps optimized implementations + # of hash functions from the OpenSSL library. + extra_objects = [ + os.path.join(apy_lib_dir, "libssl.a"), + os.path.join(apy_lib_dir, "libcrypto.a"), + ] + if sys.platform.startswith("linux") and os.uname()[4] == "x86_64": + # http://rt.openssl.org/Ticket/Display.html?id=1521&user=guest&pass=guest + extra_link_args = ["-Wl,-Bsymbolic"] + else: + extra_link_args = [] + exts.append( Extension('_hashlib', ['_hashopenssl.c'], + include_dirs = ssl_incs, + extra_link_args=extra_link_args, + extra_objects=extra_objects) ) else: print ("warning: openssl 0x%08x is too old for _hashlib" % openssl_ver) @@ -1047,6 +1094,18 @@ def gen_db_minor_ver_nums(major): class db_found(Exception): pass try: + # ActivePython change: + # - Only consider ActivePython's own Berkeley DB build. + # - Link _statically_ to the locally built libdb. Therefore + # don't have to worry about different bsddb versions on + # users' target machines. + db_ver = (PT_CONFIG_bsddb_major_ver, PT_CONFIG_bsddb_minor_ver) + dblib = "db-%s.%s" % db_ver + dblib_dir = [apy_lib_dir] + db_incdir = apy_inc_dir + extra_objects = [os.path.join(apy_lib_dir, "lib%s.a" % dblib)] + raise db_found + # See whether there is a Sleepycat header in the standard # search path. for d in inc_dirs + db_inc_paths: @@ -1146,10 +1205,8 @@ class db_found(Exception): pass # is on an NFS server that goes away). exts.append(Extension('_bsddb', ['_bsddb.c'], depends = ['bsddb.h'], - library_dirs=dblib_dir, - runtime_library_dirs=dblib_dir, include_dirs=db_incs, - libraries=dblibs)) + extra_objects=extra_objects)) else: if db_setup_debug: print "db: no appropriate library found" db_incs = None @@ -1449,38 +1506,23 @@ class db_found(Exception): pass # # You can upgrade zlib to version 1.1.4 yourself by going to # http://www.gzip.org/zlib/ - zlib_inc = find_file('zlib.h', [], inc_dirs) - have_zlib = False - if zlib_inc is not None: - zlib_h = zlib_inc[0] + '/zlib.h' - version = '"0.0.0"' - version_req = '"1.1.3"' - if host_platform == 'darwin' and is_macosx_sdk_path(zlib_h): - zlib_h = os.path.join(macosx_sdk_root(), zlib_h[1:]) - fp = open(zlib_h) - while 1: - line = fp.readline() - if not line: - break - if line.startswith('#define ZLIB_VERSION'): - version = line.split()[2] - break - if version >= version_req: - if (self.compiler.find_library_file(lib_dirs, 'z')): - if host_platform == "darwin": - zlib_extra_link_args = ('-Wl,-search_paths_first',) - else: - zlib_extra_link_args = () - exts.append( Extension('zlib', ['zlibmodule.c'], - libraries = ['z'], - extra_link_args = zlib_extra_link_args)) - have_zlib = True - else: - missing.append('zlib') - else: - missing.append('zlib') + + # + # ActivePython Change: + # ActivePython's build ALWAYS expects a zlib install in + # $(TOP)/build. + zlib_inc_dirs = [apy_inc_dir] + zlib_lib_dirs = [apy_lib_dir] + if sys.platform == "darwin": + zlib_extra_link_args = ('-Wl,-search_paths_first',) else: - missing.append('zlib') + zlib_extra_link_args = () + exts.append( Extension('zlib', ['zlibmodule.c'], + include_dirs = zlib_inc_dirs, + library_dirs = zlib_lib_dirs, + libraries = ['z'], + extra_link_args = zlib_extra_link_args)) + have_zlib = True # Helper module for various ascii-encoders. Uses zlib for an optimized # crc32 if we have it. Otherwise binascii uses its own. @@ -1495,6 +1537,8 @@ class db_found(Exception): pass exts.append( Extension('binascii', ['binascii.c'], extra_compile_args = extra_compile_args, libraries = libraries, + include_dirs = zlib_inc_dirs, + library_dirs = zlib_lib_dirs, extra_link_args = extra_link_args) ) # Gustavo Niemeyer's bz2 module. @@ -1628,6 +1672,14 @@ class db_found(Exception): pass macros = dict() libraries = [] + elif host_platform.startswith('aix'): + macros = dict( + HAVE_SEM_OPEN=1, + HAVE_SEM_TIMEDWAIT=0, + HAVE_FD_TRANSFER=1 + ) + libraries = ['rt'] + else: # Linux and other unices macros = dict() libraries = ['rt'] @@ -1938,10 +1990,8 @@ def detect_tkinter(self, inc_dirs, lib_dirs): tcllib = tklib = tcl_includes = tk_includes = None for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83', '8.2', '82', '8.1', '81', '8.0', '80']: - tklib = self.compiler.find_library_file(lib_dirs, - 'tk' + version) - tcllib = self.compiler.find_library_file(lib_dirs, - 'tcl' + version) + tklib = self.compiler.find_library_file([apy_lib_dir], 'tk' + version) + tcllib = self.compiler.find_library_file([apy_lib_dir], 'tcl' + version) if tklib and tcllib: # Exit the loop when we've found the Tcl/Tk libraries break @@ -1961,8 +2011,8 @@ def detect_tkinter(self, inc_dirs, lib_dirs): tcl_include_sub += [dir + os.sep + "tcl" + dotversion] tk_include_sub += [dir + os.sep + "tk" + dotversion] tk_include_sub += tcl_include_sub - tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub) - tk_includes = find_file('tk.h', inc_dirs, tk_include_sub) + tcl_includes = find_file('tcl.h', [], [apy_inc_dir]) + tk_includes = find_file('tk.h', [], [apy_inc_dir]) if (tcllib is None or tklib is None or tcl_includes is None or tk_includes is None): @@ -1992,6 +2042,8 @@ def detect_tkinter(self, inc_dirs, lib_dirs): include_dirs.append('/usr/X11/include') added_lib_dirs.append('/usr/X11/lib') + added_lib_dirs.insert(0, apy_lib_dir) + # If Cygwin, then verify that X is installed before proceeding if host_platform == 'cygwin': x11_inc = find_file('X11/Xlib.h', [], include_dirs) @@ -2019,11 +2071,26 @@ def detect_tkinter(self, inc_dirs, lib_dirs): if host_platform != "cygwin": libs.append('X11') + lib_kwargs = {} + # Look up dependent shared objects in ActivePython's own + # lib dir at runtime. + lib_kwargs["runtime_library_dirs"] = [apy_lib_dir] + if sys.platform.startswith("aix"): + # Use AIX's .exp file mechanism instead of "-ltcl8.4 -ltk8.4" + # to avoid problems with .a vs .so for shared object + # extensions. + libs.remove('tcl'+version) + libs.remove('tk'+version) + libtclEXP = os.path.join(apy_lib_dir, "libtcl%s.exp" % version) + libtkEXP = os.path.join(apy_lib_dir, "libtk%s.exp" % version) + lib_kwargs["extra_link_args"] = ['-bI:'+libtclEXP, + '-bI:'+libtkEXP] ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], define_macros=[('WITH_APPINIT', 1)] + defs, include_dirs = include_dirs, libraries = libs, library_dirs = added_lib_dirs, + **lib_kwargs ) self.extensions.append(ext) From a91f90701f80cb0e6389574662af8f9be5d705ed Mon Sep 17 00:00:00 2001 From: icanhasmath Date: Wed, 31 Mar 2021 19:48:17 -0400 Subject: [PATCH 2/5] Use our app dir path to point build to our sqlite3 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d96942a1455d37..13835fe0196833 100644 --- a/setup.py +++ b/setup.py @@ -1241,8 +1241,8 @@ class db_found(Exception): pass for d_ in inc_dirs + sqlite_inc_paths: d = d_ - if host_platform == 'darwin' and is_macosx_sdk_path(d): - d = os.path.join(sysroot, d[1:]) + if host_platform == 'darwin': + d = apy_inc_dir f = os.path.join(d, "sqlite3.h") if os.path.exists(f): From 552d747fff9c60c3ecc0946c9214d2e9b8b698da Mon Sep 17 00:00:00 2001 From: icanhasmath Date: Wed, 31 Mar 2021 19:50:35 -0400 Subject: [PATCH 3/5] Update to sqlite to 3.34.1.0, bzip2 to 1.0.8 --- PCbuild/get_externals.bat | 4 ++-- PCbuild/get_externals_activestate.bat | 4 ++-- PCbuild/python.props | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index 9f1b09e9b6595c..36a3f6d8a0c971 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -45,10 +45,10 @@ rem When updating these versions, remember to update the relevant property rem files in both this dir and PC\VS9.0 set libraries= -set libraries=%libraries% bzip2-1.0.6 +set libraries=%libraries% bzip2-1.0.8 if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0 if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.0.2t -set libraries=%libraries% sqlite-3.28.0.0 +set libraries=%libraries% sqlite-3.34.1.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tix-8.4.3.5 diff --git a/PCbuild/get_externals_activestate.bat b/PCbuild/get_externals_activestate.bat index 91f6ec37ee6f97..3e87bce8e72c57 100644 --- a/PCbuild/get_externals_activestate.bat +++ b/PCbuild/get_externals_activestate.bat @@ -15,10 +15,10 @@ set default_OpenSSL=1.0.2t if "%OpenSSL_version%"=="" set OpenSSL_version=%default_OpenSSL% set libraries= -set libraries=%libraries% bzip2-1.0.6 +set libraries=%libraries% bzip2-1.0.8 if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0 if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-%OpenSSL_version% -set libraries=%libraries% sqlite-3.33.0.0 +set libraries=%libraries% sqlite-3.34.1.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tix-8.4.3.5 diff --git a/PCbuild/python.props b/PCbuild/python.props index f0b531e50eb4f8..dec6282f578de5 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -32,8 +32,8 @@ $([System.IO.Path]::GetFullPath(`$(PySourcePath)externals\`)) - $(ExternalsDir)sqlite-3.28.0.0\ - $(ExternalsDir)bzip2-1.0.6\ + $(ExternalsDir)sqlite-3.34.1.0\ + $(ExternalsDir)bzip2-1.0.8\ $(ExternalsDir)bsddb-4.7.25.0 $(ExternalsDir)openssl-1.0.2t\ $(opensslDir)include32 From 292c8e0518bc7ede3eead9d85232693b6cb3fa43 Mon Sep 17 00:00:00 2001 From: icanhasmath Date: Wed, 31 Mar 2021 19:52:03 -0400 Subject: [PATCH 4/5] Upgrade openssl to use local openssl python.props is now directing the python core to the openssl dir that is built prior to the core for openssl dlls. Using this as a reference: https://github.com/reiniert/cpython/commit/cf5efa376809b96afc4f1c774ebe2d3f074a167e Upgrade from 1.0.2 to 1.1.1: Remove the libeay and ssleay projects and link to local openssl This is specifically using the DLLS with the 1_1 suffix, which is the suffix for both 64 and 32 bit DLLs we are building. --- PCbuild/_hashlib.vcxproj | 25 +- PCbuild/_ssl.vcxproj | 25 +- PCbuild/get_externals.bat | 5 +- PCbuild/get_externals_activestate.bat | 12 +- PCbuild/libeay.vcxproj | 906 -------------------------- PCbuild/openssl.props | 85 +-- PCbuild/pcbuild.sln | 52 -- PCbuild/python.props | 7 +- 8 files changed, 54 insertions(+), 1063 deletions(-) delete mode 100644 PCbuild/libeay.vcxproj diff --git a/PCbuild/_hashlib.vcxproj b/PCbuild/_hashlib.vcxproj index 5616a1e4cabdee..41c7e3fc481909 100644 --- a/PCbuild/_hashlib.vcxproj +++ b/PCbuild/_hashlib.vcxproj @@ -55,16 +55,25 @@ + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - - $(opensslIncludeDir);%(AdditionalIncludeDirectories) - - ws2_32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies) + ws2_32.lib;%(AdditionalDependencies) @@ -75,14 +84,6 @@ {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} false - - {10615b24-73bf-4efa-93aa-236916321317} - false - - - {e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0} - false - diff --git a/PCbuild/_ssl.vcxproj b/PCbuild/_ssl.vcxproj index 73c95713a0cb96..88ec84867867ef 100644 --- a/PCbuild/_ssl.vcxproj +++ b/PCbuild/_ssl.vcxproj @@ -55,16 +55,25 @@ + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 - - $(opensslIncludeDir);%(AdditionalIncludeDirectories) - - ws2_32.lib;crypt32.lib;$(OutDir)libeay$(PyDebugExt).lib;$(OutDir)ssleay$(PyDebugExt).lib;%(AdditionalDependencies) + ws2_32.lib;crypt32.lib;%(AdditionalDependencies) @@ -75,14 +84,6 @@ {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} false - - {e5b04cc0-eb4c-42ab-b4dc-18ef95f864b0} - false - - - {10615b24-73bf-4efa-93aa-236916321317} - false - {86937f53-c189-40ef-8ce8-8759d8e7d480} false diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index 36a3f6d8a0c971..f9c24bde1fa2b0 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -47,7 +47,7 @@ rem files in both this dir and PC\VS9.0 set libraries= set libraries=%libraries% bzip2-1.0.8 if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0 -if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.0.2t +if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.1.1j set libraries=%libraries% sqlite-3.34.1.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0 @@ -61,7 +61,7 @@ for %%e in (%libraries%) do ( git clone --depth 1 https://github.com/%ORG%/cpython-source-deps --branch %%e "%EXTERNALS_DIR%\%%e" ) else ( echo.Fetching %%e... - %PYTHON% "%PCBUILD%\get_external.py" -O %ORG% %%e + %PYTHON% "%PCBUILD%\get_external.py" -O %ORG% -e "%EXTERNALS_DIR%" %%e ) ) @@ -70,6 +70,7 @@ echo.Fetching external binaries... set binaries= set binaries=%binaries% if NOT "%IncludeSSL%"=="false" set binaries=%binaries% nasm-2.11.06 +if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1j for %%b in (%binaries%) do ( if exist "%EXTERNALS_DIR%\%%b" ( diff --git a/PCbuild/get_externals_activestate.bat b/PCbuild/get_externals_activestate.bat index 3e87bce8e72c57..c56cd2594e25db 100644 --- a/PCbuild/get_externals_activestate.bat +++ b/PCbuild/get_externals_activestate.bat @@ -11,13 +11,9 @@ rem *** IMPORTANT *** rem If updating bzip2, db, nasm, openssl, or sqlite you must also edit their directory names in python.props. rem If updating tcl/tk/tix you must also update their versions/directories in tcltk.props. -set default_OpenSSL=1.0.2t -if "%OpenSSL_version%"=="" set OpenSSL_version=%default_OpenSSL% - set libraries= set libraries=%libraries% bzip2-1.0.8 if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0 -if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-%OpenSSL_version% set libraries=%libraries% sqlite-3.34.1.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0 @@ -42,13 +38,7 @@ for %%e in (%libraries%) do ( ) ) -cd ..\externals -if NOT "%OpenSSL_version%"=="%default_OpenSSL%" ( - if exist openssl-%OpenSSL_version% ( - move openssl-%OpenSSL_version% openssl-%default_OpenSSL% - ) -) -cd ..\PCbuild +echo Finished. goto end diff --git a/PCbuild/libeay.vcxproj b/PCbuild/libeay.vcxproj deleted file mode 100644 index b0994e12f0cd5c..00000000000000 --- a/PCbuild/libeay.vcxproj +++ /dev/null @@ -1,906 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - PGInstrument - Win32 - - - PGInstrument - x64 - - - PGUpdate - Win32 - - - PGUpdate - x64 - - - Debug - x64 - - - Release - x64 - - - - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0} - libeay - - - - - - - StaticLibrary - - - - - - - - <_DATEValue>#define DATE "$([System.DateTime]::Now.ToString(`ddd MMM dd HH':'mm':'ss yyyy`))" - <_CFLAGSValue>#define CFLAGS "cl /MD /Ox -W3 -Gs0 -Gy -nologo @(PreprocessorDefinitions->'-D%(Identity)',' ')" - <_PLATFORMValue Condition="$(Platform)=='Win32'">#define PLATFORM "VC-WIN32" - <_PLATFORMValue Condition="$(Platform)=='x64'">#define PLATFORM "VC-WIN64A" - - - - - - - - - - - - $(IntDir);%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PCbuild/openssl.props b/PCbuild/openssl.props index e45964ee87f9fc..4718aa317ff841 100644 --- a/PCbuild/openssl.props +++ b/PCbuild/openssl.props @@ -1,74 +1,29 @@  - - - - StaticLibrary - $(opensslDir)tmp\$(ArchName)_$(Configuration)\$(ProjectName)\ - $(opensslDir)tmp\$(ArchName)\$(ProjectName)\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_PreprocessorDefinitionList>@(PreprocessorDefinitions) - - - - 4244;4267 - $(opensslDir);$(opensslIncludeDir);$(opensslDir)crypto;$(opensslDir)crypto\asn1;$(opensslDir)crypto\evp;$(opensslDir)crypto\modes - $(_PreprocessorDefinitionList);%(PreprocessorDefinitions) + $(opensslIncludeDir);%(AdditionalIncludeDirectories) + + $(opensslDir);$(opensslLibDir);%(AdditionalLibraryDirectories) + ws2_32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies) + - - - - nasm.exe -f win32 - nasm.exe -f win64 -DNEAR -Ox -g - + + <_DLLSuffix>-1_1 + <_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm + <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64 + + + <_SSLDLL Include="$(opensslDir)\libcrypto$(_DLLSuffix).dll" /> + <_SSLDLL Include="$(opensslDir)\libcrypto$(_DLLSuffix).pdb" /> + <_SSLDLL Include="$(opensslDir)\libssl$(_DLLSuffix).dll" /> + <_SSLDLL Include="$(opensslDir)\libssl$(_DLLSuffix).pdb" /> + + + - - - - - - - + + diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln index e03861bbf999ac..a3dbdc891084d1 100644 --- a/PCbuild/pcbuild.sln +++ b/PCbuild/pcbuild.sln @@ -57,10 +57,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tix", "tix.vcxproj", "{C5A3 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tk", "tk.vcxproj", "{7E85ECCF-A72C-4DA4-9E52-884508E80BA1}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libeay", "libeay.vcxproj", "{E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssleay", "ssleay.vcxproj", "{10615B24-73BF-4EFA-93AA-236916321317}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -137,22 +133,6 @@ Global {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|Win32.Build.0 = Release|Win32 {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.ActiveCfg = Release|x64 {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release|x64.Build.0 = Release|x64 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.ActiveCfg = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|Win32.Build.0 = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.ActiveCfg = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Debug|x64.Build.0 = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|Win32.ActiveCfg = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|Win32.Build.0 = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|x64.ActiveCfg = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGInstrument|x64.Build.0 = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|Win32.ActiveCfg = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|Win32.Build.0 = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|x64.ActiveCfg = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.PGUpdate|x64.Build.0 = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.ActiveCfg = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|Win32.Build.0 = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.ActiveCfg = Release|Win32 - {C73F0EC1-358B-4177-940F-0846AC8B04CD}.Release|x64.Build.0 = Release|Win32 {28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|Win32.ActiveCfg = Debug|Win32 {28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|Win32.Build.0 = Debug|Win32 {28B5D777-DDF2-4B6B-B34F-31D938813856}.Debug|x64.ActiveCfg = Debug|x64 @@ -497,38 +477,6 @@ Global {7E85ECCF-A72C-4DA4-9E52-884508E80BA1}.Release|Win32.Build.0 = Release|Win32 {7E85ECCF-A72C-4DA4-9E52-884508E80BA1}.Release|x64.ActiveCfg = Release|x64 {7E85ECCF-A72C-4DA4-9E52-884508E80BA1}.Release|x64.Build.0 = Release|x64 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|Win32.ActiveCfg = Debug|Win32 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|Win32.Build.0 = Debug|Win32 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|x64.ActiveCfg = Debug|x64 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Debug|x64.Build.0 = Debug|x64 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|Win32.ActiveCfg = Release|Win32 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|Win32.Build.0 = Release|Win32 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|x64.ActiveCfg = Release|x64 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGInstrument|x64.Build.0 = Release|x64 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|Win32.ActiveCfg = Release|Win32 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|Win32.Build.0 = Release|Win32 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|x64.ActiveCfg = Release|x64 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.PGUpdate|x64.Build.0 = Release|x64 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|Win32.ActiveCfg = Release|Win32 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|Win32.Build.0 = Release|Win32 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|x64.ActiveCfg = Release|x64 - {E5B04CC0-EB4C-42AB-B4DC-18EF95F864B0}.Release|x64.Build.0 = Release|x64 - {10615B24-73BF-4EFA-93AA-236916321317}.Debug|Win32.ActiveCfg = Debug|Win32 - {10615B24-73BF-4EFA-93AA-236916321317}.Debug|Win32.Build.0 = Debug|Win32 - {10615B24-73BF-4EFA-93AA-236916321317}.Debug|x64.ActiveCfg = Debug|x64 - {10615B24-73BF-4EFA-93AA-236916321317}.Debug|x64.Build.0 = Debug|x64 - {10615B24-73BF-4EFA-93AA-236916321317}.PGInstrument|Win32.ActiveCfg = Release|Win32 - {10615B24-73BF-4EFA-93AA-236916321317}.PGInstrument|Win32.Build.0 = Release|Win32 - {10615B24-73BF-4EFA-93AA-236916321317}.PGInstrument|x64.ActiveCfg = Release|x64 - {10615B24-73BF-4EFA-93AA-236916321317}.PGInstrument|x64.Build.0 = Release|x64 - {10615B24-73BF-4EFA-93AA-236916321317}.PGUpdate|Win32.ActiveCfg = Release|Win32 - {10615B24-73BF-4EFA-93AA-236916321317}.PGUpdate|Win32.Build.0 = Release|Win32 - {10615B24-73BF-4EFA-93AA-236916321317}.PGUpdate|x64.ActiveCfg = Release|x64 - {10615B24-73BF-4EFA-93AA-236916321317}.PGUpdate|x64.Build.0 = Release|x64 - {10615B24-73BF-4EFA-93AA-236916321317}.Release|Win32.ActiveCfg = Release|Win32 - {10615B24-73BF-4EFA-93AA-236916321317}.Release|Win32.Build.0 = Release|Win32 - {10615B24-73BF-4EFA-93AA-236916321317}.Release|x64.ActiveCfg = Release|x64 - {10615B24-73BF-4EFA-93AA-236916321317}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PCbuild/python.props b/PCbuild/python.props index dec6282f578de5..f73369db275fdc 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -32,12 +32,13 @@ $([System.IO.Path]::GetFullPath(`$(PySourcePath)externals\`)) + $(PySourcePath)\..\local-lib\ $(ExternalsDir)sqlite-3.34.1.0\ $(ExternalsDir)bzip2-1.0.8\ $(ExternalsDir)bsddb-4.7.25.0 - $(ExternalsDir)openssl-1.0.2t\ - $(opensslDir)include32 - $(opensslDir)include64 + $(Local_Lib)bin + $(Local_Lib)lib + $(Local_Lib)include $(ExternalsDir)\nasm-2.11.06\ From 99c132253791a7886ad033de249b32fb5b7ba8a1 Mon Sep 17 00:00:00 2001 From: icanhasmath Date: Thu, 1 Apr 2021 11:08:37 -0400 Subject: [PATCH 5/5] Remove openssl from get externals We are using the local version. --- PCbuild/get_externals.bat | 2 -- 1 file changed, 2 deletions(-) diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index f9c24bde1fa2b0..972d25cc9c5bfb 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -47,7 +47,6 @@ rem files in both this dir and PC\VS9.0 set libraries= set libraries=%libraries% bzip2-1.0.8 if NOT "%IncludeBsddb%"=="false" set libraries=%libraries% bsddb-4.7.25.0 -if NOT "%IncludeSSL%"=="false" set libraries=%libraries% openssl-1.1.1j set libraries=%libraries% sqlite-3.34.1.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tcl-8.5.19.0 if NOT "%IncludeTkinter%"=="false" set libraries=%libraries% tk-8.5.19.0 @@ -70,7 +69,6 @@ echo.Fetching external binaries... set binaries= set binaries=%binaries% if NOT "%IncludeSSL%"=="false" set binaries=%binaries% nasm-2.11.06 -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1j for %%b in (%binaries%) do ( if exist "%EXTERNALS_DIR%\%%b" (