Merge: Nit for mac
authorJean Privat <jean@pryen.org>
Mon, 23 Jun 2014 19:30:53 +0000 (15:30 -0400)
committerJean Privat <jean@pryen.org>
Mon, 23 Jun 2014 19:30:53 +0000 (15:30 -0400)
Some minor, but needed, tweaks to allow the compilation of Nit on Mac OS X

A special page is also created: http://nitlanguage.org/on_mac/

Currenlty, only 31 tests does not pass, most of them are platform or FFI related (some SDK are missing).

Pull-Request: #517
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

1  2 
tests/tests.sh

diff --combined tests/tests.sh
@@@ -19,6 -19,7 +19,7 @@@
  
  # Set lang do default to avoid failed tests because of locale
  export LANG=C
+ export LC_ALL=C
  export NIT_TESTING=true
  
  unset NIT_DIR
@@@ -318,11 -319,6 +319,11 @@@ case $engine i
        niti)
                enginebinname=nit
                ;;
 +      emscripten)
 +              enginebinname=nitg
 +              OPT="-m emscripten_nodejs.nit --semi-global $OPT"
 +              savdirs="sav/nitg-sg/"
 +              ;;
        nitc)
                echo "disabled engine $engine"
                exit 0
@@@ -414,11 -410,6 +415,11 @@@ for ii in "$@"; d
                        inputs=/dev/null
                fi
  
 +              ffout="$ff.bin"
 +              if [ "$engine" = "emscripten" ]; then
 +                      ffout="$ff.bin.js"
 +              fi
 +
                if [ "$engine" = "niti" ]; then
                        cat > "./$ff.bin" <<END
  exec $NITC --no-color $OPT "$i" $includes -- "\$@"
@@@ -436,25 -427,16 +437,25 @@@ EN
                        # Compile
                        if [ "x$verbose" = "xtrue" ]; then
                                echo ""
 -                              echo $NITC --no-color $OPT -o "$ff.bin" "$i" "$includes" $nocc
 +                              echo $NITC --no-color $OPT -o "$ffout" "$i" "$includes" $nocc
                        fi
                        NIT_NO_STACK=1 JNI_LIB_PATH=$JNI_LIB_PATH JAVA_HOME=$JAVA_HOME \
 -                              $TIMEOUT $NITC --no-color $OPT -o "$ff.bin" "$i" $includes $nocc 2> "$ff.cmp.err" > "$ff.compile.log"
 +                              $TIMEOUT $NITC --no-color $OPT -o "$ffout" "$i" $includes $nocc 2> "$ff.cmp.err" > "$ff.compile.log"
                        ERR=$?
                        if [ "x$verbose" = "xtrue" ]; then
                                cat "$ff.compile.log"
                                cat >&2 "$ff.cmp.err"
                        fi
                fi
 +              if [ "$engine" = "emscripten" ]; then
 +                      echo > "./$ff.bin" "nodejs $ffout \"\$@\""
 +                      chmod +x "$ff.bin"
 +                      if grep "Fatal Error: more than one primitive class" "$ff.compile.log" > /dev/null; then
 +                              echo " [skip] do no not imports kernel"
 +                              echo >>$xml "<testcase classname='$pack' name='$bf'><skipped/></testcase>"
 +                              continue
 +                      fi
 +              fi
                if [ "$ERR" != 0 ]; then
                        echo -n "! "
                        cat "$ff.compile.log" "$ff.cmp.err" > "$ff.res"