6d86081997-12-22Fredrik Hübinette (Hubbe) #!/bin/sh
4425ba1999-07-15Fredrik Hübinette (Hubbe) # # FIXME: It is time to re-write this in Pike #
e3fa691997-12-28Fredrik Hübinette (Hubbe) . $NTTOOLS set -e OPTIONS=$1
6d86081997-12-22Fredrik Hübinette (Hubbe) shift OUTPUT=$1 shift
6dc2772000-07-28Fredrik Hübinette (Hubbe) case "`echo $CC`" in *rntcl*|*rntecl*)
4469f31999-06-19Fredrik Hübinette (Hubbe)  case "E$OPTIONS" in
b4dca31999-07-08Fredrik Hübinette (Hubbe)  *x*) ofixed="`fixpath $OUTPUT`" if [ $# = 0 ]; then to_extract=`do_cmd lib -list -nologo "$ofixed"` else to_extract=$@ fi for a in $to_extract do do_cmd lib -nologo "-extract:$a" "$ofixed" done exit $? ;;
4469f31999-06-19Fredrik Hübinette (Hubbe)  *d*) exit 1 ;; *x*) exit 1 ;; *q*|*r*) do_cmd lib "-OUT:`fixpath $OUTPUT`" `fixpath $@`
4425ba1999-07-15Fredrik Hübinette (Hubbe)  winname="`echo $OUTPUT | sed -e 's/^lib\(.*\)\.a/\1.lib/'`" if [ "$winname" != "$OUTPUT" ]; then cp "$OUTPUT" "$winname" fi
4469f31999-06-19Fredrik Hübinette (Hubbe)  exit $? ;; esac ;;
6dc2772000-07-28Fredrik Hübinette (Hubbe)  *rntcc*)
4469f31999-06-19Fredrik Hübinette (Hubbe) 
4425ba1999-07-15Fredrik Hübinette (Hubbe)  XOPTS="-b -c" case "E$OPTIONS" in *x*) OPCHAR='*' if [ $# = 0 ]; then TMPDIR=TMP$$.d rm -rf $TMPDIR >/dev/null 2>/dev/null || : mkdir $TMPDIR do_cmd wlib -x -d=$TMPDIR `fixpath $OUTPUT` ( cd $TMPDIR for a in * do BASE=`echo $a | sed -e 's/\.[^.]$//'` mv $a ../$BASE.o done ) rm -rf $TMPDIR >/dev/null 2>/dev/null || : exit 0 fi ;; *d*) OPTCHAR='-' ;; *r*) OPCHAR='-+' ;; *q*) OPCHAR='+' ;; esac XFILE=TMP$$.l rm $XFILE 2>/dev/null 1>/dev/null || : OPTS= for a in "$@" do OPTS="$OPTS $OPCHAR$a" done echo >$XFILE "$OPTS" do_cmd wlib $XOPTS `fixpath $OUTPUT` @$XFILE if [ $CLEANUP = yes ]; then if [ -f $XFILE ]; then rm $XFILE fi fi
e3fa691997-12-28Fredrik Hübinette (Hubbe) 
4425ba1999-07-15Fredrik Hübinette (Hubbe)  winname="`echo $OUTPUT | sed -e 's/^lib\(.*\)\.a/\1.lib/'`" if [ "$winname" != "$OUTPUT" ]; then cp "$OUTPUT" "$winname"
e3fa691997-12-28Fredrik Hübinette (Hubbe)  fi
4425ba1999-07-15Fredrik Hübinette (Hubbe) 
4469f31999-06-19Fredrik Hübinette (Hubbe)  ;; *)
6dc2772000-07-28Fredrik Hübinette (Hubbe)  echo "Unknown C compiler: \"$CC\""
ea14d92000-06-28Henrik Grubbström (Grubba)  exit 1
4469f31999-06-19Fredrik Hübinette (Hubbe)  ;; esac