home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / icpl100.zip / configure.cmd < prev    next >
OS/2 REXX Batch file  |  2001-05-24  |  1KB  |  58 lines

  1. /* Icon Plus OS/2 REXX Configuration Script */
  2.  
  3.   if RxFuncQuery('SysLoadFuncs') then do
  4.      call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  5.      call SysLoadFuncs
  6.   end
  7.  
  8.   comps.1.suffix = "icc"
  9.   comps.1.exe    = "icc.exe"
  10.   comps.1.descrp = "IBM VisualAge C++"
  11.   comps.0        = 1
  12.   comps.selected = 0
  13.  
  14.   files.1 = "Source\makefile"
  15.   files.0 = 1
  16.  
  17.   parse arg options
  18.  
  19.   if options == "--help" then do
  20.      say "Usage:   configure [options]"
  21.      say "Options: --help print this help."
  22.      do i = 1 to comps.0
  23.         say copies(" ",8)" --"substr(comps.i.suffix,1,4) ||,
  24.                            " configure to "comps.i.descrp
  25.      end
  26.      exit 1
  27.   end
  28.  
  29.   do i = 1 to comps.0
  30.      if options == "--"comps.i.suffix then do
  31.         comps.selected = i
  32.         call configure
  33.      end   
  34.   end
  35.  
  36.   say "The compiler is not specified (try 'configure --help' for more options)."
  37.   say "Attempts to find any..."
  38.  
  39.   do i = 1 to comps.0
  40.      if SysSearchPath( "PATH", comps.i.exe ) \= "" then do
  41.         comps.selected = i
  42.         say "Found "comps.i.descrp
  43.         call configure
  44.      end
  45.   end
  46.  
  47.   say "Nothing it is found. Configuration aborted"
  48.   exit 1
  49.  
  50. configure: procedure expose comps. files.
  51.  
  52.   sel = comps.selected
  53.   say "Configuring..."
  54.   do i = 1 to files.0 
  55.      "@copy "files.i"_"comps.sel.suffix" "files.i
  56.   end
  57.   say "Done."
  58.   exit 0