File: build-jsoncpp

package info (click to toggle)
openvpn3-client 24.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 19,384 kB
  • sloc: cpp: 180,128; python: 11,591; ansic: 1,878; sh: 1,767; java: 402; lisp: 81; makefile: 44
file content (78 lines) | stat: -rwxr-xr-x 1,400 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash

set -e
if [ -z "$O3" ]; then
    echo O3 var must point to ovpn3 tree
    exit 1
fi
if [ -z "$TARGET" ]; then
    echo TARGET var must be defined
    exit 1
fi

[ -z "$DL" ] && DL=~/Downloads

# source vars
. $O3/core/vars/vars-${TARGET}
. $O3/core/deps/lib-versions

# source helper functions
. $O3/core/deps/functions.sh

GPP=g++
LD=ld
AR="ar rc"
RANLIB=ranlib
[ "$GPP_CMD" ] && GPP=$GPP_CMD
[ "$LD_CMD" ] && LD=$LD_CMD
[ "$AR_CMD" ] && AR="$AR_CMD"
[ "$RANLIB_CMD" ] && RANLIB="$RANLIB_CMD"

case $PLATFORM in
android*)
  echo PLATFORM android
  host="x86_64-apple-darwin"
  target=arm
  ;;
ios*)
  echo PLATFORM ios
  host="x86_64-apple-darwin"
  target=arm
  ;;
*)
  host=""
  target=""
  ;;
esac

if [ "$target" ]; then
    targ_opt="--target=$target"
fi

if [ "$host" ]; then
    host_opt="--host=$host"
fi

FNAME=jsoncpp-${JSONCPP_VERSION}.tar.gz
URL=https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/${JSONCPP_VERSION}.tar.gz
CSUM=${JSONCPP_CSUM}

download

DIST=$(pwd)/jsoncpp/jsoncpp-$PLATFORM
rm -rf $DIST
mkdir -p $DIST/include
mkdir $DIST/lib

tar xfz $DL/$FNAME

cd jsoncpp-$JSONCPP_VERSION
python amalgamate.py
cd dist
CMD="$GPP -I. $PLATFORM_FLAGS $CXX_COMPILER_FLAGS $OTHER_COMPILER_FLAGS $LIB_OPT_LEVEL $LIB_FPIC -c jsoncpp.cpp"
echo $CMD
$CMD
$AR $DIST/lib/libjsoncpp.a jsoncpp.o
$RANLIB $DIST/lib/libjsoncpp.a
cp -a json $DIST/include/
exit 0