Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
renaming some tracing functions to make easy to remember what they do
[simgrid.git] / bootstrap
index 677d942..1e86b57 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -1,47 +1,95 @@
-#!/bin/sh -e
+#!/bin/sh
 # Run this to generate all the initial makefiles, etc.
 
-amver=1.8
+# Copyright (c) 2004-2007. The SimGrid team. All right reserved.
 
+# This file is part of the SimGrid project. This is free software:
+# You can redistribute and/or modify it under the terms of the
+# GNU LGPL (v2.1) licence.
+
+amversions="1.10 1.11"
+
+if [ ! -e bootstrap ] ; then
+  if [ -e ../bootstrap ] ; then
+    cd ..
+  fi
+fi
+
+check_version()
+{
+    eval $2 --version 2>/dev/null | grep -i "$1.*$3" >/dev/null
+}
+
+find_version()
+{
+    tool=$1
+    found="NOT_FOUND"
+    shift
+    versions="$*"
+
+    for version in $versions ; do
+       if check_version $tool ${tool}${variant} $version; then
+           found="${version}"
+           echo ${version} >&2
+           break
+       fi
+    done
+    if [ "x$found" = "xNOT_FOUND" ]; then
+       found="-" 
+    fi
+    echo $found
+}
+
+amver=`find_version automake ${amversions}`
+
+lt=`which libtoolize`
+if [ "x$lt" = "x" ] ; then
+  echo "Libtool not found. Please install the libtool package to proceed with a SVN checkout"
+  exit 1
+fi
+
+am=`which automake-$amver`
+if [ "x$am" = "x" ] ; then
+  echo "automake versions $amversions not found. Please install the relevant package to proceed with a SVN checkout"
+  exit 1
+fi
+
+ac=`which autoconf`
+if [ "x$ac" = "x" ] ; then
+  echo "autoconf not found. Please install the relevant package to proceed with a SVN checkout"
+  exit 1
+fi
+
+set -e
 # AUTOCONF=
 # AUTOHEADER=
 # AUTOPOINT=
 # LIBTOOLIZE=
 
-# Add the following to ACLOCAL to use the installed m4 macro about gtk-doc-tools instead of ours
-# -I /usr/share/aclocal/gnome2-macros
-
 ACLOCAL="aclocal-$amver -I acmacro" \
 AUTOMAKE="automake-$amver" \
-  autoreconf -v || exit 1
-
-if test -z "$*"; then
-  if test -e aci.conf ; then
-    source aci.conf
-    echo "**Warning**: I am going to run \`configure' with arguments resulting from aci_configurator execution."
-    echo "ie, $configure_args."
-    echo "If you wish to pass other ones, please specify them on the"
-    echo \`$0\'" command line, or rerun aci_configurator and save the new ones."
-    echo
-  else
-    configure_args="--enable-maintainer-mode --enable-gtk-doc"
-    echo "**Warning**: I am going to run \`configure' with the default arguments."
-    echo "ie, $configure_args."
-    echo "If you wish to pass any to it, please specify them on the"
-    echo \`$0\'" command line."
-    echo
-  fi
-else
-  configure_args="$@"
-  echo "I am going to run \`configure' with the provided arguments."
-  echo "ie, $configure_args."
-fi
+  autoreconf -v -i -s || exit 1
+
+echo
+echo "And now, please launch ./configure"
+echo "----------------------------------"
 
-echo "************"
-echo "* Running ./configure $configure_args..."
-echo "************"
-./configure $configure_args || exit 1
+# What to do the day we declare optional modules using ACI:
+#  if test -e aci.conf ; then
+#   source aci.conf
+#   pass the content of $configure_args to configure
 
-echo Now type \`make\' to compile the package
+echo 
+echo "Most common flags:"
+echo "  --enable-maintainer-mode         mandatory if you use the SVN version"
+echo "  --disable-compile-optimizations  useful if your gdb gets fooled"
+echo
 
+echo 
+echo "If you want to compile for several archs from the same (nfs-mounted?) tree, do:"
+echo "  mkdir your_arch; cd your_arch && ../configure --srcdir=.."
 
+echo 
+echo "(after configure, you'll naturally have to run \`make')"
+echo 
+echo