/build-extras/MSYS_files/msys.bat

https://code.google.com/p/camelbox/ · Batch · 136 lines · 119 code · 17 blank · 0 comment · 45 complexity · c932c69756730d21e85955fd16535d40 MD5 · raw file

  1. @echo off
  2. rem Copyright (C): 2001, 2002 Earnie Boyd
  3. rem mailto:earnie@users.sf.net
  4. rem This file is part of Minimal SYStem
  5. rem http://www.mingw.org/msys.shtml
  6. rem
  7. rem File: msys.bat
  8. rem Revision: 2.0
  9. rem Revision Date: April 17th, 2002
  10. rem ember to set the "Start in:" field of the shortcut.
  11. rem A value similar to C:\msys\1.0\bin is what the "Start in:" field needs
  12. rem to represent.
  13. rem ember value of GOTO: is used to know recursion has happened.
  14. if "%1" == "GOTO:" goto %2
  15. rem ember command.com only uses the first eight characters of the label.
  16. goto _WindowsNT
  17. rem ember that we only execute here if we are in command.com.
  18. :_Windows
  19. if "x%COMSPEC%" == "x" set COMSPEC=command.com
  20. start %COMSPEC% /e:4096 /c %0 GOTO: _Resume %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
  21. goto EOF
  22. rem ember that we execute here if we recursed.
  23. :_Resume
  24. for %%F in (1 2 3) do shift
  25. rem ember that we get here even in command.com.
  26. :_WindowsNT
  27. if "x%MSYSTEM%" == "x" set MSYSTEM=MINGW32
  28. if "%1" == "MSYS" set MSYSTEM=MSYS
  29. if NOT "x%DISPLAY%" == "x" set DISPLAY=
  30. if EXIST bin\nul cd bin
  31. if EXIST rxvt.exe goto startrxvt
  32. if EXIST sh.exe goto startsh
  33. echo Cannot find the rxvt.exe or sh.exe binary -- aborting.
  34. pause
  35. exit 1
  36. rem If you don't want to use rxvt then rename the file rxvt.exe to something
  37. rem else. Then sh.exe will be used instead.
  38. :startrxvt
  39. rem Setup the default colors for rxvt.
  40. if "x%MSYSBGCOLOR%" == "x" set MSYSBGCOLOR=White
  41. if "x%MSYSFGCOLOR%" == "x" set MSYSFGCOLOR=Black
  42. rem if "x%MINGW32BGCOLOR%" == "x" set MINGW32BGCOLOR=LightYellow
  43. rem if "x%MINGW32FGCOLOR%" == "x" set MINGW32FGCOLOR=Navy
  44. if "x%MINGW32BGCOLOR%" == "x" set MINGW32BGCOLOR=Black
  45. if "x%MINGW32FGCOLOR%" == "x" set MINGW32FGCOLOR=White
  46. if "%MSYSTEM%" == "MSYS" set BGCOLOR=%MSYSBGCOLOR%
  47. if "%MSYSTEM%" == "MSYS" set FGCOLOR=%MSYSFGCOLOR%
  48. if "%MSYSTEM%" == "MINGW32" set BGCOLOR=%MINGW32BGCOLOR%
  49. if "%MSYSTEM%" == "MINGW32" set FGCOLOR=%MINGW32FGCOLOR%
  50. start rxvt -backspacekey  -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-12 -tn msys -geometry 80x25 -e /bin/sh --login -i
  51. exit
  52. :startsh
  53. start sh --login -i
  54. exit
  55. :EOF
  56. rem ChangeLog:
  57. rem 2002.03.07 Earnie Boyd mailto:earnie@users.sf.net
  58. rem * Move the @echo off to the top.
  59. rem * Change the binmode setting to nobinmode.
  60. rem * Remove the angle brackets around email address to workaround MS
  61. rem buggy command processor.
  62. rem
  63. rem 2002.03.12 Earnie Boyd mailto:earnie@users.sf.net
  64. rem * Add filter logic to find rxvt.exe
  65. rem
  66. rem 2002.03.13 Earnie Boyd mailto:earnie@users.sf.net
  67. rem * Revert the nobinmode change.
  68. rem
  69. rem 2002.03.20 Earnie Boyd mailto:earnie@users.sf.net
  70. rem * Add logic for stating bash.
  71. rem
  72. rem 2002.04.11 Earnie Boyd mailto;earnie@users.sf.net
  73. rem * Add logic for setting MSYSTEM value based on parameter.
  74. rem
  75. rem 2002.04.15 Olivier Gautherot mailto:olivier_gautherot@mentorg.com
  76. rem * Reduce number test conditions for finding an executable.
  77. rem
  78. rem 2002.04.15 Earnie Boyd mailto:earnie@users.sf.net
  79. rem * Unset DISPLAY if set before starting shell.
  80. rem
  81. rem 2002.04.16 Earnie Boyd mailto:earnie@users.sf.net
  82. rem * Remove use of DEFINED in conditional statments for variables for
  83. rem command.com support.
  84. rem * Add check for nonexistance of USERNAME variable for Win9x support.
  85. rem
  86. rem 2002.04.17 Earnie Boyd mailto:earnie@users.sf.net
  87. rem * Add foreground and background color defaults based on MSYSTEM value.
  88. rem
  89. rem 2002.04.22 Earnie Boyd mailto:earnie@users.sf.net
  90. rem * More Win 9x changes.
  91. rem
  92. rem 2002.05.04 Earnie Boyd mailto:earnie@users.sf.net
  93. rem * Remove the SET of USERNAME and HOME.
  94. rem
  95. rem 2002.11.18 Earnie Boyd mailto:earnie@users.sf.net
  96. rem * Add command.com detection and restart with a larger environment to
  97. rem avoid errors on w9x.
  98. rem Many thanks to Randy W. Sims mailto:RandyS@ThePierianSpring.org.
  99. rem See Randy's response to "RE: [Mingw-msys] Installation on WindowsME"
  100. rem from 11/06/2002 in the archives of mingw-msys@lists.sf.net.
  101. rem
  102. rem 2002.11.19 Paul Garceau mailto:pgarceau@attbi.com
  103. rem * Fix a typo: Change COMPSPEC to COMSPEC.
  104. rem
  105. rem 2002.11.25 Earnie Boyd mailto:earnie@users.sf.net
  106. rem * Remove the SET CYGWIN since it doesn't matter any longer.
  107. rem
  108. rem 2003.02.03 Earnie Boyd mailto:earnie@users.sf.net
  109. rem * Win9x doesn't like ``EXISTS dir'' so change it to ``EXISTS dir\nul''.
  110. rem Thanks to Nicolas Weber mailto:nicolasweber@gmx.de.
  111. rem
  112. rem 2003.03.06 Earnie Boyd mailto:earnie@users.sf.net
  113. rem * Add -backspacekey switch to rxvt startup.
  114. rem * Move RXVT color setup to startrxvt label
  115. rem
  116. rem 2004.01.30 Earnie Boyd mailto:earnie@users.sf.net
  117. rem * Add -geometry parameter to work around an off by one issue with
  118. rem the default values.
  119. rem Thanks to Dave Schuyler mailto:parameter@users.sf.net