blob: 1c296b64b29c1287b40a0421588515c14ca11dcd [file] [log] [blame]
Ilya Shipitsin75c95aa2021-05-18 09:46:43 +00001#!/bin/bash
2
3#
4# OT helper. script built from documentation: https://github.com/haproxytech/opentracing-c-wrapper
5#
6
7set -e
8
9export OT_CPP_VERSION=1.5.0
10
11if [ ! -f "download-cache/v${OT_CPP_VERSION}.tar.gz" ]; then
12 wget -P download-cache/ \
13 "https://github.com/opentracing/opentracing-cpp/archive/v${OT_CPP_VERSION}.tar.gz"
14fi
15
16if [ "$(cat ${HOME}/opt/.ot-cpp-version)" != "${OT_CPP_VERSION}" ]; then
17 tar xf download-cache/v${OT_CPP_VERSION}.tar.gz
18 cd opentracing-cpp-${OT_CPP_VERSION}
19 mkdir build
20 cd build
21 cmake -DCMAKE_INSTALL_PREFIX=${HOME}/opt -DBUILD_STATIC_LIBS=OFF -DBUILD_MOCKTRACER=OFF -DBUILD_TESTING=OFF ..
Willy Tarreau5ac9a392021-06-10 07:35:15 +020022 make -j$(nproc)
Ilya Shipitsin75c95aa2021-05-18 09:46:43 +000023 make install
24 echo "${OT_CPP_VERSION}" > "${HOME}/opt/.ot-cpp-version"
25fi
26
27git clone https://github.com/haproxytech/opentracing-c-wrapper.git
28cd opentracing-c-wrapper
29 ./scripts/bootstrap
30 ./configure --prefix=${HOME}/opt --with-opentracing=${HOME}/opt
Willy Tarreau5ac9a392021-06-10 07:35:15 +020031 make -j$(nproc)
Ilya Shipitsin75c95aa2021-05-18 09:46:43 +000032 make install
33
34