descrip.mms.tmpl 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257
  1. ## descrip.mms to build OpenSSL on OpenVMS
  2. ##
  3. ## {- join("\n## ", @autowarntext) -}
  4. {-
  5. use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
  6. use File::Basename;
  7. (our $osslprefix_q = platform->osslprefix()) =~ s/\$/\\\$/;
  8. our $sover_dirname = platform->shlib_version_as_filename();
  9. our $osslver = sprintf "%02d%02d", split(/\./, $config{version});
  10. our $sourcedir = $config{sourcedir};
  11. our $builddir = $config{builddir};
  12. sub sourcefile {
  13. catfile($sourcedir, @_);
  14. }
  15. sub buildfile {
  16. catfile($builddir, @_);
  17. }
  18. sub sourcedir {
  19. catdir($sourcedir, @_);
  20. }
  21. sub builddir {
  22. catdir($builddir, @_);
  23. }
  24. sub tree {
  25. (my $x = shift) =~ s|\]$|...]|;
  26. $x
  27. }
  28. }
  29. # Because we need to make two computations of these data,
  30. # we store them in arrays for reuse
  31. our @libs =
  32. map { platform->staticname($_) }
  33. @{$unified_info{libraries}};
  34. our @shlibs =
  35. map { platform->sharedname($_) // () }
  36. @{$unified_info{libraries}};
  37. our @install_libs =
  38. map { platform->staticname($_) }
  39. grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
  40. @{$unified_info{libraries}};
  41. our @install_shlibs =
  42. map { platform->sharedname($_) // () }
  43. grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
  44. @{$unified_info{libraries}};
  45. our @install_engines =
  46. grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
  47. && $unified_info{attributes}->{modules}->{$_}->{engine} }
  48. @{$unified_info{modules}};
  49. our @install_modules =
  50. grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
  51. && !$unified_info{attributes}->{modules}->{$_}->{engine} }
  52. @{$unified_info{modules}};
  53. our @install_programs =
  54. grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
  55. @{$unified_info{programs}};
  56. our @install_bin_scripts =
  57. grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
  58. && !$unified_info{attributes}->{scripts}->{$_}->{misc} }
  59. @{$unified_info{scripts}};
  60. our @install_misc_scripts =
  61. grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
  62. && $unified_info{attributes}->{scripts}->{$_}->{misc} }
  63. @{$unified_info{scripts}};
  64. # This is a horrible hack, but is needed because recursive inclusion of files
  65. # in different directories does not work well with HP C.
  66. my $sd = sourcedir("crypto", "async", "arch");
  67. foreach (grep /\[\.crypto\.async\.arch\].*\.o$/, keys %{$unified_info{sources}}) {
  68. my $obj = platform->obj($_);
  69. $unified_info{before}->{$obj}
  70. = qq(arch_include = F\$PARSE("$sd","A.;",,,"SYNTAX_ONLY") - "A.;"
  71. define arch 'arch_include');
  72. $unified_info{after}->{$obj}
  73. = qq(deassign arch);
  74. }
  75. my $sd1 = sourcedir("ssl","record");
  76. my $sd2 = sourcedir("ssl","statem");
  77. my @ssl_locl_users = grep(/^\[\.(?:ssl\.(?:record|statem)|test)\].*\.o$/,
  78. keys %{$unified_info{sources}});
  79. foreach (@ssl_locl_users) {
  80. my $obj = platform->obj($_);
  81. $unified_info{before}->{$obj}
  82. = qq(record_include = F\$PARSE("$sd1","A.;",,,"SYNTAX_ONLY") - "A.;"
  83. define record 'record_include'
  84. statem_include = F\$PARSE("$sd2","A.;",,,"SYNTAX_ONLY") - "A.;"
  85. define statem 'statem_include');
  86. $unified_info{after}->{$obj}
  87. = qq(deassign statem
  88. deassign record);
  89. }
  90. # This makes sure things get built in the order they need
  91. # to. You're welcome.
  92. sub dependmagic {
  93. my $target = shift;
  94. return "$target : build_generated\n\t\pipe \$(MMS) \$(MMSQUALIFIERS) depend && \$(MMS) \$(MMSQUALIFIERS) _$target\n_$target";
  95. }
  96. "";
  97. -}
  98. PLATFORM={- $config{target} -}
  99. OPTIONS={- $config{options} -}
  100. CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
  101. SRCDIR={- $config{sourcedir} -}
  102. BLDDIR={- $config{builddir} -}
  103. FIPSKEY={- $config{FIPSKEY} -}
  104. # Allow both V and VERBOSE to indicate verbosity. This only applies
  105. # to testing.
  106. VERBOSE=$(V)
  107. VERBOSE_FAILURE=$(VF)
  108. VERSION={- "$config{full_version}" -}
  109. MAJOR={- $config{major} -}
  110. MINOR={- $config{minor} -}
  111. SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
  112. SHLIB_TARGET={- $target{shared_target} -}
  113. LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @libs) -}
  114. SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
  115. FIPSMODULENAME={- # We do some extra checking here, as there should be only one
  116. my @fipsmodules =
  117. grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
  118. && $unified_info{attributes}->{modules}->{$_}->{fips} }
  119. @{$unified_info{modules}};
  120. die "More that one FIPS module" if scalar @fipsmodules > 1;
  121. join(", ", map { basename platform->dso($_) } @fipsmodules) -}
  122. MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{modules}}) -}
  123. PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
  124. SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
  125. {- output_off() if $disabled{makedepend}; "" -}
  126. DEPS={- our @deps = map { platform->isobj($_) ? platform->dep($_) : $_ }
  127. grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
  128. keys %{$unified_info{sources}};
  129. join(", ", map { "-\n\t".$_ } @deps); -}
  130. {- output_on() if $disabled{makedepend}; "" -}
  131. GENERATED_MANDATORY={- join(", ", map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
  132. GENERATED={- # common0.tmpl provides @generated
  133. join(", ", map { platform->convertext($_) } @generated) -}
  134. INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
  135. INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
  136. INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -}
  137. INSTALL_MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @install_modules) -}
  138. INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @install_programs) -}
  139. BIN_SCRIPTS={- join(", ", @install_bin_scripts) -}
  140. MISC_SCRIPTS={- join(", ", @install_misc_scripts) -}
  141. HTMLDOCS1={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man1}}) -}
  142. HTMLDOCS3={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man3}}) -}
  143. HTMLDOCS5={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man5}}) -}
  144. HTMLDOCS7={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man7}}) -}
  145. APPS_OPENSSL="{- use File::Spec::Functions;
  146. catfile("apps","openssl") -}"
  147. # DESTDIR is for package builders so that they can configure for, say,
  148. # SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
  149. # In that case, configure with --prefix=SYS$COMMON:[OPENSSL] and then run
  150. # MMS with /MACROS=(DESTDIR=STAGING:[USER]). The result will end up in
  151. # STAGING:[USER.OPENSSL].
  152. # Normally it is left empty.
  153. DESTDIR=
  154. # Do not edit this manually. Use Configure --prefix=DIR to change this!
  155. INSTALLTOP={- our $installtop =
  156. catdir($config{prefix}) || "SYS\$COMMON:[OPENSSL]";
  157. $installtop -}
  158. SYSTARTUP={- catdir($installtop, '[.SYS$STARTUP]'); -}
  159. # This is the standard central area to store certificates, private keys...
  160. OPENSSLDIR={- catdir($config{openssldir}) or
  161. $config{prefix} ? catdir($config{prefix},"COMMON")
  162. : "SYS\$COMMON:[OPENSSL-COMMON]" -}
  163. # The same, but for C
  164. OPENSSLDIR_C={- platform->osslprefix() -}DATAROOT:[000000]
  165. # Where installed ENGINE modules reside, for C
  166. ENGINESDIR_C={- platform->osslprefix() -}ENGINES{- $sover_dirname.$target{pointer_size} -}:
  167. # Where modules reside, for C
  168. MODULESDIR_C={- platform->osslprefix() -}MODULES{- $sover_dirname.$target{pointer_size} -}:
  169. ##### User defined commands and flags ################################
  170. CC={- $config{CC} -}
  171. CPP={- $config{CPP} -}
  172. DEFINES={- our $defines1 = join('', map { ",$_" } @{$config{CPPDEFINES}}) -}
  173. INCLUDES={- our $includes1 = join(',', @{$config{CPPINCLUDES}}) -}
  174. CPPFLAGS={- our $cppflags1 = join('', @{$config{CPPFLAGS}}) -}
  175. CFLAGS={- join('', @{$config{CFLAGS}}) -}
  176. LDFLAGS={- join('', @{$config{LFLAGS}}) -}
  177. EX_LIBS={- join('', map { ",$_" } @{$config{LDLIBS}}) -}
  178. PERL={- $config{PERL} -}
  179. AS={- $config{AS} -}
  180. ASFLAGS={- join(' ', @{$config{ASFLAGS}}) -}
  181. ##### Special command flags ##########################################
  182. ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
  183. ##### Project flags ##################################################
  184. # Variables starting with CNF_ are common variables for all product types
  185. CNF_ASFLAGS={- join('', $target{asflags} || (),
  186. @{$config{asflags}}) -}
  187. CNF_DEFINES={- our $defines2 = join('', (map { ",$_" } @{$target{defines}},
  188. @{$config{defines}}),
  189. "'extradefines'") -}
  190. CNF_INCLUDES={- our $includes2 = join(',', @{$target{includes}},
  191. @{$config{includes}}) -}
  192. CNF_CPPFLAGS={- our $cppflags2 = join('', $target{cppflags} || (),
  193. @{$config{cppflags}}) -}
  194. CNF_CFLAGS={- join('', $target{cflags} || (),
  195. @{$config{cflags}}) -}
  196. CNF_CXXFLAGS={- join('', $target{cxxflags} || (),
  197. @{$config{cxxflags}}) -}
  198. CNF_LDFLAGS={- join('', $target{lflags} || (),
  199. @{$config{lflags}}) -}
  200. CNF_EX_LIBS={- join('', map{ ",$_" } @{$target{ex_libs}},
  201. @{$config{ex_libs}}) -}
  202. # Variables starting with LIB_ are used to build library object files
  203. # and shared libraries.
  204. # Variables starting with DSO_ are used to build DSOs and their object files.
  205. # Variables starting with BIN_ are used to build programs and their object
  206. # files.
  207. LIB_ASFLAGS={- join(' ', $target{lib_asflags} || (),
  208. @{$config{lib_asflags}},
  209. '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
  210. LIB_DEFINES={- our $lib_defines =
  211. join('', (map { ",$_" } @{$target{lib_defines}},
  212. @{$target{shared_defines}},
  213. @{$config{lib_defines}},
  214. @{$config{shared_defines}}));
  215. join('', $lib_defines,
  216. (map { ",$_" } 'OPENSSLDIR="""$(OPENSSLDIR_C)"""',
  217. 'ENGINESDIR="""$(ENGINESDIR_C)"""',
  218. 'MODULESDIR="""$(MODULESDIR_C)"""'),
  219. '$(CNF_DEFINES)', '$(DEFINES)') -}
  220. LIB_INCLUDES={- our $lib_includes =
  221. join(',', @{$target{lib_includes}},
  222. @{$target{shared_includes}},
  223. @{$config{lib_includes}},
  224. @{$config{shared_includes}}) -}
  225. LIB_CPPFLAGS={- our $lib_cppflags =
  226. join('', $target{lib_cppflags} || (),
  227. $target{shared_cppflags} || (),
  228. @{$config{lib_cppflags}},
  229. @{$config{shared_cppflag}});
  230. join('', "'qual_includes'",
  231. '/DEFINE=(__dummy$(LIB_DEFINES))',
  232. $lib_cppflags,
  233. '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
  234. LIB_CFLAGS={- join('', $target{lib_cflags} || (),
  235. $target{shared_cflag} || (),
  236. @{$config{lib_cflags}},
  237. @{$config{shared_cflag}},
  238. '$(CNF_CFLAGS)', '$(CFLAGS)') -}
  239. LIB_LDFLAGS={- join('', $target{lib_lflags} || (),
  240. $target{shared_ldflag} || (),
  241. @{$config{lib_lflags}},
  242. @{$config{shared_ldflag}},
  243. '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
  244. LIB_EX_LIBS=$(CNF_EX_LIBS)$(EX_LIBS)
  245. DSO_ASFLAGS={- join(' ', $target{dso_asflags} || (),
  246. $target{module_asflags} || (),
  247. @{$config{dso_asflags}},
  248. @{$config{module_asflags}},
  249. '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
  250. DSO_DEFINES={- join('', (map { ",$_" } @{$target{dso_defines}},
  251. @{$target{module_defines}},
  252. @{$config{dso_defines}},
  253. @{$config{module_defines}}),
  254. '$(CNF_DEFINES)', '$(DEFINES)') -}
  255. DSO_INCLUDES={- join(',', @{$target{dso_includes}},
  256. @{$target{module_includes}},
  257. @{$config{dso_includes}},
  258. @{$config{module_includes}}) -}
  259. DSO_CPPFLAGS={- join('', "'qual_includes'",
  260. '/DEFINE=(__dummy$(DSO_DEFINES))',
  261. $target{dso_cppflags} || (),
  262. $target{module_cppflags} || (),
  263. @{$config{dso_cppflags}},
  264. @{$config{module_cppflags}},
  265. '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
  266. DSO_CFLAGS={- join('', $target{dso_cflags} || (),
  267. $target{module_cflags} || (),
  268. @{$config{dso_cflags}},
  269. @{$config{module_cflags}},
  270. '$(CNF_CFLAGS)', '$(CFLAGS)') -}
  271. DSO_LDFLAGS={- join('', $target{dso_lflags} || (),
  272. $target{module_ldflags} || (),
  273. @{$config{dso_lflags}},
  274. @{$config{module_ldflags}},
  275. '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
  276. DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
  277. BIN_ASFLAGS={- join(' ', $target{bin_asflags} || (),
  278. @{$config{bin_asflags}},
  279. '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
  280. BIN_DEFINES={- join('', (map { ",$_" } @{$target{bin_defines}},
  281. @{$config{bin_defines}}),
  282. '$(CNF_DEFINES)', '$(DEFINES)') -}
  283. BIN_INCLUDES={- join(',', @{$target{bin_includes}},
  284. @{$config{bin_includes}}) -}
  285. BIN_CPPFLAGS={- join('', "'qual_includes'",
  286. '/DEFINE=(__dummy$(DSO_DEFINES))',
  287. $target{bin_cppflags} || (),
  288. @{$config{bin_cppflag}},
  289. '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
  290. BIN_CFLAGS={- join('', $target{bin_cflags} || (),
  291. @{$config{bin_cflags}},
  292. '$(CNF_CFLAGS)', '$(CFLAGS)') -}
  293. BIN_LDFLAGS={- join('', $target{bin_lflags} || (),
  294. @{$config{bin_lflags}} || (),
  295. '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
  296. BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
  297. NO_INST_LIB_CFLAGS={- join('', $target{no_inst_lib_cflags}
  298. // $target{lib_cflags}
  299. // (),
  300. $target{shared_cflag} || (),
  301. @{$config{lib_cflags}},
  302. @{$config{shared_cflag}},
  303. '$(CNF_CFLAGS)', '$(CFLAGS)') -}
  304. NO_INST_DSO_CFLAGS={- join('', $target{no_inst_dso_cflags}
  305. // $target{dso_cflags}
  306. // (),
  307. $target{no_inst_module_cflags}
  308. // $target{module_cflags}
  309. // (),
  310. @{$config{dso_cflags}},
  311. @{$config{module_cflags}},
  312. '$(CNF_CFLAGS)', '$(CFLAGS)') -}
  313. NO_INST_BIN_CFLAGS={- join('', $target{no_inst_bin_cflags}
  314. // $target{bin_cflags}
  315. // (),
  316. @{$config{bin_cflags}},
  317. '$(CNF_CFLAGS)', '$(CFLAGS)') -}
  318. PERLASM_SCHEME={- $target{perlasm_scheme} -}
  319. # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
  320. CPPFLAGS_Q={- (my $c = $lib_cppflags.$cppflags2.$cppflags1) =~ s|"|""|g;
  321. (my $d = $lib_defines.$defines2.$defines1) =~ s|"|""|g;
  322. my $i = join(',', $lib_includes || (), $includes2 || (),
  323. $includes1 || ());
  324. my $x = $c;
  325. $x .= "/INCLUDE=($i)" if $i;
  326. $x .= "/DEFINE=($d)" if $d;
  327. $x; -}
  328. # .FIRST and .LAST are special targets with MMS and MMK.
  329. # The defines in there are for C. includes that look like
  330. # this:
  331. #
  332. # #include <openssl/foo.h>
  333. # #include "internal/bar.h"
  334. #
  335. # will use the logical names to find the files. Expecting
  336. # DECompHP C to find files in subdirectories of whatever was
  337. # given with /INCLUDE is a fantasy, unfortunately.
  338. NODEBUG=@
  339. .FIRST :
  340. $(NODEBUG) sourcetop = F$PARSE("$(SRCDIR)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
  341. $(NODEBUG) DEFINE ossl_sourceroot 'sourcetop'
  342. $(NODEBUG) !
  343. $(NODEBUG) openssl_inc1 = F$PARSE("[.include.openssl]","A.;",,,"syntax_only") - "A.;"
  344. $(NODEBUG) openssl_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.openssl]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
  345. $(NODEBUG) internal_inc1 = F$PARSE("[.crypto.include.internal]","A.;",,,"SYNTAX_ONLY") - "A.;"
  346. $(NODEBUG) internal_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
  347. $(NODEBUG) internal_inc3 = F$PARSE("{- catdir($config{sourcedir},"[.crypto.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
  348. $(NODEBUG) DEFINE openssl 'openssl_inc1','openssl_inc2'
  349. $(NODEBUG) DEFINE internal 'internal_inc1','internal_inc2','internal_inc3'
  350. $(NODEBUG) staging_dir = "$(DESTDIR)"
  351. $(NODEBUG) staging_instdir = ""
  352. $(NODEBUG) staging_datadir = ""
  353. $(NODEBUG) IF staging_dir .NES. "" THEN -
  354. staging_instdir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
  355. $(NODEBUG) IF staging_instdir - "]A.;" .NES. staging_instdir THEN -
  356. staging_instdir = staging_instdir - "]A.;" + ".OPENSSL-INSTALL]"
  357. $(NODEBUG) IF staging_instdir - "A.;" .NES. staging_instdir THEN -
  358. staging_instdir = staging_instdir - "A.;" + "[OPENSSL-INSTALL]"
  359. $(NODEBUG) IF staging_dir .NES. "" THEN -
  360. staging_datadir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
  361. $(NODEBUG) IF staging_datadir - "]A.;" .NES. staging_datadir THEN -
  362. staging_datadir = staging_datadir - "]A.;" + ".OPENSSL-COMMON]"
  363. $(NODEBUG) IF staging_datadir - "A.;" .NES. staging_datadir THEN -
  364. staging_datadir = staging_datadir - "A.;" + "[OPENSSL-COMMON]"
  365. $(NODEBUG) !
  366. $(NODEBUG) ! Installation logical names
  367. $(NODEBUG) !
  368. $(NODEBUG) installtop = F$PARSE(staging_instdir,"$(INSTALLTOP)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
  369. $(NODEBUG) datatop = F$PARSE(staging_datadir,"$(OPENSSLDIR)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
  370. $(NODEBUG) DEFINE ossl_installroot 'installtop'
  371. $(NODEBUG) DEFINE ossl_dataroot 'datatop'
  372. $(NODEBUG) !
  373. $(NODEBUG) ! Figure out the architecture
  374. $(NODEBUG) !
  375. $(NODEBUG) arch = f$edit( f$getsyi( "arch_name"), "upcase")
  376. $(NODEBUG) !
  377. $(NODEBUG) ! Set up logical names for the libraries, so LINK and
  378. $(NODEBUG) ! running programs can use them.
  379. $(NODEBUG) !
  380. $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEFINE ".uc($_)." 'F\$ENV(\"DEFAULT\")'".uc($_)."\$(SHLIB_EXT)" } @shlibs) || "!" -}
  381. .LAST :
  382. $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEASSIGN ".uc($_) } @shlibs) || "!" -}
  383. $(NODEBUG) DEASSIGN ossl_dataroot
  384. $(NODEBUG) DEASSIGN ossl_installroot
  385. $(NODEBUG) DEASSIGN internal
  386. $(NODEBUG) DEASSIGN openssl
  387. .DEFAULT :
  388. @ ! MMS cannot handle no actions...
  389. # The main targets ###################################################
  390. {- dependmagic('build_sw'); -} : build_libs_nodep, build_modules_nodep, build_programs_nodep copy-utils
  391. {- dependmagic('build_libs'); -} : build_libs_nodep
  392. {- dependmagic('build_modules'); -} : build_modules_nodep
  393. {- dependmagic('build_programs'); -} : build_programs_nodep
  394. build_generated : $(GENERATED_MANDATORY)
  395. build_libs_nodep : $(LIBS), $(SHLIBS)
  396. build_modules_nodep : $(MODULES)
  397. build_programs_nodep : $(PROGRAMS), $(SCRIPTS)
  398. build_docs: build_html_docs
  399. build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
  400. # Kept around for backward compatibility
  401. build_apps build_tests : build_programs
  402. # Convenience target to prebuild all generated files, not just the mandatory
  403. # ones
  404. build_all_generated : $(GENERATED_MANDATORY) $(GENERATED) build_docs
  405. @ ! {- output_off() if $disabled{makedepend}; "" -}
  406. @ WRITE SYS$OUTPUT "Warning: consider configuring with no-makedepend, because if"
  407. @ WRITE SYS$OUTPUT " target system doesn't have $(PERL),"
  408. @ WRITE SYS$OUTPUT " then make will fail..."
  409. @ ! {- output_on() if $disabled{makedepend}; "" -}
  410. all : build_sw build_docs
  411. test : tests
  412. {- dependmagic('tests'); -} : build_programs_nodep, build_modules_nodep copy-utils
  413. @ ! {- output_off() if $disabled{tests}; "" -}
  414. DEFINE SRCTOP "$(SRCDIR)"
  415. DEFINE BLDTOP "$(BLDDIR)"
  416. DEFINE FIPSKEY "$(FIPSKEY)"
  417. IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
  418. $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
  419. DEASSIGN BLDTOP
  420. DEASSIGN SRCTOP
  421. DEASSIGN FIPSKEY
  422. @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
  423. @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
  424. @ ! {- output_on() if !$disabled{tests}; "" -}
  425. list-tests :
  426. @ ! {- output_off() if $disabled{tests}; "" -}
  427. @ DEFINE SRCTOP "$(SRCDIR)"
  428. @ $(PERL) {- sourcefile("test", "run_tests.pl") -} list
  429. @ DEASSIGN SRCTOP
  430. @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
  431. @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
  432. @ ! {- output_on() if !$disabled{tests}; "" -}
  433. install : install_sw install_ssldirs install_docs install_final
  434. install_final :
  435. @ WRITE SYS$OUTPUT ""
  436. @ WRITE SYS$OUTPUT "######################################################################"
  437. @ WRITE SYS$OUTPUT ""
  438. @ IF "$(DESTDIR)" .EQS. "" THEN -
  439. PIPE ( WRITE SYS$OUTPUT "Installation complete" ; -
  440. WRITE SYS$OUTPUT "" ; -
  441. WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
  442. WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
  443. WRITE SYS$OUTPUT "" )
  444. @ IF "$(DESTDIR)" .NES. "" THEN -
  445. PIPE ( WRITE SYS$OUTPUT "Staging installation complete" ; -
  446. WRITE SYS$OUTPUT "" ; -
  447. WRITE SYS$OUTPUT "Finish or package in such a way that the contents of the directory tree" ; -
  448. WRITE SYS$OUTPUT staging_instdir ; -
  449. WRITE SYS$OUTPUT "ends up in $(INSTALLTOP)," ; -
  450. WRITE SYS$OUTPUT "and that the contents of the contents of the directory tree" ; -
  451. WRITE SYS$OUTPUT staging_datadir ; -
  452. WRITE SYS$OUTPUT "ends up in $(OPENSSLDIR)" ; -
  453. WRITE SYS$OUTPUT "" ; -
  454. WRITE SYS$OUTPUT "When in its final destination," ; -
  455. WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
  456. WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
  457. WRITE SYS$OUTPUT "" )
  458. check_install :
  459. spawn/nolog @ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
  460. uninstall : uninstall_docs uninstall_sw
  461. # Because VMS wants the generation number (or *) to delete files, we can't
  462. # use $(LIBS), $(PROGRAMS), $(GENERATED) and $(MODULES) directly.
  463. libclean :
  464. {- join("\n\t", map { "- DELETE $_.OLB;*" } @libs) || "@ !" -}
  465. {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*" } @shlibs) || "@ !" -}
  466. clean : libclean
  467. {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man1}}) || "@ !" -}
  468. {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man3}}) || "@ !" -}
  469. {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man5}}) || "@ !" -}
  470. {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{htmldocs}->{man7}}) || "@ !" -}
  471. {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
  472. {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{modules}}) || "@ !" -}
  473. {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{scripts}}) || "@ !" -}
  474. {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{depends}->{""}}) || "@ !" -}
  475. {- join("\n\t", map { "- DELETE $_;*" } @generated) || "@ !" -}
  476. - DELETE [...]*.MAP;*
  477. - DELETE [...]*.D;*
  478. - DELETE [...]*.OBJ;*,*.LIS;*
  479. - DELETE []CXX$DEMANGLER_DB.;*
  480. - DELETE [.VMS]openssl_startup.com;*
  481. - DELETE [.VMS]openssl_shutdown.com;*
  482. - DELETE []vmsconfig.pm;*
  483. distclean : clean
  484. - DELETE configdata.pm;*
  485. - DELETE descrip.mms;*
  486. depend : descrip.mms
  487. descrip.mms : FORCE
  488. @ ! {- output_off() if $disabled{makedepend}; "" -}
  489. @ $(PERL) {- sourcefile("util", "add-depends.pl") -} "VMS C"
  490. @ ! {- output_on() if $disabled{makedepend}; "" -}
  491. # Install helper targets #############################################
  492. install_sw : install_dev install_engines install_modules -
  493. install_runtime install_startup install_ivp
  494. uninstall_sw : uninstall_dev uninstall_modules uninstall_engines -
  495. uninstall_runtime uninstall_startup uninstall_ivp
  496. install_docs : install_html_docs
  497. uninstall_docs : uninstall_html_docs
  498. install_fips: install_sw
  499. @ WRITE SYS$OUTPUT "*** Installing FIPS module configuration"
  500. @ WRITE SYS$OUTPUT "fipsinstall $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).cnf"
  501. openssl fipsinstall -
  502. -module ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']$(FIPSMODULENAME) -
  503. -out ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']$(FIPSMODULENAME).cnf -
  504. -macopt "key:$(FIPSKEY)"
  505. uninstall_fips: uninstall_sw
  506. @ WRITE SYS$OUTPUT "*** Uninstalling FIPS module configuration"
  507. DELETE ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']$(FIPSMODULENAME).cnf;*
  508. install_ssldirs : check_INSTALLTOP
  509. - CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
  510. IF F$SEARCH("OSSL_DATAROOT:[000000]CERTS.DIR;1") .EQS. "" THEN -
  511. CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[CERTS]
  512. IF F$SEARCH("OSSL_DATAROOT:[000000]PRIVATE.DIR;1") .EQS. "" THEN -
  513. CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[PRIVATE]
  514. IF F$SEARCH("OSSL_DATAROOT:[000000]MISC.DIR;1") .EQS. "" THEN -
  515. CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[MISC]
  516. COPY/PROT=W:RE $(MISC_SCRIPTS) OSSL_DATAROOT:[MISC]
  517. @ ! Install configuration file
  518. COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
  519. ossl_dataroot:[000000]openssl.cnf-dist
  520. IF F$SEARCH("OSSL_DATAROOT:[000000]openssl.cnf") .EQS. "" THEN -
  521. COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
  522. ossl_dataroot:[000000]openssl.cnf
  523. @ ! Install CTLOG configuration file
  524. COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
  525. ossl_dataroot:[000000]ct_log_list.cnf-dist
  526. IF F$SEARCH("OSSL_DATAROOT:[000000]ct_log_list.cnf") .EQS. "" THEN -
  527. COPY/PROT=W:R {- sourcefile("apps", "ct_log_list.cnf") -} -
  528. ossl_dataroot:[000000]ct_log_list.cnf
  529. install_dev : check_INSTALLTOP install_runtime_libs
  530. @ WRITE SYS$OUTPUT "*** Installing development files"
  531. @ ! Install header files
  532. - CREATE/DIR ossl_installroot:[include.openssl]
  533. COPY/PROT=W:R openssl:*.h ossl_installroot:[include.openssl]
  534. @ ! Install static (development) libraries
  535. - CREATE/DIR ossl_installroot:[LIB.'arch']
  536. {- join("\n ",
  537. map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
  538. @install_libs) -}
  539. install_engines : check_INSTALLTOP install_runtime_libs build_modules
  540. @ {- output_off() unless scalar @install_engines; "" -} !
  541. @ WRITE SYS$OUTPUT "*** Installing engines"
  542. - CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch']
  543. {- join("\n ",
  544. map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" }
  545. @install_engines) -}
  546. @ {- output_on() unless scalar @install_engines; "" -} !
  547. install_modules : check_INSTALLTOP install_runtime_libs build_modules
  548. @ {- output_off() unless scalar @install_modules; "" -} !
  549. @ WRITE SYS$OUTPUT "*** Installing modules"
  550. - CREATE/DIR ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']
  551. {- join("\n ",
  552. map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[MODULES$sover_dirname$target{pointer_size}.'arch']" }
  553. @install_modules) -}
  554. @ {- output_on() unless scalar @install_modules; "" -} !
  555. install_runtime : install_programs
  556. install_runtime_libs : check_INSTALLTOP build_libs
  557. @ {- output_off() if $disabled{shared}; "" -} !
  558. @ WRITE SYS$OUTPUT "*** Installing shareable images"
  559. @ ! Install shared (runtime) libraries
  560. - CREATE/DIR ossl_installroot:[LIB.'arch']
  561. {- join("\n ",
  562. map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
  563. @install_shlibs) -}
  564. @ {- output_on() if $disabled{shared}; "" -} !
  565. install_programs : check_INSTALLTOP install_runtime_libs build_programs
  566. @ {- output_off() if $disabled{apps}; "" -} !
  567. @ ! Install the main program
  568. - CREATE/DIR ossl_installroot:[EXE.'arch']
  569. COPY/PROT=W:RE [.APPS]openssl.EXE -
  570. ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
  571. @ ! Install scripts
  572. COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
  573. @ ! {- output_on() if $disabled{apps}; "" -}
  574. install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
  575. [.VMS]openssl_utils.com, check_INSTALLTOP
  576. - CREATE/DIR ossl_installroot:[SYS$STARTUP]
  577. COPY/PROT=W:RE [.VMS]openssl_startup.com -
  578. ossl_installroot:[SYS$STARTUP]openssl_startup{- $osslver -}.com
  579. COPY/PROT=W:RE [.VMS]openssl_shutdown.com -
  580. ossl_installroot:[SYS$STARTUP]openssl_shutdown{- $osslver -}.com
  581. COPY/PROT=W:RE [.VMS]openssl_utils.com -
  582. ossl_installroot:[SYS$STARTUP]openssl_utils{- $osslver -}.com
  583. install_ivp : [.VMS]openssl_ivp.com check_INSTALLTOP
  584. - CREATE/DIR ossl_installroot:[SYSTEST]
  585. COPY/PROT=W:RE [.VMS]openssl_ivp.com -
  586. ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
  587. [.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
  588. - CREATE/DIR [.VMS]
  589. $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
  590. {- sourcefile("VMS", "openssl_startup.com.in") -} -
  591. > [.VMS]openssl_startup.com
  592. [.VMS]openssl_utils.com : vmsconfig.pm {- sourcefile("VMS", "openssl_utils.com.in") -}
  593. - CREATE/DIR [.VMS]
  594. $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
  595. {- sourcefile("VMS", "openssl_utils.com.in") -} -
  596. > [.VMS]openssl_utils.com
  597. [.VMS]openssl_shutdown.com : vmsconfig.pm {- sourcefile("VMS", "openssl_shutdown.com.in") -}
  598. - CREATE/DIR [.VMS]
  599. $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
  600. {- sourcefile("VMS", "openssl_shutdown.com.in") -} -
  601. > [.VMS]openssl_shutdown.com
  602. [.VMS]openssl_ivp.com : vmsconfig.pm {- sourcefile("VMS", "openssl_ivp.com.in") -}
  603. - CREATE/DIR [.VMS]
  604. $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
  605. {- sourcefile("VMS", "openssl_ivp.com.in") -} -
  606. > [.VMS]openssl_ivp.com
  607. vmsconfig.pm : configdata.pm
  608. OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
  609. WRITE CONFIG "package vmsconfig;"
  610. WRITE CONFIG "use strict; use warnings;"
  611. WRITE CONFIG "use Exporter;"
  612. WRITE CONFIG "our @ISA = qw(Exporter);"
  613. WRITE CONFIG "our @EXPORT = qw(%config %target %withargs %unified_info %disabled);"
  614. WRITE CONFIG "our %config = ("
  615. WRITE CONFIG " target => '","{- $config{target} -}","',"
  616. WRITE CONFIG " version => '","{- $config{version} -}","',"
  617. WRITE CONFIG " shlib_version => '","{- $config{shlib_version} -}","',"
  618. WRITE CONFIG " shlib_major => '","{- $config{shlib_major} -}","',"
  619. WRITE CONFIG " shlib_minor => '","{- $config{shlib_minor} -}","',"
  620. WRITE CONFIG " no_shared => '","{- $disabled{shared} -}","',"
  621. WRITE CONFIG " INSTALLTOP => '$(INSTALLTOP)',"
  622. WRITE CONFIG " OPENSSLDIR => '$(OPENSSLDIR)',"
  623. WRITE CONFIG " pointer_size => '","{- $target{pointer_size} -}","',"
  624. WRITE CONFIG ");"
  625. WRITE CONFIG "our %target = ();"
  626. WRITE CONFIG "our %disabled = ();"
  627. WRITE CONFIG "our %withargs = ();"
  628. WRITE CONFIG "our %unified_info = ();"
  629. WRITE CONFIG "1;"
  630. CLOSE CONFIG
  631. install_html_docs : check_INSTALLTOP build_html_docs
  632. @ WRITE SYS$OUTPUT "*** Installing HTML docs"
  633. - CREATE/DIR ossl_installroot:[HTML.MAN1]
  634. - CREATE/DIR ossl_installroot:[HTML.MAN3]
  635. - CREATE/DIR ossl_installroot:[HTML.MAN5]
  636. - CREATE/DIR ossl_installroot:[HTML.MAN7]
  637. {- join("\n ",
  638. ( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN1]" }
  639. @{$unified_info{htmldocs}->{man1}} ),
  640. ( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN3]" }
  641. @{$unified_info{htmldocs}->{man3}} ),
  642. ( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN5]" }
  643. @{$unified_info{htmldocs}->{man5}} ),
  644. ( map { "COPY/PROT=W:RE $_ ossl_installroot:[HTML.MAN7]" }
  645. @{$unified_info{htmldocs}->{man7}} )) -}
  646. check_INSTALLTOP :
  647. @ IF "$(INSTALLTOP)" .EQS. "" THEN -
  648. WRITE SYS$ERROR "INSTALLTOP should not be empty"
  649. @ IF "$(INSTALLTOP)" .EQS. "" THEN -
  650. EXIT %x10000002
  651. # Helper targets #####################################################
  652. copy-utils : [.util]wrap.pl
  653. [.util]wrap.pl : configdata.pm
  654. @ IF "$(SRCDIR)" .NES. "$(BLDDIR)" THEN -
  655. CREATE/DIR/LOG [.util]
  656. @ IF "$(SRCDIR)" .NES. "$(BLDDIR)" THEN -
  657. COPY/LOG ossl_sourceroot:[util]wrap.pl [.util]
  658. # Developer targets ##################################################
  659. debug_logicals :
  660. SH LOGICAL/PROC openssl,internal,ossl_installroot,ossl_dataroot
  661. # Building targets ###################################################
  662. configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
  663. perl configdata.pm -r
  664. @ WRITE SYS$OUTPUT "*************************************************"
  665. @ WRITE SYS$OUTPUT "*** ***"
  666. @ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
  667. @ WRITE SYS$OUTPUT "*** ***"
  668. @ WRITE SYS$OUTPUT "*************************************************"
  669. @ PIPE ( EXIT %X10000000 )
  670. reconfigure reconf :
  671. perl configdata.pm -r
  672. {-
  673. use File::Basename;
  674. use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
  675. # Helper function to figure out dependencies on libraries
  676. # It takes a list of library names and outputs a list of dependencies
  677. sub compute_lib_depends {
  678. # Depending on shared libraries:
  679. # On Windows POSIX layers, we depend on {libname}.dll.a
  680. # On Unix platforms, we depend on {shlibname}.so
  681. return map {
  682. { lib => platform->sharedlib($_) // platform->staticlib($_),
  683. attrs => $unified_info{attributes}->{libraries}->{$_} }
  684. } @_;
  685. }
  686. # Helper function to deal with inclusion directory specs.
  687. # We have to deal with two things:
  688. # 1. comma separation and no possibility of trailing comma
  689. # 2. no inclusion directories given at all
  690. # 3. long compiler command lines
  691. # To resolve 1, we need to iterate through the sources of inclusion
  692. # directories, and only add a comma when needed.
  693. # To resolve 2, we need to have a variable that will hold the whole
  694. # inclusion qualifier, or be the empty string if there are no inclusion
  695. # directories. That's the symbol 'qual_includes' that's used in CPPFLAGS
  696. # To resolve 3, we creata a logical name TMP_INCLUDES: to hold the list
  697. # of inclusion directories.
  698. #
  699. # This function returns a list of two lists, one being the collection of
  700. # commands to execute before the compiler is called, and the other being
  701. # the collection of commands to execute after. It takes as arguments the
  702. # collection of strings to include as directory specs.
  703. sub includes {
  704. my @stuff = ( @_ );
  705. my @before = (
  706. 'qual_includes :=',
  707. );
  708. my @after = (
  709. 'DELETE/SYMBOL/LOCAL qual_includes',
  710. );
  711. if (scalar @stuff > 0) {
  712. push @before, 'tmp_includes := '.shift(@stuff);
  713. while (@stuff) {
  714. push @before, 'tmp_add := '.shift(@stuff);
  715. push @before, 'IF tmp_includes .NES. "" .AND. tmp_add .NES. "" THEN tmp_includes = tmp_includes + ","';
  716. push @before, 'tmp_includes = tmp_includes + tmp_add';
  717. }
  718. push @before, "IF tmp_includes .NES. \"\" THEN DEFINE tmp_includes 'tmp_includes'";
  719. push @before, 'IF tmp_includes .NES. "" THEN qual_includes := /INCLUDE=(tmp_includes:)';
  720. push @before, 'DELETE/SYMBOL/LOCAL tmp_includes';
  721. push @before, 'DELETE/SYMBOL/LOCAL tmp_add';
  722. push @after, 'DEASSIGN tmp_includes:'
  723. }
  724. return ([ @before ], [ @after ]);
  725. }
  726. sub generatesrc {
  727. my %args = @_;
  728. my $generator = join(" ", @{$args{generator}});
  729. my $generator_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
  730. my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
  731. if ($args{src} =~ /\.html$/) {
  732. my $title = basename($args{src}, ".html");
  733. my $pod = $args{generator}->[0];
  734. my $mkpod2html = sourcefile('util', 'mkpod2html.pl');
  735. return <<"EOF";
  736. $args{src}: $pod
  737. \$(PERL) $mkpod2html -i $pod -o \$\@ -t "$title" -r "\$(SRCDIR)/doc"
  738. EOF
  739. } elsif (platform->isdef($args{src})) {
  740. my $target = platform->def($args{src});
  741. my $mkdef = sourcefile('util', 'mkdef.pl');
  742. my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
  743. my $ord_name =
  744. $args{generator}->[1] || basename($args{product}, '.EXE');
  745. my $case_insensitive =
  746. $target{$args{intent}.'_cflags'} =~ m|/NAMES=[^/]*AS_IS|i
  747. ? '' : ' --case-insensitive';
  748. return <<"EOF";
  749. $target : $args{generator}->[0] $deps $mkdef
  750. \$(PERL) $mkdef$ord_ver --ordinals $args{generator}->[0] --name $ord_name "--OS" "VMS"$case_insensitive > $target
  751. EOF
  752. } elsif (!platform->isasm($args{src})) {
  753. my $target = $args{src};
  754. if ($args{generator}->[0] =~ m|^.*\.in$|) {
  755. my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
  756. "util", "dofile.pl")),
  757. rel2abs($config{builddir}));
  758. my @modules = ( 'configdata.pm',
  759. grep { $_ =~ m|\.pm$| } @{$args{deps}} );
  760. my %moduleincs = map { '"-I'.dirname($_).'"' => 1 } @modules;
  761. @modules = map { '"-M'.basename($_, '.pm').'"' } @modules;
  762. my $modules = join(' ', '', sort keys %moduleincs, @modules);
  763. return <<"EOF";
  764. $target : $args{generator}->[0] $deps
  765. \$(PERL)$modules $dofile "-o$target{build_file}" $generator > \$\@
  766. EOF
  767. } else {
  768. return <<"EOF";
  769. $target : $args{generator}->[0] $deps
  770. \$(PERL)$generator_incs $generator > \$\@
  771. EOF
  772. }
  773. } else {
  774. my $cppflags = {
  775. shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
  776. lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
  777. dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
  778. bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
  779. } -> {$args{intent}};
  780. my @incs_cmds = includes({ shlib => '$(LIB_INCLUDES)',
  781. lib => '$(LIB_INCLUDES)',
  782. dso => '$(DSO_INCLUDES)',
  783. bin => '$(BIN_INCLUDES)' } -> {$args{intent}},
  784. '$(CNF_INCLUDES)',
  785. '$(INCLUDES)',
  786. @{$args{incs}});
  787. my $incs_on = join("\n\t\@ ", @{$incs_cmds[0]}) || '!';
  788. my $incs_off = join("\n\t\@ ", @{$incs_cmds[1]}) || '!';
  789. my $defs = join("", map { ",".$_ } @{$args{defs}});
  790. my $target = platform->asm($args{src});
  791. if ($args{generator}->[0] =~ /\.pl$/) {
  792. $generator = '$(PERL)'.$generator_incs.' '.$generator
  793. .' '.$cppflags;
  794. } elsif ($args{generator}->[0] =~ /\.S$/) {
  795. $generator = undef;
  796. } else {
  797. die "Generator type for $src unknown: $generator\n";
  798. }
  799. if (defined($generator)) {
  800. # If the target is named foo.S in build.info, we want to
  801. # end up generating foo.s in two steps.
  802. if ($args{src} =~ /\.S$/) {
  803. return <<"EOF";
  804. $target : $args{generator}->[0] $deps
  805. $generator \$\@-S
  806. \@ $incs_on
  807. \@ extradefines = "$defs"
  808. PIPE \$(CPP) $cppflags \$\@-S | -
  809. \$(PERL) -ne "/^#(\\s*line)?\\s*[0-9]+\\s+""/ or print" > \$\@-i
  810. \@ DELETE/SYMBOL/LOCAL extradefines
  811. \@ $incs_off
  812. RENAME \$\@-i \$\@
  813. DELETE \$\@-S;
  814. EOF
  815. }
  816. # Otherwise....
  817. return <<"EOF";
  818. $target : $args{generator}->[0] $deps
  819. \@ $incs_on
  820. \@ extradefines = "$defs"
  821. $generator \$\@
  822. \@ DELETE/SYMBOL/LOCAL extradefines
  823. \@ $incs_off
  824. EOF
  825. }
  826. return <<"EOF";
  827. $target : $args{generator}->[0] $deps
  828. \@ $incs_on
  829. \@ extradefines = "$defs"
  830. SHOW SYMBOL qual_includes
  831. PIPE \$(CPP) $cppflags $args{generator}->[0] | -
  832. \$(PERL) "-ne" "/^#(\\s*line)?\\s*[0-9]+\\s+""/ or print" > \$\@
  833. \@ DELETE/SYMBOL/LOCAL extradefines
  834. \@ $incs_off
  835. EOF
  836. }
  837. }
  838. sub src2obj {
  839. my $asmext = platform->asmext();
  840. my %args = @_;
  841. my @srcs =
  842. map { my $x = $_;
  843. (platform->isasm($x) && grep { $x eq $_ } @generated)
  844. ? platform->asm($x) : $x }
  845. ( @{$args{srcs}} );
  846. my $obj = platform->obj($args{obj});
  847. my $dep = platform->dep($args{obj});
  848. my $deps = join(", -\n\t\t", @srcs, @{$args{deps}});
  849. # Because VMS C isn't very good at combining a /INCLUDE path with
  850. # #includes having a relative directory (like '#include "../foo.h"),
  851. # the best choice is to move to the first source file's intended
  852. # directory before compiling, and make sure to write the object file
  853. # in the correct position (important when the object tree is other
  854. # than the source tree).
  855. my $forward = dirname($args{srcs}->[0]);
  856. my $backward = abs2rel(rel2abs("."), rel2abs($forward));
  857. my $objd = abs2rel(rel2abs(dirname($obj)), rel2abs($forward));
  858. my $objn = basename($obj);
  859. my $depd = abs2rel(rel2abs(dirname($dep)), rel2abs($forward));
  860. my $depn = basename($dep);
  861. my $srcs =
  862. join(", ", map { abs2rel(rel2abs($_), rel2abs($forward)) } @srcs);
  863. my $before = $unified_info{before}->{$obj} || "\@ !";
  864. my $after = $unified_info{after}->{$obj} || "\@ !";
  865. my $cflags;
  866. if ($args{attrs}->{noinst}) {
  867. $cflags = { shlib => '$(NO_INST_LIB_CFLAGS)',
  868. lib => '$(NO_INST_LIB_CFLAGS)',
  869. dso => '$(NO_INST_DSO_CFLAGS)',
  870. bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}};
  871. } else {
  872. $cflags = { shlib => '$(LIB_CFLAGS)',
  873. lib => '$(LIB_CFLAGS)',
  874. dso => '$(DSO_CFLAGS)',
  875. bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
  876. }
  877. $cflags .= { shlib => '$(LIB_CPPFLAGS)',
  878. lib => '$(LIB_CPPFLAGS)',
  879. dso => '$(DSO_CPPFLAGS)',
  880. bin => '$(BIN_CPPFLAGS)' } -> {$args{intent}};
  881. my $defs = join("", map { ",".$_ } @{$args{defs}});
  882. my $asflags = { shlib => ' $(LIB_ASFLAGS)',
  883. lib => ' $(LIB_ASFLAGS)',
  884. dso => ' $(DSO_ASFLAGS)',
  885. bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}};
  886. my @incs_cmds = includes({ shlib => '$(LIB_INCLUDES)',
  887. lib => '$(LIB_INCLUDES)',
  888. dso => '$(DSO_INCLUDES)',
  889. bin => '$(BIN_INCLUDES)' } -> {$args{intent}},
  890. '$(INCLUDES)',
  891. map {
  892. file_name_is_absolute($_)
  893. ? $_ : catdir($backward,$_)
  894. } @{$args{incs}});
  895. my $incs_on = join("\n\t\@ ", @{$incs_cmds[0]}) || '!';
  896. my $incs_off = join("\n\t\@ ", @{$incs_cmds[1]}) || '!';
  897. if ($srcs[0] =~ /\Q${asmext}\E$/) {
  898. return <<"EOF";
  899. $obj : $deps
  900. ${before}
  901. SET DEFAULT $forward
  902. \$(AS) $asflags \$(ASOUTFLAG)${objd}${objn} $srcs
  903. SET DEFAULT $backward
  904. ${after}
  905. - PURGE $obj
  906. EOF
  907. } elsif ($srcs[0] =~ /.S$/) {
  908. return <<"EOF";
  909. $obj : $deps
  910. ${before}
  911. SET DEFAULT $forward
  912. \@ $incs_on
  913. \@ extradefines = "$defs"
  914. PIPE \$(CPP) ${cflags} $srcs | -
  915. \$(PERL) -ne "/^#(\\s*line)?\\s*[0-9]+\\s+""/ or print" -
  916. > ${objd}${objn}-asm
  917. \@ DELETE/SYMBOL/LOCAL extradefines
  918. \@ $incs_off
  919. SET DEFAULT $backward
  920. ${after}
  921. \$(AS) $asflags \$(ASOUTFLAG)$obj $obj-asm
  922. - PURGE $obj
  923. EOF
  924. }
  925. my $depbuild = $disabled{makedepend} ? ""
  926. : " /MMS=(FILE=${depd}${depn},TARGET=$obj)";
  927. return <<"EOF";
  928. $obj : $deps
  929. ${before}
  930. SET DEFAULT $forward
  931. \@ $incs_on
  932. \@ extradefines = "$defs"
  933. \$(CC) ${cflags}${depbuild} /OBJECT=${objd}${objn} /REPOSITORY=$backward $srcs
  934. \@ DELETE/SYMBOL/LOCAL extradefines
  935. \@ $incs_off
  936. SET DEFAULT $backward
  937. ${after}
  938. - PURGE $obj
  939. EOF
  940. }
  941. sub obj2shlib {
  942. my %args = @_;
  943. my $shlibname = platform->sharedname($args{lib});
  944. my $shlib = platform->sharedlib($args{lib});
  945. my @objs = map { platform->convertext($_) }
  946. grep { platform->isobj($_) }
  947. @{$args{objs}};
  948. my @defs = map { platform->convertext($_) }
  949. grep { platform->isdef($_) }
  950. @{$args{objs}};
  951. my @deps = compute_lib_depends(@{$args{deps}});
  952. die "More than one symbol vector" if scalar @defs > 1;
  953. my $deps = join(", -\n\t\t", @objs, @defs, map { $_->{lib} } @deps);
  954. my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
  955. my $translatesyms_pl = abs2rel(rel2abs(catfile($config{sourcedir},
  956. "VMS", "translatesyms.pl")),
  957. rel2abs($config{builddir}));
  958. # The "[]" hack is because in .OPT files, each line inherits the
  959. # previous line's file spec as default, so if no directory spec
  960. # is present in the current line and the previous line has one that
  961. # doesn't apply, you're in for a surprise.
  962. my $write_opt1 =
  963. join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
  964. "WRITE OPT_FILE \"$x" } @objs).
  965. "\"";
  966. my $write_opt2 =
  967. join("\n\t", map { my $x = $_->{lib} =~ /\[/
  968. ? $_->{lib} : "[]".$_->{lib};
  969. $x =~ s|(\.EXE)|$1/SHARE|;
  970. $x =~ s|(\.OLB)|$1/LIB|;
  971. "WRITE OPT_FILE \"$x\"" } @deps)
  972. || "\@ !";
  973. return <<"EOF"
  974. $shlib : $deps
  975. \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $defs[0] > $defs[0]-translated
  976. OPEN/WRITE/SHARE=READ OPT_FILE $shlibname-components.OPT
  977. $write_opt1
  978. $write_opt2
  979. CLOSE OPT_FILE
  980. LINK \$(LIB_LDFLAGS)/SHARE=\$\@ $defs[0]-translated/OPT,-
  981. $shlibname-components.OPT/OPT \$(LIB_EX_LIBS)
  982. DELETE $defs[0]-translated;*,$shlibname-components.OPT;*
  983. PURGE $shlibname.EXE,$shlibname.MAP
  984. EOF
  985. . ($config{target} =~ m|alpha| ? "" : <<"EOF"
  986. SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
  987. EOF
  988. );
  989. }
  990. sub obj2dso {
  991. my %args = @_;
  992. my $dsoname = platform->dsoname($args{module});
  993. my $dso = platform->dso($args{module});
  994. my @objs = map { platform->convertext($_) }
  995. grep { platform->isobj($_) }
  996. @{$args{objs}};
  997. my @defs = map { platform->convertext($_) }
  998. grep { platform->isdef($_) }
  999. @{$args{objs}};
  1000. my @deps = compute_lib_depends(@{$args{deps}});
  1001. my $deps = join(", -\n\t\t", @objs, @defs, map { $_->{lib} } @deps);
  1002. die "More than one symbol vector" if scalar @defs > 1;
  1003. my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
  1004. # The "[]" hack is because in .OPT files, each line inherits the
  1005. # previous line's file spec as default, so if no directory spec
  1006. # is present in the current line and the previous line has one that
  1007. # doesn't apply, you're in for a surprise.
  1008. my $write_opt1 =
  1009. join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
  1010. "WRITE OPT_FILE \"$x" } @objs).
  1011. "\"";
  1012. my $write_opt2 =
  1013. join("\n\t", map { my $x = $_->{lib} =~ /\[/
  1014. ? $_->{lib} : "[]".$_->{lib};
  1015. $x =~ s|(\.EXE)|$1/SHARE|;
  1016. $x =~ s|(\.OLB)|$1/LIB|;
  1017. "WRITE OPT_FILE \"$x\"" } @deps)
  1018. || "\@ !";
  1019. return <<"EOF"
  1020. $dso : $deps
  1021. OPEN/WRITE/SHARE=READ OPT_FILE $dsoname-components.OPT
  1022. $write_opt1
  1023. $write_opt2
  1024. CLOSE OPT_FILE
  1025. LINK \$(DSO_LDFLAGS)/SHARE=\$\@ $defs[0]/OPT,-
  1026. $dsoname-components.OPT/OPT \$(DSO_EX_LIBS)
  1027. - PURGE $dsoname.EXE,$dsoname.OPT,$dsoname.MAP
  1028. EOF
  1029. . ($config{target} =~ m|alpha| ? "" : <<"EOF"
  1030. SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
  1031. EOF
  1032. );
  1033. }
  1034. sub obj2lib {
  1035. my %args = @_;
  1036. my $lib = platform->staticlib($args{lib});
  1037. my @objs = map { platform->convertext($_) }
  1038. grep { platform->isobj($_) }
  1039. @{$args{objs}};
  1040. my $objs = join(", -\n\t\t", @objs);
  1041. my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib $_" } @objs));
  1042. return <<"EOF";
  1043. $lib : $objs
  1044. LIBRARY/CREATE/OBJECT $lib
  1045. $fill_lib
  1046. - PURGE $lib
  1047. EOF
  1048. }
  1049. sub obj2bin {
  1050. my %args = @_;
  1051. my $bin = platform->bin($args{bin});
  1052. my $binname = platform->binname($args{bin});
  1053. my @objs = map { platform->convertext($_) }
  1054. grep { platform->isobj($_) }
  1055. @{$args{objs}};
  1056. my $objs = join(",", @objs);
  1057. my @deps = compute_lib_depends(@{$args{deps}});
  1058. my $deps = join(", -\n\t\t", @objs, map { $_->{lib} } @deps);
  1059. my $olb_count = scalar grep(m|\.OLB$|, map { $_->{lib} } @deps);
  1060. my $analyse_objs = "@ !";
  1061. if ($olb_count > 0) {
  1062. my $analyse_quals =
  1063. $config{target} =~ m|alpha| ? "/GSD" : "/SECTIONS=SYMTAB";
  1064. $analyse_objs = "- pipe ANALYSE/OBJECT$analyse_quals $objs | SEARCH SYS\$INPUT \"\"\"main\"\"\" ; nomain = \$severity .NE. 1"
  1065. }
  1066. # The "[]" hack is because in .OPT files, each line inherits the
  1067. # previous line's file spec as default, so if no directory spec
  1068. # is present in the current line and the previous line has one that
  1069. # doesn't apply, you're in for a surprise.
  1070. my $write_opt1 =
  1071. join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
  1072. "\@ WRITE OPT_FILE \"$x" } @objs).
  1073. "\"";
  1074. my $write_opt2 =
  1075. join("\n\t", "WRITE OPT_FILE \"CASE_SENSITIVE=YES\"",
  1076. map { my @lines = ();
  1077. use Data::Dumper;
  1078. my $x = $_->{lib} =~ /\[/
  1079. ? $_->{lib} : "[]".$_->{lib};
  1080. if ($x =~ m|\.EXE$|) {
  1081. push @lines, "\@ WRITE OPT_FILE \"$x/SHARE\"";
  1082. } elsif ($x =~ m|\.OLB$|) {
  1083. # Special hack to include the MAIN object
  1084. # module explicitly. This will only be done
  1085. # if there isn't a 'main' in the program's
  1086. # object modules already.
  1087. my $main = $_->{attrs}->{has_main}
  1088. ? '/INCLUDE=main' : '';
  1089. push @lines,
  1090. "\@ IF nomain THEN WRITE OPT_FILE \"$x/LIB$main\"",
  1091. "\@ IF .NOT. nomain THEN WRITE OPT_FILE \"$x/LIB\""
  1092. }
  1093. @lines
  1094. } @deps)
  1095. || "\@ !";
  1096. # The linking commands looks a bit complex, but it's for good reason.
  1097. # When you link, say, foo.obj, bar.obj and libsomething.exe/share, and
  1098. # bar.obj happens to have a symbol that also exists in libsomething.exe,
  1099. # the linker will warn about it, loudly, and will then choose to pick
  1100. # the first copy encountered (the one in bar.obj in this example).
  1101. # On Unix and on Windows, the corresponding maneuvre goes through
  1102. # silently with the same effect.
  1103. # With some test programs, made for checking the internals of OpenSSL,
  1104. # we do this kind of linking deliberately, picking a few specific object
  1105. # files from within [.crypto] or [.ssl] so we can reach symbols that are
  1106. # otherwise unreachable (since the shareable images only exports the
  1107. # symbols listed in [.util]*.num), and then with the shared libraries
  1108. # themselves. So we need to silence the warning about multiply defined
  1109. # symbols, to mimic the way linking work on Unix and Windows, and so
  1110. # the build isn't interrupted (MMS stops when warnings are signaled,
  1111. # by default), and so someone building doesn't have to worry where it
  1112. # isn't necessary. If there are other warnings, however, we show them
  1113. # and let it break the build.
  1114. return <<"EOF"
  1115. $bin : $deps
  1116. $analyse_objs
  1117. @ OPEN/WRITE/SHARE=READ OPT_FILE $binname.OPT
  1118. $write_opt1
  1119. $write_opt2
  1120. @ CLOSE OPT_FILE
  1121. TYPE $binname.OPT ! For debugging
  1122. - pipe SPAWN/WAIT/NOLOG/OUT=$binname.LINKLOG -
  1123. LINK \$(BIN_LDFLAGS)/EXEC=\$\@ $binname.OPT/OPT \$(BIN_EX_LIBS) ; -
  1124. link_status = \$status ; link_severity = link_status .AND. 7
  1125. @ search_severity = 1
  1126. -@ IF link_severity .EQ. 0 THEN -
  1127. pipe SEARCH $binname.LINKLOG "%","-"/MATCH=AND | -
  1128. SPAWN/WAIT/NOLOG/OUT=NLA0: -
  1129. SEARCH SYS\$INPUT: "-W-MULDEF,"/MATCH=NOR ; -
  1130. search_severity = \$severity
  1131. @ ! search_severity is 3 when the last search didn't find any matching
  1132. @ ! string: %SEARCH-I-NOMATCHES, no strings matched
  1133. @ ! If that was the result, we pretend linking got through without
  1134. @ ! fault or warning.
  1135. @ IF search_severity .EQ. 3 THEN link_severity = 1
  1136. @ ! At this point, if link_severity shows that there was a fault
  1137. @ ! or warning, make sure to restore the linking status.
  1138. -@ IF .NOT. link_severity THEN TYPE $binname.LINKLOG
  1139. -@ DELETE $binname.LINKLOG;*
  1140. @ IF .NOT. link_severity THEN SPAWN/WAIT/NOLOG EXIT 'link_status'
  1141. - PURGE $bin,$binname.OPT
  1142. EOF
  1143. . ($config{target} =~ m|alpha| ? "" : <<"EOF"
  1144. SET IMAGE/FLAGS=(NOCALL_DEBUG) \$\@
  1145. EOF
  1146. );
  1147. }
  1148. sub in2script {
  1149. my %args = @_;
  1150. my $script = $args{script};
  1151. return "" if grep { $_ eq $script } @{$args{sources}}; # No overwrite!
  1152. my $sources = join(" ", @{$args{sources}});
  1153. my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
  1154. "util", "dofile.pl")),
  1155. rel2abs($config{builddir}));
  1156. return <<"EOF";
  1157. $script : $sources
  1158. \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
  1159. "-o$target{build_file}" $sources > $script
  1160. SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
  1161. PURGE $script
  1162. EOF
  1163. }
  1164. "" # Important! This becomes part of the template result.
  1165. -}