Create the ndncert library
Change-Id: Ib5167500f16d4fb384ed6098c697355c1a50e4bb
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index db41533..33c02fa 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -42,3 +42,9 @@
# Install
sudo ./waf -j1 --color=yes install
+
+if has Linux $NODE_LABELS; then
+ sudo ldconfig
+elif has FreeBSD $NODE_LABELS; then
+ sudo ldconfig -a
+fi
diff --git a/ndncert.pc.in b/ndncert.pc.in
new file mode 100644
index 0000000..c0c5204
--- /dev/null
+++ b/ndncert.pc.in
@@ -0,0 +1,9 @@
+prefix=@PREFIX@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: ndncert
+Description: ndncert library
+Version: @VERSION@
+Libs: -L${libdir} -lndncert
+Cflags: -I${includedir}
diff --git a/wscript b/wscript
index 2403d30..1412d1c 100644
--- a/wscript
+++ b/wscript
@@ -48,16 +48,46 @@
conf.load('sanitizers')
+ # If there happens to be a static library, waf will put the corresponding -L flags
+ # before dynamic library flags. This can result in compilation failure when the
+ # system has a different version of the ndncert library installed.
+ conf.env['STLIBPATH'] = ['.'] + conf.env['STLIBPATH']
+
conf.write_config_header('src/ndncert-config.hpp')
def build(bld):
core = bld(
target = "objects",
- features=['cxx'],
+ features=['cxx', 'cxxshlib'],
source = bld.path.ant_glob(['src/**/*.cpp']),
+ vnum = VERSION,
+ cnum = VERSION,
use = 'NDN_CXX BOOST',
includes = ['src'],
export_includes=['src'],
)
bld.recurse('tests')
+
+ bld.install_files(
+ dest = "%s/ndncert" % bld.env['INCLUDEDIR'],
+ files = bld.path.ant_glob(['src/**/*.hpp', 'src/**/*.h']),
+ cwd = bld.path.find_dir("src"),
+ relative_trick = True,
+ )
+
+ bld.install_files(
+ dest = "%s/ndncert" % bld.env['INCLUDEDIR'],
+ files = bld.path.get_bld().ant_glob(['src/**/*.hpp']),
+ cwd = bld.path.get_bld().find_dir("src"),
+ relative_trick = False,
+ )
+
+ bld(features = "subst",
+ source='ndncert.pc.in',
+ target='ndncert.pc',
+ install_path = '${LIBDIR}/pkgconfig',
+ PREFIX = bld.env['PREFIX'],
+ INCLUDEDIR = "%s/ndncert" % bld.env['INCLUDEDIR'],
+ VERSION = VERSION,
+ )