Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics
[simgrid.git] / buildtools / scripts / simgrid_build.conf
1 # This is the configuration file for every scripts around.
2 # Don't mess with it, unless you know what you are doing
3
4 # Where to find the svn checkout
5 SIMGRID_SVN_ROOT=~/simgrid-svn
6
7 # Root of build directories and so on
8 SIMGRID_BASEDIR=~/simgrid
9
10
11
12 ############ Do not change anything below, unless your first name is Martin or Pierre ##############
13
14 # get_version: define the version number of the svn into a version variable
15 get_version() {
16   if [ x$version = x ] ; then
17     cd ${SIMGRID_SVN_ROOT}
18     svn up
19     version="simgrid-3.3.4-svn-r"`svnversion`
20     export version
21   fi
22 }
23
24 # wait_archive: wait until the archive gets defined into the right position
25 wait_archive() {
26   while [ ! -e ${SIMGRID_BASEDIR}/${version}.tar.gz ] ; do
27     echo ${SIMGRID_BASEDIR}/${version}.tar.gz not found. Wait five seconds.
28     sleep 5
29   done
30 }
31
32 # make_dist: rebuild an archive from the svn
33 make_dist() {
34   get_version
35   if [ ! -e ${SIMGRID_BASEDIR}/${version}.tar.gz ] ; then
36     cd ${SIMGRID_BASEDIR}
37     echo "rebuild the missing files for compilation"
38     if [ ! -e configure ] ; then
39       ./bootstrap
40     fi
41     if [ ! -e Makefile ] ; then
42        # Disable compilation optim to make it built faster
43        ./configure --enable-maintainer-mode --disable-compile-optimizations
44     fi
45     echo "Make the archive"
46     make all dist
47
48     echo "Copy the archive in position"
49     mkdir -p ${SIMGRID_BASEDIR}
50     mv ${version}.tar.gz ${SIMGRID_BASEDIR}
51   else
52     echo "${SIMGRID_BASEDIR}/${version}.tar.gz already exists. Don't rebuild"
53   fi
54 }
55
56 # clean_node: remove everything about this node
57 clean_node() {
58   OS=`uname`
59   node=`uname -n`
60   # OS specific working directory 
61   BUILDDIR=${SIMGRID_BASEDIR}/$OS/$node/$version
62   export BUILDDIR
63   
64   # Clean any leftover from previous install
65   if [ -e $BUILDDIR ] ; then
66     echo "remove old directory $BUILDDIR"
67     rm -rf $BUILDDIR
68   fi
69   mkdir -p $BUILDDIR
70 }
71
72 # open_archive: wait for archive to be built, cleanup previous
73 open_archive() {
74   get_version
75   clean_node
76   wait_archive
77   cd $BUILDDIR/..
78   tar xfz ${SIMGRID_BASEDIR}/${version}.tar.gz
79   cd $BUILDDIR
80 }
81