title: Building Python with SSL support in non-standard location
body: <p>I need to install several Python modules on a RHEL where I don't have root access. At least one of the modules also needs access to <code>Python.h</code>.</p>
  
  <p>In this case I find that the best thing is to install python and it dependencies in <code>~/local</code>. It usually just works, but this time Python fails to build the SSL module (see details below). Here's the trace of what I'm doing.</p>
  
  <p>So I  downloaded python 6 source and off I went:</p>
  
  <pre><code>./configure --prefix=/home/fds/rms/local
  make &gt;&amp; make.log
  </code></pre>
  
  <p>An inspection to log reveals that ssl module has not been compiled, but there is no mention of the cause (no other occurence of ssl in make or configure):</p>
  
  <pre><code>Failed to find the necessary bits to build these modules:
  _bsddb             _curses            _curses_panel
  _hashlib           _sqlite3           _ssl   &lt;----------
  </code></pre>
  
  <p>So I figure, python is not finding any ssl library at all (which is strange, but hey...). So I download openssl-0.9.8r and</p>
  
  <pre><code>./config --prefix=/home/fds/rms/local shared
  make
  make install
  </code></pre>
  
  <p>Now back to Python, I ./configure and make again. It fails, but this time it's different:</p>
  
  <pre><code>Failed to build these modules:
  _hashlib           _ssl
  </code></pre>
  
  <p>A closer inspection to the log file reveals this:</p>
  
  <pre><code>gcc -pthread -shared build/temp.linux-x86_64-2.6/home/fds/rms/installers/Python-2.6.6/Modules/_ssl.o -L/home/fds/rms/local/lib -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-x86_64-2.6/_ssl.so
  *** WARNING: renaming "_ssl" since importing it failed: libssl.so.0.9.8: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>So now it's picking up the library but not quite getting it right (the file is there where is should be):</p>
  
  <pre><code>$ find /home/fds/rms/local -iname libssl.so.0.9.8
  /home/fds/rms/local/lib/libssl.so.0.9.8
  </code></pre>
  
  <p>Next thing is tracing make and see where is it looking for the file:</p>
  
  <pre><code>$ strace -f make 2&gt;&amp;1 | grep libssl.so.0.9.8
  [pid  5584] open("/lib/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/usr/lib/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/lib64/tls/x86_64/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/lib64/tls/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/lib64/x86_64/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or   directory)
  [pid  5584] open("/lib64/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/usr/lib64/tls/x86_64/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/usr/lib64/tls/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/usr/lib64/x86_64/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/usr/lib64/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] write(1, "*** WARNING: renaming \"_ssl\" sin"..., 131*** WARNING: renaming "_ssl" since importing it failed: libssl.so.0.9.8: cannot open shared object file: No such file or directory
  [pid  5584] open("/lib/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/usr/lib/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/lib64/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/usr/lib64/tls/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] open("/usr/lib64/libssl.so.0.9.8", O_RDONLY) = -1 ENOENT (No such file or directory)
  [pid  5584] write(1, "*** WARNING: renaming \"_hashlib\""..., 135*** WARNING: renaming "_hashlib" since importing it failed: libssl.so.0.9.8: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>Mhhh, it's looking in all the wrong places. I try to give a hint:</p>
  
  <pre><code>CPPFLAGS="-I/home/fds/rms/local/include -I/home/fds/rms/local/include/openssl" LDFLAGS="-L/home/fds/rms/local/lib" ./configure --prefix=/home/fds/rms/local
  </code></pre>
  
  <p>But nothing changes, and <code>make</code> does not seem to try <code>/home/fds/rms/local/lib</code> at all.</p>
  
  <p>I haven't done this in years, so maybe I'm overlooking something. Can anyone help with the problem?</p>
  
  <p>Thanks in advance.</p>