source: Daodan/MinGW/msys/1.0/msys.bat@ 1067

Last change on this file since 1067 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

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