#!/bin/sh # This file is part of NIT ( http://www.nitlanguage.org ). # # Copyright 2008 Jean Privat # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. NITC="../c_src/nitc" NITCOPTS= #"-I parser -I metamodel -I syntax -I compiling -I tmp" CSRC=$( (cd ../c_src; pwd) ) name=`basename $0` case $name in nc) opts="--clibdir ../c_src/clib";; nc2) opts="-p 2"; NITC="./nitc";; nc3) opts="-p 3"; NITC="./nitc_2";; nc4) opts="-p 4"; NITC="./nitc_3";; *) echo "unknown mode $name"; exit 1;; esac ./git-gen-version.sh "$name" echo ${NITC} ${NITCOPTS} ${opts} "$@" k=$(mktemp nc.stderr.XXXXX) rm "$k" trap "rm -f $k; exit 1" INT TERM mkfifo "$k" ./showerr.sh <"$k" & ${NITC} ${NITCOPTS} ${opts} "$@" 2>"$k" err=$? rm "$k" exit $err