Skip to content
This repository
branch: 3.12.1-gdb
Fetching contributors…

Cannot retrieve contributors at this time

executable file 113 lines (89 sloc) 2.018 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
#!/bin/sh

# If you want to help me by participating to the build/test effort:
# http://gallium.inria.fr/~pouillar/ocaml-testing.html
# -- Nicolas Pouillard

usage() {
  echo "Usage: $0 (make|ocb|ocamlbuild) (win (mingw|msvc|msvc64) | <configure-arg>*)"
  exit 1
}

logfile="buildbot.log"

finish() {
  curl -s -0 -F "log=@$logfile" \
             -F "host=`hostname`" \
             -F "mode=$mode-$opt_win-$opt_win2" \
             http://buildbot.feydakins.org/dropbox || :
}

rm -f buildbot.failed
rm -f $logfile

bad() {
  touch buildbot.failed
}

finish_if_bad() {
  if [ -f buildbot.failed ]; then
    finish
    exit 2
  fi
}

if figlet "test" > /dev/null 2> /dev/null; then
  draw="figlet"
else
  draw="echo ----------- "
fi

if echo | tee -a tee.log > /dev/null 2> /dev/null; then
  tee="tee -a $logfile"
else
  tee=:
fi

rm -f tee.log

log() {
  $draw $@
  $tee
}

mode=$1
shift 1

case "$mode" in
  make|ocb|ocamlbuild) : ;;
  *) usage;;
esac

case "$1" in
  win)
    opt_win=win
    opt_win2=$2
    shift 2
    Makefile=Makefile.nt;;
  *) Makefile=Makefile;;
esac

( [ -f config/Makefile ] && make -f $Makefile clean || : ) 2>&1 | log clean

( ./build/distclean.sh || : ) 2>&1 | log distclean

(cvs -q up -dP -r release311 || bad) 2>&1 | log cvs up
finish_if_bad

case "$opt_win" in
win)

  # FIXME
  sed -e 's/\(OTHERLIBRARIES=.*\) labltk/\1/' \
    < "config/Makefile.$opt_win2" > config/Makefile || bad
  finish_if_bad

  cp config/m-nt.h config/m.h || bad
  finish_if_bad
  cp config/s-nt.h config/s.h || bad
  finish_if_bad
  ;;

*)
  (./configure --prefix `pwd`/_install $@ || bad) 2>&1 | log configure
  finish_if_bad
  ;;
esac

case "$mode" in
  make)
    (make -f $Makefile world opt opt.opt install || bad) 2>&1 | log build install
    finish_if_bad
    ;;
  ocb|ocamlbuild)
    (./build/fastworld.sh || bad) 2>&1 | log build
    finish_if_bad
    (./build/install.sh || bad) 2>&1 | log install
    finish_if_bad
    ;;
esac

(cat _build/not_installed || bad) 2>&1 | log not_installed

finish
Something went wrong with that request. Please try again.