source: grass/branches/releasebranch_6_4/mswindows/osgeo4w/msys.bat

Last change on this file was 55997, checked in by mmetz, 11 years ago

update msys.bat to 2009 version

  • Property svn:eol-style set to CRLF
  • Property svn:mime-type set to text/x-bat
File size: 7.8 KB
Line 
1@echo off
2rem Copyright (C): 2001, 2002, 2003, 2004, 2005 Earnie Boyd
3rem mailto:earnie@users.sf.net
4rem This file is part of Minimal SYStem
5rem http://www.mingw.org/msys.shtml
6rem
7rem File: msys.bat
8rem Revision: 2.4
9rem Revision Date: December 8th, 2005
10rem --- MODIFIED FOR GRASS Aug 2009: Quote path name variables ---
11
12rem ember to set the "Start in:" field of the shortcut.
13rem A value similar to C:\msys\1.0\bin is what the "Start in:" field needs
14rem to represent.
15
16rem ember value of GOTO: is used to know recursion has happened.
17if "%1" == "GOTO:" goto %2
18
19if NOT "x%WD%" == "x" set WD=
20
21rem ember command.com only uses the first eight characters of the label.
22goto _WindowsNT
23
24rem ember that we only execute here if we are in command.com.
25:_Windows
26
27if "x%COMSPEC%" == "x" set COMSPEC=command.com
28start /min "%COMSPEC%" /e:4096 /c %0 GOTO: _Resume %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
29goto EOF
30
31rem ember that we execute here if we recursed.
32:_Resume
33for %%F in (1 2 3) do shift
34if NOT EXIST "%WD%msys-1.0.dll" set WD=.\bin\
35
36rem ember that we get here even in command.com.
37:_WindowsNT
38
39rem Hopefully a temporary workaround for getting MSYS shell to run on x64
40rem (WoW64 cmd prompt sets PROCESSOR_ARCHITECTURE to x86)
41if not "x%PROCESSOR_ARCHITECTURE%" == "xAMD64" goto _NotX64
42set COMSPEC=%WINDIR%\SysWOW64\cmd.exe
43"%COMSPEC%" /c %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
44goto EOF
45:_NotX64
46
47if NOT EXIST "%WD%msys-1.0.dll" set WD=%~dps0bin\
48rem echo %WD%
49
50rem ember Set up option to use rxvt based on value of %1
51set MSYSCON=unknown
52if "x%1" == "x-norxvt" set MSYSCON=sh.exe
53if "x%1" == "x--norxvt" set MSYSCON=sh.exe
54if "x%1" == "x-rxvt" set MSYSCON=rxvt.exe
55if "x%1" == "x--rxvt" set MSYSCON=rxvt.exe
56if "x%1" == "x-mintty" set MSYSCON=mintty.exe
57if "x%1" == "x--mintty" set MSYSCON=mintty.exe
58if NOT "x%MSYSCON%" == "xunknown" shift
59
60if "x%MSYSCON%" == "xunknown" set MSYSCON=sh.exe
61
62rem the default is a MSYS (user), not a MINGW (developer) console
63if "x%MSYSTEM%" == "x" set MSYSTEM=MSYS
64if "%1" == "MINGW32" set MSYSTEM=MINGW32
65if "%1" == "MSYS" set MSYSTEM=MSYS
66
67if NOT "x%DISPLAY%" == "x" set DISPLAY=
68
69if "x%MSYSCON%" == "xmintty.exe" goto startmintty
70if "x%MSYSCON%" == "xrxvt.exe" goto startrxvt
71if "x%MSYSCON%" == "xsh.exe" goto startsh
72
73:unknowncon
74echo %MSYSCON% is an unknown option for msys.bat.
75pause
76exit 1
77
78:notfound
79echo Cannot find the rxvt.exe or sh.exe binary -- aborting.
80pause
81exit 1
82
83:startmintty
84if NOT EXIST "%WD%mintty.exe" goto startsh
85start "%WD%mintty" /bin/bash -l
86exit
87
88rem If you don't want to use rxvt then rename the file rxvt.exe to something
89rem else. Then sh.exe will be used instead.
90:startrxvt
91if NOT EXIST "%WD%rxvt.exe" goto startsh
92
93rem Setup the default colors for rxvt.
94if "x%MSYSBGCOLOR%" == "x" set MSYSBGCOLOR=White
95if "x%MSYSFGCOLOR%" == "x" set MSYSFGCOLOR=Black
96if "x%MINGW32BGCOLOR%" == "x" set MINGW32BGCOLOR=Black
97if "x%MINGW32FGCOLOR%" == "x" set MINGW32FGCOLOR=White
98if "%MSYSTEM%" == "MSYS" set BGCOLOR=%MSYSBGCOLOR%
99if "%MSYSTEM%" == "MSYS" set FGCOLOR=%MSYSFGCOLOR%
100if "%MSYSTEM%" == "MINGW32" set BGCOLOR=%MINGW32BGCOLOR%
101if "%MSYSTEM%" == "MINGW32" set FGCOLOR=%MINGW32FGCOLOR%
102
103if "x%*" == "x" start "MSYS 1.0" "%WD%rxvt" -backspacekey -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-16 -tn msys -geometry 80x25 -e /bin/sh --login -i
104if NOT "x%*" == "x" start "MSYS 1.0" "%WD%rxvt" -backspacekey -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-16 -tn msys -geometry 80x25 -e /bin/sh --login -c "%*"
105exit
106
107:startsh
108if NOT EXIST "%WD%sh.exe" goto notfound
109if "x%*" == "x" start "MSYS 1.0" "%WD%sh" --login -i
110if NOT "x%*" == "x" start "MSYS 1.0" "%WD%sh" --login -c "%*"
111exit
112
113:EOF
114
115rem ChangeLog:
116rem 2002.03.07 Earnie Boyd mailto:earnie@users.sf.net
117rem * Move the @echo off to the top.
118rem * Change the binmode setting to nobinmode.
119rem * Remove the angle brackets around email address to workaround MS
120rem buggy command processor.
121rem
122rem 2002.03.12 Earnie Boyd mailto:earnie@users.sf.net
123rem * Add filter logic to find rxvt.exe
124rem
125rem 2002.03.13 Earnie Boyd mailto:earnie@users.sf.net
126rem * Revert the nobinmode change.
127rem
128rem 2002.03.20 Earnie Boyd mailto:earnie@users.sf.net
129rem * Add logic for stating bash.
130rem
131rem 2002.04.11 Earnie Boyd mailto;earnie@users.sf.net
132rem * Add logic for setting MSYSTEM value based on parameter.
133rem
134rem 2002.04.15 Olivier Gautherot mailto:olivier_gautherot@mentorg.com
135rem * Reduce number test conditions for finding an executable.
136rem
137rem 2002.04.15 Earnie Boyd mailto:earnie@users.sf.net
138rem * Unset DISPLAY if set before starting shell.
139rem
140rem 2002.04.16 Earnie Boyd mailto:earnie@users.sf.net
141rem * Remove use of DEFINED in conditional statments for variables for
142rem command.com support.
143rem * Add check for nonexistance of USERNAME variable for Win9x support.
144rem
145rem 2002.04.17 Earnie Boyd mailto:earnie@users.sf.net
146rem * Add foreground and background color defaults based on MSYSTEM value.
147rem
148rem 2002.04.22 Earnie Boyd mailto:earnie@users.sf.net
149rem * More Win 9x changes.
150rem
151rem 2002.05.04 Earnie Boyd mailto:earnie@users.sf.net
152rem * Remove the SET of USERNAME and HOME.
153rem
154rem 2002.11.18 Earnie Boyd mailto:earnie@users.sf.net
155rem * Add command.com detection and restart with a larger environment to
156rem avoid errors on w9x.
157rem Many thanks to Randy W. Sims mailto:RandyS@ThePierianSpring.org.
158rem See Randy's response to "RE: [Mingw-msys] Installation on WindowsME"
159rem from 11/06/2002 in the archives of mingw-msys@lists.sf.net.
160rem
161rem 2002.11.19 Paul Garceau mailto:pgarceau@attbi.com
162rem * Fix a typo: Change COMPSPEC to COMSPEC.
163rem
164rem 2002.11.25 Earnie Boyd mailto:earnie@users.sf.net
165rem * Remove the SET CYGWIN since it doesn't matter any longer.
166rem
167rem 2003.02.03 Earnie Boyd mailto:earnie@users.sf.net
168rem * Win9x doesn't like ``EXISTS dir'' so change it to ``EXISTS dir\nul''.
169rem Thanks to Nicolas Weber mailto:nicolasweber@gmx.de.
170rem
171rem 2003.03.06 Earnie Boyd mailto:earnie@users.sf.net
172rem * Add -backspacekey switch to rxvt startup.
173rem * Move RXVT color setup to startrxvt label
174rem
175rem 2004.01.30 Earnie Boyd mailto:earnie@users.sf.net
176rem * Add -geometry parameter to work around an off by one issue with
177rem the default values.
178rem Thanks to Dave Schuyler mailto:parameter@users.sf.net
179rem
180rem 2004.03.28 Earnie Boyd mailto:earnie@users.sf.net
181rem * Add -norxvt or --norxvt switch argument.
182rem Thanks to Keith Marshall mailto:Keith.Marshall@total.com.
183rem * Add method to determine absolute path of msys.bat so that we no
184rem longer need to change to the bin directory. This allows msys.bat to be
185rem called from any working directory.
186rem Thanks to Kevin Mack mailto:kevin.mack@us.cd-adapco.com
187rem
188rem 2005.07.06 Max TE Woodbury mailto:mtew@users.sf.net
189rem * Fixed WD check for command.com systems.
190rem * Minimized intermediate CMD window to reduce startup flashyness.
191rem * If rxvt.exe cannot be found, try sh.exe.
192rem
193rem 2005.12.06 Tuomo Latto mailto:nonperson@users.sf.net
194rem * Added a temporary workaround for getting MSYS shell to run on x64.
195rem
196rem 2005.12.07 Keith Marshall mailto:keithmarshall@users.sf.net
197rem * ``EXISTS %WD%\sh.exe'' should be ``EXISTS %WD%sh.exe''; corrected.
198rem * Modified Tuomo's patch, to avoid trashing Window settings in Win32.
199rem
200rem 2005.12.08 Tuomo Latto mailto:nonperson@users.sf.net
201rem * Keith's modified patch fails on x64; start did funny things.
202rem Reworked, for correct behaviour on both platforms.
203rem
204rem 2009.03.17 Keith Marshall mailto:keithmarshall@users.sf.net
205rem * Add -rxvt or --rxvt switch; start in --norxvt mode by default.
206rem Make it deterministic; (do not inherit MSYSCON from parent).
207rem
Note: See TracBrowser for help on using the repository browser.