_ssl fails to compile on Mac OS X Sierra
<p>I can't seem to be able to build <code>_ssl</code> or <code>_hashlib</code> on Mac OSX Sierra. I looked in the <code>make</code> logs, and I've found out it doesn't even try to look in the appropriate places for includes:</p>

<pre><code>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
</code></pre>

<p>I have an updated version of OpenSSL installed in <code>/usr/local</code>:</p>

<pre><code>$ which openssl
/usr/local/bin/openssl
$ openssl version
OpenSSL 1.1.0c  10 Nov 2016
</code></pre>

<p>The configure script has placed the OpenSSL libs in <code>/usr/local/lib</code> and the headers in <code>/usr/local/include/openssl</code>, and <code>make</code> does not seem to make use of those. So I thought I could solve the problem by setting appropriately the <code>CPPFLAGS</code> and <code>LDFLAGS</code> environment variables, as specified <a href="https://stackoverflow.com/questions/23548188/how-do-i-compile-python-3-4-with-custom-openssl">here</a>:</p>

<pre><code>$ echo $CPPFLAGS
-I/usr/local/include/ -I/usr/local/include/openssl/
$ echo $LDFLAGS
-L/usr/local/lib/
$ echo $LD_LIBRARY_PATH 
/usr/local/lib/
</code></pre>

<p>but I am still not able to build either <code>_ssl</code> or <code>_hashlib</code>. I've also tried to modify <code>Setup.local</code>, after I read <a href="https://stackoverflow.com/questions/5937337/building-python-with-ssl-support-in-non-standard-location">this</a> answer in this way:</p>

<pre><code>$ 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
</code></pre>

<p>with no success. I did notice that the <code>gcc</code> command changed though:</p>

<pre><code>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
</code></pre>

<p>Any help would be appreciated.</p>