diff --git a/libknet/Makefile.am b/libknet/Makefile.am index d0aae6a9..18cbb82f 100644 --- a/libknet/Makefile.am +++ b/libknet/Makefile.am @@ -1,114 +1,122 @@ # # Copyright (C) 2010-2017 Red Hat, Inc. All rights reserved. # # Authors: Fabio M. Di Nitto # Federico Simoncelli # # This software licensed under GPL-2.0+, LGPL-2.0+ # MAINTAINERCLEANFILES = Makefile.in include $(top_srcdir)/build-aux/check.mk SYMFILE = libknet_exported_syms EXTRA_DIST = $(SYMFILE) SUBDIRS = . tests man libversion = 1:0:0 # override global LIBS that pulls in lots of craft we don't need here LIBS = sources = \ common.c \ compat.c \ compress.c \ compress_zlib.c \ compress_lz4.c \ compress_lzo2.c \ compress_lzma.c \ compress_bzip2.c \ crypto.c \ crypto_nss.c \ crypto_openssl.c \ handle.c \ host.c \ links.c \ logging.c \ netutils.c \ threads_common.c \ threads_dsthandler.c \ threads_heartbeat.c \ threads_pmtud.c \ threads_rx.c \ threads_tx.c \ transport_udp.c \ transport_sctp.c \ transport_loopback.c \ transport_common.c include_HEADERS = libknet.h pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libknet.pc noinst_HEADERS = \ common.h \ compat.h \ compress.h \ compress_zlib.h \ compress_lz4.h \ compress_lzo2.h \ compress_lzma.h \ compress_bzip2.h \ crypto.h \ crypto_nss.h \ crypto_openssl.h \ host.h \ internals.h \ links.h \ logging.h \ netutils.h \ onwire.h \ threads_common.h \ threads_dsthandler.h \ threads_heartbeat.h \ threads_pmtud.h \ threads_rx.h \ threads_tx.h \ transports.h lib_LTLIBRARIES = libknet.la libknet_la_SOURCES = $(sources) libknet_la_CFLAGS = $(nss_CFLAGS) $(openssl_CFLAGS) \ $(zlib_CFLAGS) $(liblz4_CFLAGS) $(lzo2_CFLAGS) $(liblzma_CFLAGS) $(bzip2_CFLAGS) EXTRA_libknet_la_DEPENDENCIES = $(SYMFILE) libknet_la_LDFLAGS = -Wl,--version-script=$(srcdir)/$(SYMFILE) \ --export-dynamic \ -version-number $(libversion) libknet_la_LIBADD = $(dl_LIBS) $(pthread_LIBS) $(rt_LIBS) $(m_LIBS) +noinst_PROGRAMS = crypto_canary compress_canary +crypto_canary_SOURCES = crypto_canary.c +crypto_canary_CFLAGS = $(nss_CFLAGS) $(openssl_CFLAGS) +crypto_canary_LDADD = $(nss_LIBS) $(openssl_LIBS) +compress_canary_SOURCES = compress_canary.c +compress_canary_CFLAGS = $(zlib_CFLAGS) $(liblz4_CFLAGS) $(lzo2_CFLAGS) $(liblzma_CFLAGS) $(bzip2_CFLAGS) +compress_canary_LDADD = $(zlib_LIBS) $(liblz4_LIBS) $(lzo2_LIBS) $(liblzma_LIBS) $(bzip2_LIBS) + dist_man_MANS = man update-man-pages: doxyfile.stamp doxyfile.stamp: Doxyfile if MANPAGEUPDATES $(DOXYGEN) Doxyfile $(DOXY2MAN) -o $(abs_srcdir)/man -s 3 --short-pkg @PACKAGE_NAME@ --pkg "Kronosnet Programmer's Manual" $(builddir)/xml/libknet_8h.xml else @echo this system does not have doxy2man or doxygen installed. Unable to update man pages automatically. endif touch doxyfile.stamp clean-local: rm -rf doxyfile.stamp xml diff --git a/libknet/compress_canary.c b/libknet/compress_canary.c new file mode 100644 index 00000000..9cdf6d53 --- /dev/null +++ b/libknet/compress_canary.c @@ -0,0 +1,32 @@ +/* Transform the binary into dependencies like: + * dpkg-shlibdeps -pcompress -dSuggests -xlibc6 -elibknet/compress_canary + */ + +#include "config.h" + +char BZ2_bzBuffToBuffCompress(void); +char LZ4_compress_HC(void); +char lzma_easy_buffer_encode(void); +char lzo1x_1_compress(void); +char compress2(void); + +int main (void) +{ + return +#ifdef BUILDCOMPBZIP2 + BZ2_bzBuffToBuffCompress() + +#endif +#ifdef BUILDCOMPLZ4 + LZ4_compress_HC() + +#endif +#ifdef BUILDCOMPLZMA + lzma_easy_buffer_encode() + +#endif +#ifdef BUILDCOMPLZO2 + lzo1x_1_compress() + +#endif +#ifdef BUILDCOMPZLIB + compress2() + +#endif + 0; +} diff --git a/libknet/crypto_canary.c b/libknet/crypto_canary.c new file mode 100644 index 00000000..c9fcced4 --- /dev/null +++ b/libknet/crypto_canary.c @@ -0,0 +1,20 @@ +/* Transform the binary into dependencies like: + * dpkg-shlibdeps -pcrypto -dRecommends -xlibc6 -elibknet/crypto_canary -O | sed 's/,/ |/g' >>debian/substvars + */ + +#include "config.h" + +char NSS_NoDB_Init(void); +char EVP_EncryptInit_ex(void); + +int main (void) +{ + return +#ifdef BUILDCRYPTONSS + NSS_NoDB_Init() + +#endif +#ifdef BUILDCRYPTOOPENSSL + EVP_EncryptInit_ex() + +#endif + 0; +}