I can't seem to be able to build _ssl
or _hashlib
on Mac OSX Sierra. I looked in the make
logs, and I've found out it doesn't even try to look in the appropriate places for includes:
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3
-Wall -Wstrict-prototypes -Werror=declaration-after-statement -I./Include
-I. -IInclude -I/usr/local/include -I/usr/local/src/Python-3.5.2/Include
-I/usr/local/src/Python-3.5.2 -c /usr/local/src/Python-3.5.2/Modules/_ssl.c
-o build/temp.macosx-10.12-x86_64-3.5/usr/local/src/Python-3.5.2/Modules/_ssl.o
I have an updated version of OpenSSL installed in /usr/local
:
$ which openssl
/usr/local/bin/openssl
$ openssl version
OpenSSL 1.1.0c 10 Nov 2016
The configure script has placed the OpenSSL libs in /usr/local/lib
and the headers in /usr/local/include/openssl
, and make
does not seem to make use of those. So I thought I could solve the problem by setting appropriately the CPPFLAGS
and LDFLAGS
environment variables, as specified here:
$ echo $CPPFLAGS
-I/usr/local/include/ -I/usr/local/include/openssl/
$ echo $LDFLAGS
-L/usr/local/lib/
$ echo $LD_LIBRARY_PATH
/usr/local/lib/
but I am still not able to build either _ssl
or _hashlib
. I've also tried to modify Setup.local
, after I read this answer in this way:
$ cat Modules/Setup.local
# Edit this file for local setup changes
SSL=/usr/local
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
with no success. I did notice that the gcc
command changed though:
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG
-g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement
-I. -IInclude -I./Include -DPy_BUILD_CORE -DUSE_SSL -I/usr/local/include
-I/usr/local/include/openssl -c ./Modules/_ssl.c -o Modules/_ssl.o
Any help would be appreciated.