From 09221cfefe6f7c1d4fff320b6bcee56a23deb54d Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 20 Apr 2014 20:19:55 +0200 Subject: inital commit --- .gitignore | 5 +++++ M2Crypto_ext.i | 17 +++++++++++++++++ Makefile | 20 ++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .gitignore create mode 100644 M2Crypto_ext.i create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6cb93c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.c +*.o +*.so +*.py +*.pyc diff --git a/M2Crypto_ext.i b/M2Crypto_ext.i new file mode 100644 index 0000000..f538eed --- /dev/null +++ b/M2Crypto_ext.i @@ -0,0 +1,17 @@ +%module M2Crypto_ext + +%{ +#include +#include +%} + +%include +%include "constraints.i" + +%apply Pointer NONNULL { X509_REQ * }; + +%inline %{ +STACK_OF(X509_EXTENSIO) *x509_req_get_extensions(X509_REQ *req) { + return X509_REQ_get_extensions(req); +} +%} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b682e4d --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +PYTHON_INCLUDES=$(shell python-config --includes) + +all: M2Crypto_ext + +clean: + $(RM) _M2Crypto_ext.so M2Crypto_ext.py* M2Crypto_ext_wrap.c M2Crypto_ext_wrap.o + +M2Crypto_ext: _M2Crypto_ext.so M2Crypto_ext.py + +M2Crypto_ext.py: M2Crypto_ext.i + swig -python -I/usr/include $< + +M2Crypto_ext_wrap.c: M2Crypto_ext.i + swig -python -I/usr/include $< + +M2Crypto_ext_wrap.o: M2Crypto_ext_wrap.c + gcc -O2 -fPIC -o $@ -c $< $(PYTHON_INCLUDES) + +_M2Crypto_ext.so: M2Crypto_ext_wrap.o + gcc -shared -o $@ $< -- cgit v1.2.3-1-g7c22