title: How to set CFLAGS and LDFLAGS to compile pycrypto
body: <p>I am trying to install the fabric library to an old machine. There are some legacy libraries in /usr/lib, such as libgmp.</p>
  
  <pre><code>(py27)[qrtt1@hcservice app]$ ls /usr/lib|grep gmp
  libgmp.a
  libgmp.so
  libgmp.so.3
  libgmp.so.3.3.3
  libgmpxx.a
  libgmpxx.so
  libgmpxx.so.3
  libgmpxx.so.3.0.5
  </code></pre>
  
  <p>I have compiled the libgmp 5.x in my $HOME/app, and then am trying to install pycrypto (it is the dependency of fab):</p>
  
  <pre><code>CFLGAS=-I/home/qrtt1/app/include LDFLGAS=-L/home/qrtt1/app/lib  pip install pycrypto
  </code></pre>
  
  <p>I observed that none of my include or lib directories are in the in the compilation / linking options:</p>
  
  <pre><code>gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/home/qrtt1/app/include/python2.7 -c src/_fastmath.c -o build/temp.linux-i686-2.7/src/_fastmath.o
  gcc -pthread -shared build/temp.linux-i686-2.7/src/_fastmath.o -lgmp -o build/lib.linux-i686-2.7/Crypto/PublicKey/_fastmath.so
  building 'Crypto.Hash._MD2' extension
  gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/home/qrtt1/app/include/python2.7 -c src/MD2.c -o build/temp.linux-i686-2.7/src/MD2.o
  gcc -pthread -shared build/temp.linux-i686-2.7/src/MD2.o -o build/lib.linux-i686-2.7/Crypto/Hash/_MD2.so
  building 'Crypto.Hash._MD4' extension
  gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/home/qrtt1/app/include/python2.7 -c src/MD4.c -o build/temp.linux-i686-2.7/src/MD4.o
  gcc -pthread -shared build/temp.linux-i686-2.7/src/MD4.o -o build/lib.linux-i686-2.
  </code></pre>
  
  <p>How do I assign the CFLAGS and LDFLAGS correctly for building <code>pycrypto</code> ?</p>
  
  <hr>
  
  <p>I try to download pycrypto-2.5 and install it:</p>
  
  <pre><code>(py27)[qrtt1@hcservice pycrypto-2.5]$ CFLGAS=-I/home/qrtt1/app/include LDFLGAS=-L/home/qrtt1/app/lib python setup.py install
  </code></pre>
  
  <p>No CFLAGS or LDFLAGS set up with it. May be the pycrypto-2.5 going wrong ?</p>