Home | History | Annotate | Download | only in cpp
      1 #!/bin/bash
      2 # Copyright 2017 gRPC authors.
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #     http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 
     16 set -ex
     17 
     18 cd "$(dirname "$0")/../../.."
     19 
     20 echo "deb http://ftp.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
     21 apt-get update
     22 apt-get install -t jessie-backports -y libssl-dev
     23 
     24 # Install c-ares
     25 cd third_party/cares/cares
     26 git fetch origin
     27 git checkout cares-1_13_0
     28 mkdir -p cmake/build
     29 cd cmake/build
     30 cmake -DCMAKE_BUILD_TYPE=Release ../..
     31 make -j4 install
     32 cd ../../../../..
     33 rm -rf third_party/cares/cares  # wipe out to prevent influencing the grpc build
     34 
     35 # Install zlib
     36 cd third_party/zlib
     37 mkdir -p cmake/build
     38 cd cmake/build
     39 cmake -DCMAKE_BUILD_TYPE=Release ../..
     40 make -j4 install
     41 cd ../../../..
     42 rm -rf third_party/zlib  # wipe out to prevent influencing the grpc build
     43 
     44 # Install protobuf
     45 cd third_party/protobuf
     46 mkdir -p cmake/build
     47 cd cmake/build
     48 cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ..
     49 make -j4 install
     50 cd ../../../..
     51 rm -rf third_party/protobuf  # wipe out to prevent influencing the grpc build
     52 
     53 # Install gRPC
     54 mkdir -p cmake/build
     55 cd cmake/build
     56 cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DCMAKE_BUILD_TYPE=Release ../..
     57 make -j4 install
     58 cd ../..
     59 
     60 # Build helloworld example using cmake
     61 cd examples/cpp/helloworld
     62 mkdir -p cmake/build
     63 cd cmake/build
     64 cmake ../..
     65 make
     66 
     67