mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 20:00:58 +01:00
added configure flag --with-python-binding
This commit is contained in:
@@ -59,6 +59,12 @@ Pretty Curved Privacy - File encryption using eliptic curve cryptography.
|
||||
# generate usage.h
|
||||
(cd src && ./usage.sh)
|
||||
|
||||
# generate pypcp types
|
||||
bindings/py/gencffi.pl include/pcp/defines.h include/pcp/structs.h include/pcp/key.h \
|
||||
include/pcp/buffer.h include/pcp/context.h include/pcp/mac.h \
|
||||
include/pcp/ed.h include/pcp/crypto.h include/pcp/vault.h \
|
||||
include/pcp/pcpstream.h include/pcp/z85.h > bindings/py/pypcp/raw.py
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
@@ -5,4 +5,4 @@ install:
|
||||
python setup.py install
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
rm -rf build pypcp/*.pyc
|
||||
19
configure.ac
19
configure.ac
@@ -294,8 +294,27 @@ fi
|
||||
CFLAGS="$CFLAGS -Werror -Wextra -O2"
|
||||
CXXFLAGS="$CFLAGS"
|
||||
|
||||
AC_ARG_WITH([python-binding],
|
||||
[AS_HELP_STRING([--with-python-binding],
|
||||
[Enable python binding])],
|
||||
[python="yes"],
|
||||
[])
|
||||
|
||||
|
||||
|
||||
AC_SUBST(PACKAGE_VERSION)
|
||||
|
||||
# Specify output files
|
||||
AC_CONFIG_FILES([Makefile include/Makefile libpcp/Makefile src/Makefile man/Makefile tests/Makefile libpcp/libpcp1.pc bindings/cpp/Makefile])
|
||||
|
||||
|
||||
if test "x$python" = "xyes"; then
|
||||
if python -c "import cffi" > /dev/null 2>&1; then
|
||||
AC_CONFIG_FILES([bindings/py/Makefile])
|
||||
else
|
||||
AC_MSG_ERROR([python or cffi is not installed])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -8,6 +8,7 @@ extern "C" {
|
||||
#include "pcp/config.h"
|
||||
#include "pcp/base85.h"
|
||||
#include "pcp/buffer.h"
|
||||
#include "pcp/config.h"
|
||||
#include "pcp/context.h"
|
||||
#include "pcp/crypto.h"
|
||||
#include "pcp/defines.h"
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "PCP1 1"
|
||||
.TH PCP1 1 "2014-09-29" "PCP 0.2.3" "USER CONTRIBUTED DOCUMENTATION"
|
||||
.TH PCP1 1 "2014-12-14" "PCP 0.2.3" "USER CONTRIBUTED DOCUMENTATION"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
||||
@@ -7,7 +7,7 @@ int main() {
|
||||
Pcpstream *clear_in, *crypt_out, *clear_out;
|
||||
PCPCTX *ptx;
|
||||
char message[] = "hello world";
|
||||
|
||||
printf("hh: %ld\n", sizeof(UT_hash_handle));
|
||||
/* we always need a context */
|
||||
ptx = ptx_new();
|
||||
|
||||
@@ -15,6 +15,8 @@ int main() {
|
||||
alice = pcpkey_new();
|
||||
bob = pcpkey_new();
|
||||
|
||||
pcpkey_setowner(alice, "alicia", "alicia@local");
|
||||
|
||||
/* get the public parts of them */
|
||||
alicepub = pcpkey_pub_from_secret(alice);
|
||||
bobpub = pcpkey_pub_from_secret(bob);
|
||||
|
||||
Reference in New Issue
Block a user