home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / GNUFIX.ZIP / GNU.CMD < prev    next >
OS/2 REXX Batch file  |  1992-08-03  |  4KB  |  115 lines

  1. @ECHO OFF
  2. CLS
  3. REM **************************************************************************
  4. REM GNU.CMD
  5. REM
  6. REM Alters IBM's TOOLKT20\C\OS2H\ directory contents so that they may be used
  7. REM both with GNU C/C++ and IBM C Set/2.
  8. REM
  9. REM Please note that those header files are Copyright IBM Corp.
  10. REM 
  11. REM **************************************************************************
  12. REM Instructions
  13. REM
  14. REM Look at this command file before you execute it, just in case there are
  15. REM incompatibilities between this and your setup. Specifically make sure
  16. REM that the directories used in this command file are indeed the directories
  17. REM on your system.
  18. REM
  19. REM Since this is a "hack" job not a commercial program no fancy stuff is
  20. REM done to ensure that the results are even usable.
  21. REM That is YOUR responsibility.
  22. REM
  23. REM THIS COMMAND FILE IS FREE SOFTWARE AND AS SUCH COMES WITH NO WARRANTY
  24. REM NOT EVEN FOR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  25. REM
  26. REM **************************************************************************
  27.  
  28. SETLOCAL
  29.  
  30. REM Just in case you are not in the mood to look at this file.
  31. REM
  32.  
  33. ECHO You MUST modify this file before running it!
  34. GOTO :end
  35.  
  36. REM Set the following variables to:
  37. REM
  38. REM 1) the installation directory (from which you are doing the fix)
  39. REM 2) the directory in which the OS2H subdirectory is found.
  40. REM
  41. REM Note that the install directory and the TOOLKIT directory should
  42. REM be on the same drive.
  43. REM
  44.  
  45. SET INSTDIR=\TEMP
  46. SET TKDIR=\TK20
  47.  
  48. REM Preserving the original TOOLKT20\C\OS2H\ directory and some files.
  49. REM
  50.  
  51. ECHO *************************************************************************
  52. ECHO Making backup of original %TKDIR%\OS2H directory.
  53. ECHO *************************************************************************
  54. MKDIR %TKDIR%\OLDOS2H
  55. IF NOT EXIST %TKDIR%\OLDOS2H GOTO :error
  56. XCOPY %TKDIR%\OS2H\*.* %TKDIR%\OLDOS2H\ /S /E
  57.  
  58. REM Applying patches to some files.
  59. REM
  60. ECHO.
  61. ECHO *************************************************************************
  62. ECHO Applying patches...
  63. ECHO *************************************************************************
  64. CD %INSTDIR%
  65. UXPATCH %TKDIR%\OS2H\BDCALLS.H BDCALLS.DIF
  66. UXPATCH %TKDIR%\OS2H\BSESUB.H BSESUB.DIF
  67. UXPATCH %TKDIR%\OS2H\OS2DEF.H OS2DEF.DIF
  68. UXPATCH %TKDIR%\OS2H\PMAVIO.H PMAVIO.DIF
  69.  
  70. REM Setting up for alteration
  71. REM
  72. MKDIR %TKDIR%\OS2H-NC
  73.  
  74. REM Altering by first removing comments.
  75. REM
  76. ECHO.
  77. ECHO *************************************************************************
  78. ECHO Removing comments...
  79. ECHO *************************************************************************
  80. CD %TKDIR%\OS2H
  81. FOR %%F IN (*.H) DO %INSTDIR%\UNCOMM -i %%F -o %TKDIR%\OS2H-NC\%%F
  82.  
  83. REM Now applying the final change.
  84. REM
  85. ECHO.
  86. ECHO *************************************************************************
  87. ECHO Applying changes...
  88. ECHO *************************************************************************
  89. CD %TKDIR%\OS2H-NC
  90. FOR %%F IN (*.H) DO %INSTDIR%\GNUFIX -i %%F -o %TKDIR%\OS2H\%%F
  91.  
  92. REM Remove no longer needed files/directories.
  93. REM
  94. CD %INSTDIR%
  95. ERASE %TKDIR%\OS2H-NC /N
  96. RMDIR %TKDIR%\OS2H-NC
  97.  
  98. ECHO.
  99. ECHO.
  100. ECHO *************************************************************************
  101. ECHO The original %TKDIR%\OS2H\*.h headers are in %TKDIR%\OLDOS2H
  102. ECHO Some files have been altered. The originals have ".OLD" extension.
  103. ECHO On HPFS File Systems the originals are also in ".orig" files.
  104. ECHO *************************************************************************
  105. ECHO Modifications are complete.
  106. GOTO :end
  107.  
  108. REM No error checking is done in the .CMD file!
  109. REM
  110. :error
  111. ECHO An error occured during program run.
  112.  
  113. :end
  114. ENDLOCAL
  115.