title: Set library path for installing unicorn using pip on macOS (libunicorn.dylib is missing)
body: <p>I want to install Python unicorn on macOS Mojave using <code>python</code> (2.7) and <code>pip</code>. </p>
  
  <p>I've already compiled <code>libunicorn.dylib</code> from source, which can be seen below:</p>
  
  <pre><code>Nicolass-MacBook-Pro:Tools nlykkei$ sudo find / -iname libunicorn.dylib 2&gt;/dev/null
  /usr/local/lib/libunicorn.dylib
  </code></pre>
  
  <p>When I attempt to install Python unicorn, I get the below error, namely that <code>libunicorn.dylib</code> cannot be found. How can I make it so that <code>pip</code> uses libraries in <code>/usr/local/lib</code>?</p>
  
  <pre><code>Nicolass-MacBook-Pro:Tools nlykkei$ UNICORN_QEMU_FLAGS="--python=/opt/local/bin/python" pip install unicorn
  DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  Collecting unicorn
    Using cached https://files.pythonhosted.org/packages/7d/7f/47fe864fe967e91de2d57677618cffc91bee3918f0a3cdbaa6500b36855e/unicorn-1.0.1.tar.gz
  Building wheels for collected packages: unicorn
    Building wheel for unicorn (setup.py) ... error
    Complete output from command /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-install-5zSTD0/unicorn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-wheel-5V3QqP --python-tag cp27:
    running bdist_wheel
    running build
    Building C extensions
    cd qemu &amp;&amp; \
      ./configure --cc="cc" --extra-cflags="-DUNICORN_HAS_X86 -DUNICORN_HAS_ARM -DUNICORN_HAS_ARMEB -DUNICORN_HAS_M68K -DUNICORN_HAS_ARM64 -DUNICORN_HAS_MIPS -DUNICORN_HAS_MIPSEL -DUNICORN_HAS_MIPS64 -DUNICORN_HAS_MIPS64EL -DUNICORN_HAS_SPARC -fPIC -fvisibility=hidden -m32 -arch i386 -m64 -arch x86_64" --target-list="x86_64-softmmu, arm-softmmu, armeb-softmmu, m68k-softmmu, aarch64-softmmu, mips-softmmu, mipsel-softmmu, mips64-softmmu, mips64el-softmmu, sparc-softmmu,sparc64-softmmu," --python=/opt/local/bin/python
  
    ERROR: pthread check failed
           Make sure to have the pthread libs and headers installed.
  
    make: *** [qemu/config-host.h-timestamp] Error 1
    error: [Errno 2] No such file or directory: 'libunicorn.dylib'
  
    ----------------------------------------
    Failed building wheel for unicorn
    Running setup.py clean for unicorn
  Failed to build unicorn
  Installing collected packages: unicorn
    Running setup.py install for unicorn ... error
      Complete output from command /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-install-5zSTD0/unicorn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-record-iBB9QD/install-record.txt --single-version-externally-managed --compile:
      running install
      running build
      Building C extensions
      cd qemu &amp;&amp; \
          ./configure --cc="cc" --extra-cflags="-DUNICORN_HAS_X86 -DUNICORN_HAS_ARM -DUNICORN_HAS_ARMEB -DUNICORN_HAS_M68K -DUNICORN_HAS_ARM64 -DUNICORN_HAS_MIPS -DUNICORN_HAS_MIPSEL -DUNICORN_HAS_MIPS64 -DUNICORN_HAS_MIPS64EL -DUNICORN_HAS_SPARC -fPIC -fvisibility=hidden -m32 -arch i386 -m64 -arch x86_64" --target-list="x86_64-softmmu, arm-softmmu, armeb-softmmu, m68k-softmmu, aarch64-softmmu, mips-softmmu, mipsel-softmmu, mips64-softmmu, mips64el-softmmu, sparc-softmmu,sparc64-softmmu," --python=/opt/local/bin/python
  
      ERROR: pthread check failed
             Make sure to have the pthread libs and headers installed.
  
      make: *** [qemu/config-host.h-timestamp] Error 1
      error: [Errno 2] No such file or directory: 'libunicorn.dylib'
  
      ----------------------------------------
  Command "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-install-5zSTD0/unicorn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-record-iBB9QD/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/qg/d7f5_p4j1px1gqb9c3xxl80w0000gn/T/pip-install-5zSTD0/unicorn/
  </code></pre>