f83734fd4afb5fd5ac83d39bd024dbb3a11c4c9f
[vpp.git] / build-root / bootstrap.sh
1 #!/bin/bash
2
3 build_root=`pwd`
4 cd ../
5 wsroot=`pwd`
6
7 # PATH
8 if [[ ! $CCACHE_DIR ]];then
9     CCACHE_DIR="$build_root/.ccache"
10 fi
11 ADD_TO_PATH="$build_root/tools/ccache-bin:$build_root/tools/bin"
12
13 # Construct build-config.mk
14 cd $build_root
15 echo SOURCE_PATH = $wsroot > build-config.mk
16 echo 
17 echo Saving PATH settings in `pwd`/path_setup
18 echo Source this file later, as needed
19 cat >path_setup <<EOF
20 #!/bin/bash
21
22 export PATH=$ADD_TO_PATH:$PATH
23 export CCACHE_DIR=$CCACHE_DIR
24 EOF
25
26 # regenerate tools/ccache-bin
27 rm -rf tools/ccache-bin
28 mkdir -p tools/ccache-bin
29
30 if [ ! -f /usr/bin/ccache ] ; then
31     echo Please install ccache AYEC and re-run this script
32 fi
33
34 cd tools/ccache-bin
35 for c in gcc g++
36     do
37     if [ -f /usr/bin/ccache ] ; then
38         ln -s /usr/bin/ccache $c
39     else
40         ln -s /usr/bin/gcc
41     fi
42 done
43
44 cd $wsroot
45
46 cd $build_root
47 echo Compile native tools
48 for tool in vppapigen
49 do
50     make V=0 is_build_tool=yes $tool-install
51 done
52