set -x
set -eu
set -o pipefail

export PATH=/usr/local/c"$which_python"/bin:"$PATH"

export PYTHON=/usr/local/c"$which_python"/bin/python 

#mkdir -p /usr/local/c$which_python/lib

# pycairo's pycairo.pc doesn't specify a -L, so we need to
export LDFLAGS="-L/usr/local/c$which_python/lib -Wl,-rpath -Wl,/usr/local/c$which_python/lib"
# Without these two, gdk-pixbuf complains about not having been compiled -fPIC
export CC="gcc -I/usr/local/c$which_python/include -fPIC"
export CXX="g++ -I/usr/local/c$which_python/include -fPIC"

# Without this, make install fails
mkdir -p /usr/local/cpython-2.7/man/man1

./configure --prefix=/usr/local/c"$which_python" && make