From 9e541bc4aafa8179ecdc17c751e1cd8fecc2a6eb Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Tue, 31 May 2016 00:45:00 +0300 Subject: [PATCH] core: added libsxt skel; --- Makefile.am | 2 +- configure.ac | 3 +++ sxt/Makefile.am | 39 ++++++++++++++++++++++++++++++ sxt/VERSION | 3 +++ sxt/core.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ sxt/libsxt.pc.in | 13 ++++++++++ 6 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 sxt/Makefile.am create mode 100644 sxt/VERSION create mode 100644 sxt/core.c create mode 100644 sxt/libsxt.pc.in diff --git a/Makefile.am b/Makefile.am index 3840e9c..771afad 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ else EXAMPLES = endif -SUBDIRS = include tdata sexpr sxmp ydaemon man $(EXAMPLES) +SUBDIRS = include tdata sxt sexpr sxmp ydaemon man $(EXAMPLES) libsxmpdocdir = ${prefix}/doc/libsxmp libsxmpdoc_DATA = \ diff --git a/configure.ac b/configure.ac index 7a164e0..f101329 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(libsxmp, m4_esyscmd([tr -d '\n' < VERSION.sxmp])) +AC_SUBST([LIBSXT_VERSION], m4_esyscmd([tr -d '\n' < sxt/VERSION])) AC_SUBST([LIBTDATA_VERSION], m4_esyscmd([tr -d '\n' < tdata/VERSION])) AC_SUBST([LIBSEXPR_VERSION], m4_esyscmd([tr -d '\n' < sexpr/VERSION])) AC_SUBST([LIBYDAEMON_VERSION], m4_esyscmd([tr -d '\n' < ydaemon/VERSION])) @@ -102,6 +103,8 @@ dnl AM_CONDITIONAL(BUILD_WIN32, test "x$enable_win32_build" = "xyes") AC_OUTPUT([ Makefile +sxt/libsxt.pc +sxt/Makefile sxmp/libsxmp.pc sxmp/Makefile sexpr/Makefile diff --git a/sxt/Makefile.am b/sxt/Makefile.am new file mode 100644 index 0000000..9cffa81 --- /dev/null +++ b/sxt/Makefile.am @@ -0,0 +1,39 @@ +## Process this file with automake to produce Makefile.in + +AM_CPPFLAGS = \ + -DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \ + -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \ + -DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \ + $(LIBSXMP_CFLAGS) -I../include + +AM_CFLAGS =\ + -Wall\ + -g + +lib_LTLIBRARIES = libsxt.la + + +libsxt_la_SOURCES = \ + core.c + +libsxt_la_LDFLAGS = + +libsxt_la_LIBADD = -lpthread -lcrypto $(OPENSSL_LIBS) + +if COND_WIN32 + +libsxt_la_LDFLAGS += -no-undefined +libsxt_la_LIBADD += -lmman -luuid /mingw64/lib/libtdata.a + +else + +libsxt_la_LIBADD += $(LIBUUID_LIBS) ../tdata/.libs/libtdata.la + +endif !COND_WIN32 + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libsxt.pc + +EXTRA_DIST = \ + libsxt.pc.in + diff --git a/sxt/VERSION b/sxt/VERSION new file mode 100644 index 0000000..64b3f4a --- /dev/null +++ b/sxt/VERSION @@ -0,0 +1,3 @@ +0.0.1 + + diff --git a/sxt/core.c b/sxt/core.c new file mode 100644 index 0000000..a1f2e01 --- /dev/null +++ b/sxt/core.c @@ -0,0 +1,62 @@ +/* + * Secure eXtended Message Passing framework + * Secure eXtended Transport layer implementation: (libsxt) + * - very similar to SSH2/TLS + * - using already proven and tested crypto algos + * - better than TLS for message passing + * + * (c) Alexander Vdolainen 2016 + * + * libsxmp is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libsxmp is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see ."; + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#define EBADE 1 +#define NETDB_SUCCESS 0 +#else +#include +#include +#include +#include +#endif + +#include +#include +#include + +#include +#include + +int sxt_init(void) +{ + return; +} + +int sxt_finish(void) +{ + return; +} diff --git a/sxt/libsxt.pc.in b/sxt/libsxt.pc.in new file mode 100644 index 0000000..6504c16 --- /dev/null +++ b/sxt/libsxt.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +datarootdir=@datarootdir@ +datadir=@datadir@ +includedir=@includedir@ + +Name: libsxt +Description: Secure eXtended Transport implementation library +Version: @LIBSXT_VERSION@ +Requires: +Libs: -L${libdir} -lsxt +Cflags: -I${includedir}