HBASE-24106 Update getting started documentation after HBASE-24086
[hbase.git] / hbase-native-client / bin / build-thirdparty.sh
blob097c1a44756486ff812e3ec063c62263f986432a
1 #! /usr/bin/env bash
3 #/**
4 # * Copyright The Apache Software Foundation
5 # *
6 # * Licensed to the Apache Software Foundation (ASF) under one
7 # * or more contributor license agreements. See the NOTICE file
8 # * distributed with this work for additional information
9 # * regarding copyright ownership. The ASF licenses this file
10 # * to you under the Apache License, Version 2.0 (the
11 # * "License"); you may not use this file except in compliance
12 # * with the License. You may obtain a copy of the License at
13 # *
14 # * http://www.apache.org/licenses/LICENSE-2.0
15 # *
16 # * Unless required by applicable law or agreed to in writing, software
17 # * distributed under the License is distributed on an "AS IS" BASIS,
18 # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # * See the License for the specific language governing permissions and
20 # * limitations under the License.
21 # */
23 set -x
24 set -e
26 SOURCE="${BASH_SOURCE[0]}"
27 while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
28 DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
29 SOURCE="$(readlink "$SOURCE")"
30 [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
31 done
32 DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
34 source ${DIR}/../bin/hbase-client-env.sh
36 # On some systems, autotools installs libraries to lib64 rather than lib. Fix
37 # this by setting up lib64 as a symlink to lib. We have to do this step first
38 # to handle cases where one third-party library depends on another.
39 mkdir -p "${HBASE_PREFIX}/lib"
40 cd ${HBASE_PREFIX}
41 ln -sf lib "${HBASE_PREFIX}/lib64"
43 if [ ! -f gtest ]; then
44 cd ${HBASE_GTEST_DIR}
45 cmake .
46 make -j4
47 cd ..
48 ln -sf ${HBASE_GTEST_DIR} gtest
51 if [ ! -f ${HBASE_PREFIX}/lib/libprotobuf.a ]; then
52 cd ${HBASE_PROTOBUF_DIR}
53 ./configure --with-pic --disable-shared --prefix=${HBASE_PREFIX}
54 make -j4 install
57 if [ ! -f ${HBASE_PREFIX}/lib/libev.a ]; then
58 cd ${HBASE_LIBEV_DIR}
59 ./configure --with-pic --disable-shared --prefix=${HBASE_PREFIX}
60 make -j4 install
63 echo "---------------------"
64 echo "Thirdparty dependencies built and installed into $HBASE_PREFIX successfully"