blob: e19510d1bf9f1a39ad3ec1f452e72c8642bd6452 (
plain)
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
|
#!/bin/bash
# Configures a protobuf suitable for use in the mongo server, built on the host machine.
set -euo pipefail
IFS=$'\n\t'
set -vx
TOOLCHAIN_ROOT=/opt/mongodbtoolchain/v3
PATH="$TOOLCHAIN_ROOT/bin:$PATH"
DEST_DIR=$(git rev-parse --show-toplevel)/src/third_party/protobuf
HOST_OS="$(uname -s|tr A-Z a-z)"
HOST_ARCH="$(uname -m)"
HOST_DIR="$DEST_DIR/platform/${HOST_OS}_${HOST_ARCH}"
SRC_DIR=${DEST_DIR}/dist
pushd $SRC_DIR
autoreconf -fi
popd
mkdir -p $HOST_DIR/build
pushd $HOST_DIR/build
# force disable:
# coredump : postmortem analysis of core memory dumps
# ptrace : unwinding stacks in another process
# setjmp : provides a nonlocal goto feature
# documentation : won't need them
# tests : won't need them
# dependency-tracking : (from automake) disabled because we only do one build
# cxx-exceptions : intrusive exception handling runtime
$SRC_DIR/configure \
--prefix=$HOST_DIR/install \
CC=$TOOLCHAIN_ROOT/bin/gcc \
CXX=$TOOLCHAIN_ROOT/bin/g++
CC=$TOOLCHAIN_ROOT/bin/gcc
CXX=$TOOLCHAIN_ROOT/bin/g++
pushd src
make CC=$CC CXX=$CXX -j16 protoc V=1
popd
popd
|