home *** CD-ROM | disk | FTP | other *** search
/ hobbes.nmsu.edu / 2008-06-02_hobbes.nmsu.edu.zip / new / pm123-1_32-src.zip / configure.cmd next >
OS/2 REXX Batch file  |  2006-07-02  |  2KB  |  87 lines

  1. /* PM123 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.info   = "IBM VisualAge C++ 3.6"
  9.   comps.1.cc     = "icc.exe"
  10.   comps.1.opts   = "icc_36"
  11.   comps.1.sig    = "Version 3.6"
  12.  
  13.   comps.2.info   = "IBM VisualAge C++ 3.0"
  14.   comps.2.cc     = "icc.exe"
  15.   comps.2.opts   = "icc_30"
  16.   comps.2.sig    = "Version 3"
  17.  
  18.   comps.3.info   = "Open Watcom C++"
  19.   comps.3.cc     = "wcl386.exe"
  20.   comps.3.opts   = "wcc"
  21.   comps.3.sig    = "Open Watcom"
  22.  
  23.   comps.4.info   = "GNU C++"
  24.   comps.4.cc     = "g++.exe"
  25.   comps.4.opts   = "gcc"
  26.   comps.4.sig    = ""
  27.  
  28.   comps.0        = 4
  29.   comps.selected = 0
  30.  
  31.   parse arg options
  32.  
  33.   if options == "--help" then do
  34.      say "Usage: configure [options]"
  35.      say "Stand-alone options:"
  36.  
  37.      say substr( " --help", 1, 10 ) "print this help."
  38.  
  39.      say "Configurations options:"
  40.  
  41.      do i = 1 to comps.0
  42.         say substr( " --"comps.i.opts, 1, 10 ) "configure to "comps.i.info
  43.      end
  44.      exit 1
  45.   end
  46.  
  47.   do i = 1 to comps.0
  48.      if options == "--"comps.i.opts then do
  49.         comps.selected = i
  50.         call configure
  51.      end   
  52.   end
  53.  
  54.   say "The compiler is not specified (try 'configure --help' for more options)."
  55.   say "Attempts to find any..."
  56.  
  57.   do i = 1 to comps.0
  58.      if SysSearchPath( "PATH", comps.i.cc ) \= "" then do
  59.  
  60.         if comps.i.sig \= "" then
  61.           '@'comps.i.cc '2>&1 1| find "'comps.i.sig'" > nul'
  62.         else
  63.            rc = 0
  64.  
  65.         if rc == 0 then do
  66.            comps.selected = i
  67.            say "Found "comps.i.info
  68.            call configure
  69.         end
  70.      end
  71.   end
  72.  
  73.   say "Nothing it is found. Configuration aborted"
  74.   exit 1
  75.  
  76. configure: procedure expose comps. files.
  77.  
  78.   sel = comps.selected
  79.   say "Configuring..."
  80.  
  81.   if comps.sel.opts \= "" then do
  82.      '@copy src\config\makerules_'comps.sel.opts' src\config\makerules'
  83.   end
  84.  
  85.   say "Done."
  86.   exit 0
  87.