Skip to content
This repository
tree: 4dffbc85cc
Fetching contributors…

Cannot retrieve contributors at this time

file 149 lines (121 sloc) 3.775 kb
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
#!/bin/bash

echo "########################################################"
echo "# build.sh #"
echo "########################################################"

. config/detect_distro.sh

OPTIONS="--disable-dependency-tracking --disable-relative --enable-gcov"
PREFIX="--prefix=/usr --sysconfdir=/etc"
RESULTS="arangod arangosh"

export CPPFLAGS=""
export LDFLAGS=""
export MAKEJ="-j 2"
export LDD_INFO="no"

echo
echo "########################################################"
echo "Building on $TRI_OS_LONG"
echo "########################################################"
echo

case $TRI_OS_LONG in

  Linux-openSUSE-11.4*)
    echo "Using configuration for openSuSE 11.4"
    OPTIONS="$OPTIONS --enable-all-in-one"
    LDD_INFO="yes"
    ;;

  Linux-openSUSE-11*)
    echo "Using configuration for openSuSE 11"
    OPTIONS="$OPTIONS --enable-all-in-one"
    VALGRIND_TEST="yes"
    LDD_INFO="yes"
    ;;

  Linux-Debian-6*)
    echo "Using configuration for Debian"
    OPTIONS="$OPTIONS --enable-all-in-one"
    LDD_INFO="yes"
    ;;

  Linux-Debian*)
    echo "Using configuration for Debian"
    OPTIONS="$OPTIONS --enable-all-in-one"
    LDD_INFO="yes"
    ;;

  Linux-CentOS-*)
    echo "Using configuration for Centos"
    LDD_INFO="yes"
    ;;

  Linux-Ubuntu-11.10*)
    echo "Using configuration for Ubuntu"
    OPTIONS="$OPTIONS --enable-all-in-one"
    LDD_INFO="yes"
    ;;

  Linux-Ubuntu-*)
    echo "Using configuration for Ubuntu"
    OPTIONS="$OPTIONS --enable-all-in-one"
    LDD_INFO="yes"
    ;;

  Darwin*)
    echo "Using configuration for DARWIN"
    CPPFLAGS='-isystem /usr/include -isystem /opt/local/include -Wno-deprecated-declarations'
    LDFLAGS='-L/usr/lib -L/opt/local/lib' # need to use OpenSSL from system
    OPTIONS="$OPTIONS --enable-all-in-one"
    ;;

  *)
    echo "Using default configuration"
    OPTIONS="$OPTIONS --enable-error-on-warning"
    ;;

esac

echo
echo "########################################################"
echo "CPPFLAGS: $CPPFLAGS"
echo "LDFLAGS: $LDFLAGS"
echo "OPTIONS: $OPTIONS"
echo "########################################################"
echo
echo "########################################################"
echo "init system:"
echo " make setup"
echo "########################################################"
echo

make setup || exit 1

echo
echo "########################################################"
echo "configure:"
echo " ./configure $PREFIX $OPTIONS"
echo "########################################################"
echo

./configure $PREFIX $OPTIONS || exit 1

echo
echo "########################################################"
echo "compile:"
echo " make $MAKEJ"
echo "########################################################"
echo

make $MAKEJ || exit 1

echo
echo "########################################################"
echo "unittests:"
echo " make unittests"
echo "########################################################"
echo

make unittests FORCE=1 || exit 1

echo
echo "########################################################"
echo "lcov:"
echo "########################################################"
echo

rm -rf COVERAGE
mkdir COVERAGE
mkdir COVERAGE/html

current=`pwd`
vprj_folder=`basename $current`
lcov_folder="${vprj_folder}/COVERAGE/html"
c_info_file="${vprj_folder}/COVERAGE/coverage.lcov"
r_info_file="${vprj_folder}/COVERAGE/reduced.lcov"

(
  cd ..
  lcov -b ${vprj_folder} -c -d ${vprj_folder} -o ${c_info_file}.1
  lcov --remove ${c_info_file}.1 "*3rdParty*" -o ${c_info_file}.2
  rm ${c_info_file}.1
  lcov --remove ${c_info_file}.2 "*UnitTests*" -o ${c_info_file}
  rm ${c_info_file}.2
  lcov --extract ${c_info_file} "*${vprj_folder}*" -o ${r_info_file}
  genhtml -o ${lcov_folder} ${r_info_file}
)
Something went wrong with that request. Please try again.