Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /***********************************************************************/
  2. /*                                                                     */
  3. /* Front-end EXEC to set up linkage to the C runtime libraries         */
  4. /* before executing a MODULE generated from C code.                    */
  5. /*                                                                     */
  6. /* Copy this file as an EXEC with a filename matching the C MODULE.    */
  7. /*                                                                     */
  8. /* Greg Hartwig (ghartwig@vnet.ibm.com)   7/31/97, 4/24/98.            */
  9. /*                                                                     */
  10. /***********************************************************************/
  11. Address Command
  12. Parse Arg argstring
  13. Parse Source . . myname .
  14.  
  15. /* Set output and input character translation so brackets show up */
  16. 'SET OUTPUT AD' 'BA'x
  17. 'SET OUTPUT BD' 'BB'x
  18. 'SET INPUT  BA   AD'
  19. 'SET INPUT  BB   BD'
  20.  
  21. Call CLIB
  22. If rc<>0 Then Do
  23.    Say 'The required C runtime libraries don''t appear to be available.'
  24.    Say myname 'can not run.'
  25.    Exit 12
  26. End
  27.  
  28. /* Run the command */
  29. myname argstring
  30. Exit rc
  31.  
  32.  
  33.  
  34.  
  35. /* Contents of the CLIB EXEC, modified for RC checking.        */
  36. /* Removed TXTLIB setting.  Only LOADLIB needed for execution. */
  37. CLIB:
  38. /***************************************************/
  39. /*      SET UP LIBRARIES FOR LE for MVS & VM       */
  40. /***************************************************/
  41. Address COMMAND
  42.  
  43. loadlib  ='EDCLINK'               /* C/370 runtime                 */
  44. loadlib  ='SCEERUN'               /* LE runtime                    */
  45.  
  46.  
  47. theirs=queued()                           /* old stack contentsM068*/
  48.  'QUERY LOADLIB ( LIFO'                   /* old setting       M068*/
  49.  LoadlibList=''                           /* init list         M068*/
  50. rc=0
  51.  Do while queued()^=theirs                /* all lines from cmdM068*/
  52.    Parse upper pull 'LOADLIB' '=' Ltemp   /* get one line      M068*/
  53.    LoadlibList= Ltemp Loadliblist         /* was stacked LIFO  M068*/
  54.  End                                                         /*M068*/
  55.  If loadlibList='NONE' ,
  56.  Then Do
  57.   'GLOBAL LOADLIB' Loadlib          /* enforce what we need         */
  58.  End
  59.  Else Do
  60.   Do xx=1 to Words(loadlib)
  61.   If Find(loadliblist,word(loadlib,xx)) = 0 ,
  62.    then loadliblist = loadliblist word(loadlib,xx)
  63.   End
  64.   'GLOBAL LOADLIB' loadliblist       /* enforce what we need         */
  65.  End
  66. Return
  67.