home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / bin / somstars.bat < prev    next >
Encoding:
DOS Batch File  |  1996-02-16  |  4.0 KB  |  112 lines

  1. @echo off
  2. rem COMPONENT_NAME: somx
  3. rem
  4. rem ORIGINS: 27
  5. rem
  6. rem
  7. rem 10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
  8. rem All Rights Reserved
  9. rem Licensed Materials - Property of IBM
  10. rem US Government Users Restricted Rights - Use, duplication or
  11. rem disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. @REM %Z% %I% %W% %G% %U% [%H% %T%] 
  13.  
  14. rem Batch file to convert to explicit stars for interface references.
  15. rem If you intend to program with SOM using the C bindings, you
  16. rem need to select one of the two possible forms of C bindings:
  17. rem the strict CORBA-compliant form in which '*'s are NOT exposed
  18. rem in object references, or the C++ form in which '*'s are visible 
  19. rem in object references.  This second form is more appropriate if 
  20. rem you plan to move your class implementations from C to C++ at 
  21. rem some future point.  This choice will determine how object 
  22. rem references will appear in all of your C programs.  For example, 
  23. rem to declare a reference to an instance of class Foo, you would code 
  24. rem either
  25. rem 
  26. rem    Foo afoo;    /* Strict CORBA compliant form */
  27. rem
  28. rem or
  29. rem 
  30. rem    Foo *afoo;   /* C++ migration or OIDL-compatible form */
  31. rem 
  32. rem Depending on your choice of coding style, you must run either
  33. rem the 'somcorba' command (for the CORBA compliant form) or the
  34. rem 'somstars' command (for the C++ form).  These commands will 
  35. rem generate an appropriate set of C header files for the classes 
  36. rem in the SOMobjects toolkit.  If you decide to use 'somstars', 
  37. rem you should also set the SMADDSTAR variable in your local 
  38. rem environment.  All subsequent use of the SOM Compiler depends 
  39. rem on this environment variable to indicate the use of the 
  40. rem 'somstars' style.  For example,
  41. rem 
  42. rem     set SMADDSTAR=1
  43. rem 
  44. rem If you later decide to switch from one coding style to the
  45. rem other, any C code that you have already written will then
  46. rem need to be converted (by you) to the other form.  Also, if
  47. rem switching from the 'somstars' style to the 'somcorba' style,
  48. rem the SMADDSTAR variable must be removed from your environment.
  49. rem Note that all of the sample C programs provided with the
  50. rem toolkit assume the use of the CORBA-compliant coding style
  51. rem (somcorba).
  52.  
  53. rem SETLOCAL
  54. IF "%SOMBASE%"=="" GOTO sombase
  55. IF "%SC%"=="" GOTO somsc
  56.  
  57. rem IF "%SOMDRIVE%"=="" GOTO body
  58. rem %SOMDRIVE%
  59.  
  60. :body
  61. REM IF SMBINDINGS is already set, use it as the destination directory.
  62. if  "%SMBINDINGS%"=="" goto else1
  63.     set SOMDEST=%SMBINDINGS%
  64.     goto endif1
  65. :else1
  66. set SOMDEST=%SOMBASE%\include
  67. :endif1
  68.  
  69. REM On Windows 95, we can't use exist to test a directory
  70. REM That's why we need this work-around.
  71. echo Looking for destination directory %SOMDEST%
  72. md %SOMDEST%
  73. echo test > %SOMDEST%\somtmp.tmp
  74. if not exist %SOMDEST%\somtmp.tmp goto nodest
  75. del %SOMDEST%\somtmp.tmp
  76.  
  77. IF NOT EXIST %SOMBASE%\include\som.hc GOTO drive
  78.  
  79. echo Generating the SOM C Bindings:
  80. echo (Warning, these bindings are not CORBA-compliant)
  81. rem CD %SOMBASE%\include
  82. IF EXIST %SOMDEST%\somcorba.bld DEL %SOMDEST%\somcorba.bld
  83. if EXIST %SOMDEST%\som.h ATTRIB -R %SOMDEST%\som.h
  84. if EXIST %SOMDEST%\gen_c.efw ATTRIB -R %SOMDEST%\gen_c.efw
  85. COPY %SOMBASE%\include\som.hs       %SOMDEST%\som.h > NUL
  86. COPY %SOMBASE%\include\gen_c.efs    %SOMDEST%\gen_c.efw  > NUL
  87. SET SMNOADDSTAR=
  88. %SC% -%% -maddstar -sh -D_WIN32 -d %SOMDEST% %SOMBASE%\include\*.idl
  89. IF NOT ERRORLEVEL 0 GOTO end
  90. IF EXIST %SOMBASE%\include\somdtype.idl %SC% -maddstar -sh -D_WIN32 -DEMIT_SOMDTYPES -d %SOMDEST% %SOMBASE%\include\somdtype.idl
  91. echo somstars.bld > %SOMDEST%\somstars.bld
  92. GOTO end
  93.  
  94. :sombase
  95.     ECHO SOMBASE should be set before running somstars.
  96.     GOTO end
  97.  
  98. :somsc
  99.     ECHO SC should be set before running somstars.
  100.     GOTO end
  101.  
  102. :drive
  103. rem     ECHO SOM is not installed on the current drive, please set SOMDRIVE.
  104.     echo Can't find *.idl files. Please check SOMBASE.
  105.     GOTO end
  106.  
  107. :nodest
  108.    echo Can't create/find destination directory %SOMDEST%
  109.  
  110. :end
  111.     rem ENDLOCAL
  112.