| 1 | #!/usr/bin/env bash |
| 2 | set -x #echo on |
| 3 | |
| 4 | # These are more or less the compiler and linker flags used by Python's distutils.core.setup() |
| 5 | |
| 6 | CC_FLAGS="-pthread -g -fwrapv -O2 -Wall -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2" |
| 7 | LD_FLAGS="-shared -fPIC -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-O1" |
| 8 | |
| 9 | gcc $CC_FLAGS mypy.c -ldl -o mypy |
| 10 | gcc $CC_FLAGS mypydl.c -I/usr/include/python3.4m -lpython3.4m $LD_FLAGS -o mypydl.so |
| 11 | |
| 12 | python3 setup.py install --user |
| 13 |