Skip to content

Commit

Permalink
[packaging] add make solist call to print out a list of dlopen libraries
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Nov 9, 2017
1 parent d7aada2 commit 65a0fae
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 29 deletions.
5 changes: 5 additions & 0 deletions libknet/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ noinst_HEADERS = \
crypto.h \
crypto_nss.h \
crypto_openssl.h \
dlmodules.h \
host.h \
internals.h \
links.h \
Expand Down Expand Up @@ -99,6 +100,10 @@ libknet_la_LIBADD = $(dl_LIBS) $(pthread_LIBS) $(rt_LIBS) $(m_LIBS)

dist_man_MANS = man

solist:
$(CPP) -I$(top_builddir) -E -dM $(top_srcdir)/libknet/dlmodules.h | \
$(GREP) "^#define LIB" | $(AWK) '{print $$NF}' | sed -e 's/\"//g'

update-man-pages: doxyfile.stamp

doxyfile.stamp: Doxyfile
Expand Down
3 changes: 1 addition & 2 deletions libknet/compress_bzip2.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include "compress_bzip2.h"
#include "logging.h"
#include "common.h"

#define LIBBZ2_1 "libbz2.so.1"
#include "dlmodules.h"

/*
* global vars for dlopen
Expand Down
3 changes: 1 addition & 2 deletions libknet/compress_lz4.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include "compress_lz4.h"
#include "logging.h"
#include "common.h"

#define LIBLZ4_1 "liblz4.so.1"
#include "dlmodules.h"

/*
* global vars for dlopen
Expand Down
3 changes: 1 addition & 2 deletions libknet/compress_lzma.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include "compress_lzma.h"
#include "logging.h"
#include "common.h"

#define LIBLZMA_5 "liblzma.so.5"
#include "dlmodules.h"

/*
* global vars for dlopen
Expand Down
3 changes: 1 addition & 2 deletions libknet/compress_lzo2.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include "compress_lzo2.h"
#include "logging.h"
#include "common.h"

#define LIBLZO2_2 "liblzo2.so.2"
#include "dlmodules.h"

/*
* global vars for dlopen
Expand Down
8 changes: 1 addition & 7 deletions libknet/compress_zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@
#include "compress_zlib.h"
#include "logging.h"
#include "common.h"

#ifdef KNET_LINUX
#define LIBZ_1 "libz.so.1"
#endif
#ifdef KNET_BSD
#define LIBZ_1 "libz.so"
#endif
#include "dlmodules.h"

/*
* global vars for dlopen
Expand Down
3 changes: 1 addition & 2 deletions libknet/crypto_nss.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#include "crypto.h"
#include "crypto_nss.h"
#include "logging.h"

#define LIBNSS3 "libnss3.so"
#include "dlmodules.h"

/*
* global vars for dlopen
Expand Down
13 changes: 1 addition & 12 deletions libknet/crypto_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,14 @@
#include "crypto.h"
#include "crypto_openssl.h"
#include "logging.h"
#include "dlmodules.h"

/*
* 1.0.2 requires at least 120 bytes
* 1.1.0 requires at least 256 bytes
*/
#define SSLERR_BUF_SIZE 512

/*
* make this more generic.
* Fedora packages it one way, Debian another
* and it changes by version
*/
#ifdef KNET_LINUX
#define LIBOPENSSL "libcrypto.so"
#endif
#ifdef KNET_BSD
#define LIBOPENSSL "libcrypto.so.10"
#endif

/*
* global vars for dlopen
*/
Expand Down
66 changes: 66 additions & 0 deletions libknet/dlmodules.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright (C) 2017 Red Hat, Inc. All rights reserved.
*
* Authors: Fabio M. Di Nitto <fabbione@kronosnet.org>
*
* This software licensed under GPL-2.0+, LGPL-2.0+
*/

#include "config.h"

#ifndef __KNET_DLMODULES_H__
#define __KNET_DLMODULES_H__

/*
* compress libraries
*/

#ifdef BUILDCOMPBZIP2
#define LIBBZ2_1 "libbz2.so.1"
#endif

#ifdef BUILDCOMPLZ4
#define LIBLZ4_1 "liblz4.so.1"
#endif

#ifdef BUILDCOMPLZMA
#define LIBLZMA_5 "liblzma.so.5"
#endif

#ifdef BUILDCOMPLZO2
#define LIBLZO2_2 "liblzo2.so.2"
#endif

#ifdef BUILDCOMPZLIB
#ifdef KNET_LINUX
#define LIBZ_1 "libz.so.1"
#endif
#ifdef KNET_BSD
#define LIBZ_1 "libz.so"
#endif
#endif

/*
* crypto libraries
*/

#ifdef BUILDCRYPTONSS
#define LIBNSS3 "libnss3.so"
#endif

/*
* make this more generic.
* Fedora packages it one way, Debian another
* and it changes by version
*/

#ifdef BUILDCRYPTOOPENSSL
#ifdef KNET_LINUX
#define LIBOPENSSL "libcrypto.so"
#endif
#ifdef KNET_BSD
#define LIBOPENSSL "libcrypto.so.10"
#endif
#endif

#endif

0 comments on commit 65a0fae

Please sign in to comment.