6d86081997-12-22Fredrik Hübinette (Hubbe) #!/bin/sh
a0ff752000-06-28Henrik Grubbström (Grubba) # Support local settings.
af7f462000-08-09Fredrik Noring INIT_NTRC=${INIT_NTRC-"$HOME/.init_ntrc"} if [ -f "$INIT_NTRC" ]; then
07b0a12000-08-16Peter Bortas  echo Using rc-file $INIT_NTRC
af7f462000-08-09Fredrik Noring  . "$INIT_NTRC"
a0ff752000-06-28Henrik Grubbström (Grubba) fi
41ee482000-02-28Fredrik Hübinette (Hubbe) #This can be 'sprsh', 'wine' or 'cygwin'
a0ff752000-06-28Henrik Grubbström (Grubba) REMOTE_METHOD=${REMOTE_METHOD-sprsh}
da5cd91998-11-05Fredrik Hübinette (Hubbe) 
4469f31999-06-19Fredrik Hübinette (Hubbe) # Choose 'rntcc' for Watcom or 'rntcl' for Microsoft VC++ # (Make sure VC++ is before Watcom in your path!)
7a22d71999-08-27Fredrik Hübinette (Hubbe) CC=${CC-rntcl}
4469f31999-06-19Fredrik Hübinette (Hubbe) 
623e822000-03-07Fredrik Hübinette (Hubbe) # Important! # Please be sure that you have the line 'veto oplock files = /*/' in your # smb.conf if NTDRIVE is a samba file system.
4469f31999-06-19Fredrik Hübinette (Hubbe) # Edit
7a22d71999-08-27Fredrik Hübinette (Hubbe) NTHOST=${NTHOST-}
00a1b72000-01-16Fredrik Hübinette (Hubbe) NTDRIVE=${NTDRIVE-k:}
4469f31999-06-19Fredrik Hübinette (Hubbe) 
1e1fb61998-01-16Fredrik Hübinette (Hubbe) # Edit
7a22d71999-08-27Fredrik Hübinette (Hubbe) #NTHOST= #NTDRIVE='k:'
dd990d1998-12-31Fredrik Hübinette (Hubbe) 
bcb9961999-04-01Fredrik Hübinette (Hubbe) #NTHOST=localhost #NTDRIVE='d:'
1e1fb61998-01-16Fredrik Hübinette (Hubbe)  # What dir on the UNIX machine is on $NTDRIVE ? # This variable MUST NOT end with a slash.
a0ff752000-06-28Henrik Grubbström (Grubba) NTMOUNT=${NTMOUNT-}
1e1fb61998-01-16Fredrik Hübinette (Hubbe) 
a1ad681998-01-16Fredrik Hübinette (Hubbe) # Use Simple Pike Remote SHell? USE_SPRSH=yes # Port for sprsh
a0ff752000-06-28Henrik Grubbström (Grubba) NTPORT=${NTPORT-4711}
a1ad681998-01-16Fredrik Hübinette (Hubbe) 
da5cd91998-11-05Fredrik Hübinette (Hubbe) #These are only used if you use wine watcom=D:\\CDROM INCLUDE="$watcom\\H;$watcom\\H\\NT"
a0ff752000-06-28Henrik Grubbström (Grubba) # Used for IA64 cross-compiling. IA64SDK=${IA64SDK-'C:\ia64sdk17'}
7a22d71999-08-27Fredrik Hübinette (Hubbe) case "/$CC" in */rntcl)
07b0a12000-08-16Peter Bortas  if [ "x$NOPATHS" = "yes" ]; then echo "I am Hubbe" MSVC='j:\winshare\vc98' local='j:\winshare\local' REMOTE_VARIABLES="
7a22d71999-08-27Fredrik Hübinette (Hubbe) path=$MSVC\\bin; include=$MSVC\\Include;$local\\include lib=$MSVC\\Lib;$local\\lib "
07b0a12000-08-16Peter Bortas  export REMOTE_VARIABLES else echo "We are not Hubbe." fi
7a22d71999-08-27Fredrik Hübinette (Hubbe)  ;;
a0ff752000-06-28Henrik Grubbström (Grubba)  */rntcl64) REMOTE_VARIABLES=" path=$IA64SDK\\bin\\Win64;$IA64SDK\\bin; include=$IA64SDK\\Include; lib=$IA64SDK\\Lib; " export REMOTE_VARIABLES ;; */rntecl) REMOTE_VARIABLES=" path=$IA64SDK\\bin\\Intel64;$IA64SDK\\bin; include=$IA64SDK\\Include; lib=$IA64SDK\\Lib; " export REMOTE_VARIABLES ;;
7a22d71999-08-27Fredrik Hübinette (Hubbe)  */rntcc) watcom='j:\winshare\WATCOM' local='j:\winshare\WATCOM\local' REMOTE_VARIABLES=" path=$watcom\\binnt;$watcom\\binw;
905b5c2000-01-09Fredrik Hübinette (Hubbe) include=$watcom\\h;$watcom\\h\\nt;$local\\h
7a22d71999-08-27Fredrik Hübinette (Hubbe) lib=$watcom\\lib386;$local\\lib " export REMOTE_VARIABLES ;; esac
41ee482000-02-28Fredrik Hübinette (Hubbe) # Don't edit anything below this point..
a1ad681998-01-16Fredrik Hübinette (Hubbe) 
bcb9961999-04-01Fredrik Hübinette (Hubbe) case /$0 in */init_nt) # We were executed we can find the path! base=`echo $0 | sed -e 's@/init_nt@@'` base=`(test "x$base" != "x" && cd $base ; /bin/pwd)` ;; *) # We were sourced, we cannot find the path... base=`pwd` ;; esac
a1bb361998-04-16Fredrik Hübinette (Hubbe) 
41ee482000-02-28Fredrik Hübinette (Hubbe) if [ "x$OSTYPE" = xcygwin32 ]; then REMOTE_METHOD=cygwin driveletter=`echo $base | sed -e 's@^//\(.\)/.*@\1@` if [ "x$driveletter" != "x" ]; then NTDRIVE=${driveletter}: NTMOUNT="//$driveletter" fi mkdir $base/cygtools 2>/dev/null || : ( cd $base/tools cp rntcc rntcl ar nm ranlib uname bash-fixup sprsh lib lib.pike $base/cygtools || : ) SHELL=bash NT_TOOL_PATH=$base/cygtools else NT_TOOL_PATH=$base/tools fi
bcb9961999-04-01Fredrik Hübinette (Hubbe)  export NT_TOOL_PATH if [ ! -d "$NT_TOOL_PATH" ]; then echo Unable to find NT tools! return exit fi
a1ad681998-01-16Fredrik Hübinette (Hubbe)  case :$PATH: in
bcb9961999-04-01Fredrik Hübinette (Hubbe)  *:$NT_TOOL_PATH:*) ;; *) PATH=$NT_TOOL_PATH:$PATH ;;
a1ad681998-01-16Fredrik Hübinette (Hubbe) esac
bcb9961999-04-01Fredrik Hübinette (Hubbe)  NTTOOLS=$NT_TOOL_PATH/lib
41ee482000-02-28Fredrik Hübinette (Hubbe) 
34f8f01998-01-16Fredrik Hübinette (Hubbe) if [ "x$NTMOUNT" = x ]; then MNTREPLACE=""
cdfb8d2000-02-05Marcus Comstedt  PIKE_PATH_TRANSLATE=""
34f8f01998-01-16Fredrik Hübinette (Hubbe) else MNTREPLACE="s@$NTMOUNT@@g "
cdfb8d2000-02-05Marcus Comstedt  PIKE_PATH_TRANSLATE="s!^$NTMOUNT!$NTDRIVE!"
34f8f01998-01-16Fredrik Hübinette (Hubbe) fi
686ed61998-09-01Fredrik Hübinette (Hubbe) IFS=' '
6d86081997-12-22Fredrik Hübinette (Hubbe) 
ebf6e32000-02-05Marcus Comstedt export NT_TOOL_PATH NTCOMPILER PIKE_PATH_TRANSLATE
6d86081997-12-22Fredrik Hübinette (Hubbe) 
af7f462000-08-09Fredrik Noring if [ "$#" = "0" ]; then case /$SHELL-$TERM in */bash-xterm) PROMPT_COMMAND="echo -n ]2\; $REMOTE_METHOD NT compile ]1\; $CC" export PROMPT_COMMAND ;; esac case /$0 in */init_nt) case /$SHELL in */bash) exec $SHELL -rcfile $NT_TOOL_PATH/bash-fixup ;; *) exec $SHELL ;; esac ;; esac else
8be7f92000-08-10Fredrik Noring  exec $@
af7f462000-08-09Fredrik Noring fi
47c4c91998-08-05Fredrik Hübinette (Hubbe)