Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
split up config and function definitions; if ~/simgrid-svn/buildtools/scripts/simgrid...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 22 Dec 2009 17:47:00 +0000 (17:47 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 22 Dec 2009 17:47:00 +0000 (17:47 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6930 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/scripts/make_dist.sh
buildtools/scripts/simgrid_build.conf
buildtools/scripts/simgrid_build.functions [new file with mode: 0644]
buildtools/scripts/test_dist_with_autotools.sh
buildtools/scripts/test_dist_with_cmake.sh

index 4bdfc39..beb084f 100755 (executable)
@@ -2,7 +2,13 @@
 # This script creates a new dist archive from the svn
 
 set -e # fail fast on errors 
-source ~/simgrid-svn/buildtools/scripts/simgrid_build.conf # get config
+
+# get config
+if [ -e ~/simgrid-svn/buildtools/scripts/simgrid_build.conf ] ; then
+  source ~/simgrid-svn/buildtools/scripts/simgrid_build.conf
+else
+  source ~/.simgrid_build.conf
+fi
 
 echo "get Linux dependencies"
 sudo aptitude install -y libtool automake1.10 autoconf libgcj10-dev gcc g++ bash flex flexml doxygen bibtex bibtool iconv bibtex2html addr2line valgrind transfig
index 0e92d1b..ae3a339 100644 (file)
@@ -7,75 +7,5 @@ SIMGRID_SVN_ROOT=~/simgrid-svn
 # Root of build directories and so on
 SIMGRID_BASEDIR=~/simgrid
 
-
-
 ############ Do not change anything below, unless your first name is Martin or Pierre ##############
-
-# get_version: define the version number of the svn into a version variable
-get_version() {
-  if [ x$version = x ] ; then
-    cd ${SIMGRID_SVN_ROOT}
-    svn up
-    version="simgrid-3.3.4-svn-r"`svnversion`
-    export version
-  fi
-}
-
-# wait_archive: wait until the archive gets defined into the right position
-wait_archive() {
-  while [ ! -e ${SIMGRID_BASEDIR}/${version}.tar.gz ] ; do
-    echo ${SIMGRID_BASEDIR}/${version}.tar.gz not found. Wait five seconds.
-    sleep 5
-  done
-}
-
-# make_dist: rebuild an archive from the svn
-make_dist() {
-  get_version
-  if [ ! -e ${SIMGRID_BASEDIR}/${version}.tar.gz ] ; then
-    cd ${SIMGRID_BASEDIR}
-    echo "rebuild the missing files for compilation"
-    if [ ! -e configure ] ; then
-      ./bootstrap
-    fi
-    if [ ! -e Makefile ] ; then
-       # Disable compilation optim to make it built faster
-       ./configure --enable-maintainer-mode --disable-compile-optimizations
-    fi
-    echo "Make the archive"
-    make all dist
-
-    echo "Copy the archive in position"
-    mkdir -p ${SIMGRID_BASEDIR}
-    mv ${version}.tar.gz ${SIMGRID_BASEDIR}
-  else
-    echo "${SIMGRID_BASEDIR}/${version}.tar.gz already exists. Don't rebuild"
-  fi
-}
-
-# clean_node: remove everything about this node
-clean_node() {
-  OS=`uname`
-  node=`uname -n`
-  # OS specific working directory 
-  BUILDDIR=${SIMGRID_BASEDIR}/$OS/$node/$version
-  export BUILDDIR
-  
-  # Clean any leftover from previous install
-  if [ -e $BUILDDIR ] ; then
-    echo "remove old directory $BUILDDIR"
-    rm -rf $BUILDDIR
-  fi
-  mkdir -p $BUILDDIR
-}
-
-# open_archive: wait for archive to be built, cleanup previous
-open_archive() {
-  get_version
-  clean_node
-  wait_archive
-  cd $BUILDDIR/..
-  tar xfz ${SIMGRID_BASEDIR}/${version}.tar.gz
-  cd $BUILDDIR
-}
-
+source ${SIMGRID_SVN_ROOT}/buildtools/scripts/simgrid_build.functions
diff --git a/buildtools/scripts/simgrid_build.functions b/buildtools/scripts/simgrid_build.functions
new file mode 100644 (file)
index 0000000..5c1c53a
--- /dev/null
@@ -0,0 +1,72 @@
+# This file defines a bunch of useful functions to automatize the build of SimGrid.
+
+
+
+# get_version: define the version number of the svn into a version variable
+get_version() {
+  if [ x$version = x ] ; then
+    cd ${SIMGRID_SVN_ROOT}
+    svn up
+    version="simgrid-3.3.4-svn-r"`svnversion`
+    export version
+  fi
+}
+
+# wait_archive: wait until the archive gets defined into the right position
+wait_archive() {
+  while [ ! -e ${SIMGRID_BASEDIR}/${version}.tar.gz ] ; do
+    echo ${SIMGRID_BASEDIR}/${version}.tar.gz not found. Wait five seconds.
+    sleep 5
+  done
+}
+
+# make_dist: rebuild an archive from the svn
+make_dist() {
+  get_version
+  if [ ! -e ${SIMGRID_BASEDIR}/${version}.tar.gz ] ; then
+    cd ${SIMGRID_BASEDIR}
+    echo "rebuild the missing files for compilation"
+    if [ ! -e configure ] ; then
+      ./bootstrap
+    fi
+    if [ ! -e Makefile ] ; then
+       # Disable compilation optim to make it built faster
+       ./configure --enable-maintainer-mode --disable-compile-optimizations
+    fi
+    echo "Make the archive"
+    make all dist
+
+    echo "Copy the archive in position"
+    mkdir -p ${SIMGRID_BASEDIR}
+    mv ${version}.tar.gz ${SIMGRID_BASEDIR}
+  else
+    echo "${SIMGRID_BASEDIR}/${version}.tar.gz already exists. Don't rebuild"
+  fi
+}
+
+# clean_node: remove everything about this node
+clean_node() {
+  OS=`uname`
+  node=`uname -n`
+  # OS specific working directory 
+  BUILDDIR=${SIMGRID_BASEDIR}/$OS/$node/$version
+  export BUILDDIR
+  
+  # Clean any leftover from previous install
+  if [ -e $BUILDDIR ] ; then
+    echo "remove old directory $BUILDDIR"
+    rm -rf $BUILDDIR
+  fi
+  mkdir -p $BUILDDIR
+}
+
+# open_archive: wait for archive to be built, cleanup previous
+open_archive() {
+  get_version
+  clean_node
+  wait_archive
+  cd $BUILDDIR/..
+  tar xfz ${SIMGRID_BASEDIR}/${version}.tar.gz
+  cd $BUILDDIR
+}
+
index c773f45..7b9d759 100755 (executable)
@@ -2,8 +2,11 @@
 # This script waits that the make_dist script finishes building the right archive in ~/simgrid
 # and then builds it using the autotools
 
-
-source ~/simgrid-svn/buildtools/scripts/simgrid_build.conf
+if [ -e ~/simgrid-svn/buildtools/scripts/simgrid_build.conf ] ; then
+  source ~/simgrid-svn/buildtools/scripts/simgrid_build.conf
+else
+  source ~/.simgrid_build.conf
+fi
 
 open_archive
 if [ ! -e Makefile ] ; then
index 034be45..be54839 100755 (executable)
@@ -2,8 +2,11 @@
 # This script waits that the make_dist script finishes building the right archive in ~/simgrid
 # and then builds it using cmake. Warning, cmake is only a wrapper for now, you still need the autotools
 
-
-source ~/simgrid-svn/buildtools/scripts/simgrid_build.conf
+if [ -e ~/simgrid-svn/buildtools/scripts/simgrid_build.conf ] ; then
+  source ~/simgrid-svn/buildtools/scripts/simgrid_build.conf
+else
+  source ~/.simgrid_build.conf
+fi
 
 open_archive