openssl_startup.com 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. $!
  2. $! Startup file for OpenSSL 1.x.
  3. $!
  4. $! 2011-03-05 SMS.
  5. $!
  6. $! This procedure must reside in the OpenSSL installation directory.
  7. $! It will fail if it is copied to a different location.
  8. $!
  9. $! P1 qualifier(s) for DEFINE. For example, "/SYSTEM" to get the
  10. $! logical names defined in the system logical name table.
  11. $!
  12. $! P2 "64", to use executables which were built with 64-bit pointers.
  13. $!
  14. $! Good (default) and bad status values.
  15. $!
  16. $ status = %x00010001 ! RMS$_NORMAL, normal successful completion.
  17. $ rms_e_fnf = %x00018292 ! RMS$_FNF, file not found.
  18. $!
  19. $! Prepare for problems.
  20. $!
  21. $ orig_dev_dir = f$environment( "DEFAULT")
  22. $ on control_y then goto clean_up
  23. $ on error then goto clean_up
  24. $!
  25. $! Determine hardware architecture.
  26. $!
  27. $ if (f$getsyi( "cpu") .lt. 128)
  28. $ then
  29. $ arch_name = "VAX"
  30. $ else
  31. $ arch_name = f$edit( f$getsyi( "arch_name"), "upcase")
  32. $ if (arch_name .eqs. "") then arch_name = "UNK"
  33. $ endif
  34. $!
  35. $ if (p2 .eqs. "64")
  36. $ then
  37. $ arch_name_exe = arch_name+ "_64"
  38. $ else
  39. $ arch_name_exe = arch_name
  40. $ endif
  41. $!
  42. $! Derive the OpenSSL installation device:[directory] from the location
  43. $! of this command procedure.
  44. $!
  45. $ proc = f$environment( "procedure")
  46. $ proc_dev_dir = f$parse( "A.;", proc, , , "no_conceal") - "A.;"
  47. $ proc_dev = f$parse( proc_dev_dir, , , "device", "syntax_only")
  48. $ proc_dir = f$parse( proc_dev_dir, , , "directory", "syntax_only") - -
  49. ".][000000"- "[000000."- "]["- "["- "]"
  50. $ proc_dev_dir = proc_dev+ "["+ proc_dir+ "]"
  51. $ set default 'proc_dev_dir'
  52. $ set default [-]
  53. $ ossl_dev_dir = f$environment( "default")
  54. $!
  55. $! Check existence of expected directories (to see if this procedure has
  56. $! been moved away from its proper place).
  57. $!
  58. $ if ((f$search( "certs.dir;1") .eqs. "") .or. -
  59. (f$search( "include.dir;1") .eqs. "") .or. -
  60. (f$search( "private.dir;1") .eqs. "") .or. -
  61. (f$search( "vms.dir;1") .eqs. ""))
  62. $ then
  63. $ write sys$output -
  64. " Can't find expected common OpenSSL directories in:"
  65. $ write sys$output " ''ossl_dev_dir'"
  66. $ status = rms_e_fnf
  67. $ goto clean_up
  68. $ endif
  69. $!
  70. $ if ((f$search( "''arch_name_exe'_exe.dir;1") .eqs. "") .or. -
  71. (f$search( "''arch_name'_lib.dir;1") .eqs. ""))
  72. $ then
  73. $ write sys$output -
  74. " Can't find expected architecture-specific OpenSSL directories in:"
  75. $ write sys$output " ''ossl_dev_dir'"
  76. $ status = rms_e_fnf
  77. $ goto clean_up
  78. $ endif
  79. $!
  80. $! All seems well (enough). Define the OpenSSL logical names.
  81. $!
  82. $ ossl_root = ossl_dev_dir- "]"+ ".]"
  83. $ define /translation_attributes = concealed /nolog'p1 SSLROOT 'ossl_root'
  84. $ define /nolog 'p1' SSLCERTS sslroot:[certs]
  85. $ define /nolog 'p1' SSLINCLUDE sslroot:[include]
  86. $ define /nolog 'p1' SSLPRIVATE sslroot:[private]
  87. $ define /nolog 'p1' SSLEXE sslroot:['arch_name_exe'_exe]
  88. $ define /nolog 'p1' SSLLIB sslroot:['arch_name'_lib]
  89. $!
  90. $! Defining OPENSSL lets a C program use "#include <openssl/{foo}.h>":
  91. $ define /nolog 'p1' OPENSSL SSLINCLUDE:
  92. $!
  93. $! Run a site-specific procedure, if it exists.
  94. $!
  95. $ if f$search( "sslroot:[vms]openssl_systartup.com") .nes."" then -
  96. @ sslroot:[vms]openssl_systartup.com
  97. $!
  98. $! Restore the original default dev:[dir] (if known).
  99. $!
  100. $ clean_up:
  101. $!
  102. $ if (f$type( orig_dev_dir) .nes. "")
  103. $ then
  104. $ set default 'orig_dev_dir'
  105. $ endif
  106. $!
  107. $ EXIT 'status'
  108. $!