@@ -553,7 +553,6 @@ distclean : clean
553553 - DELETE descrip.mms ;*
554554
555555depend : descrip.mms
556- descrip.mms : FORCE
557556 @ ! {- output_off() if $disabled {makedepend}; " " -}
558557 @ $ (PERL) {- sourcefile(" util" , " add-depends.pl" ) -} " {- $config{makedep_scheme} -}"
559558 @ ! {- output_on() if $disabled {makedepend}; " " -}
@@ -755,7 +754,16 @@ debug_logicals :
755754
756755# Building targets ###################################################
757756
758- configdata.pm : $ (SRCDIR)Configure $ (SRCDIR)config.com {- join(" " , @{$config {build_file_templates}}, @{$config {build_infos}}, @{$config {conf_files}}) -}
757+ descrip.mms : configdata.pm {- join(" " , @{$config {build_file_templates}}) -}
758+ perl configdata.pm
759+ @ WRITE SYS$OUTPUT " *************************************************"
760+ @ WRITE SYS$OUTPUT " *** ***"
761+ @ WRITE SYS$OUTPUT " *** Please run the same mms command again ***"
762+ @ WRITE SYS$OUTPUT " *** ***"
763+ @ WRITE SYS$OUTPUT " *************************************************"
764+ @ PIPE ( EXIT %X10000000 )
765+
766+ configdata.pm : $ (SRCDIR)Configure $ (SRCDIR)config.com {- join(" " , @{$config {build_infos}}, @{$config {conf_files}}) -}
759767 perl configdata.pm -r
760768 @ WRITE SYS$OUTPUT " *************************************************"
761769 @ WRITE SYS$OUTPUT " *** ***"
871879 return ($filename , $scripture );
872880 }
873881
882+ # On VMS, (some) header file directories include the files
883+ # __DECC_INCLUDE_EPILOGUE.H and __DECC_INCLUDE_PROLOGUE.H.
884+ # When header files are generated, and the build directory
885+ # isn't the same as the source directory, these files must
886+ # be copied alongside the generated header file, or their
887+ # effect will be lost.
888+ # We use the same include file cache as make_includefile
889+ # to check if the scripture to copy these files has already
890+ # been generated.
891+ sub make_decc_include_files {
892+ my $outd = shift;
893+ my $ind = shift;
894+
895+ # If the build directory and the source directory are the
896+ # same, there's no need to copy the prologue and epilogue
897+ # files.
898+ return ('') if $outd eq $ind ;
899+
900+ my $outprologue = catfile($outd , '__DECC_INCLUDE_PROLOGUE.H ');
901+ my $outepilogue = catfile($outd , '__DECC_INCLUDE_EPILOGUE.H ');
902+ my $inprologue = catfile($ind , '__DECC_INCLUDE_PROLOGUE.H ');
903+ my $inepilogue = catfile($ind , '__DECC_INCLUDE_EPILOGUE.H ');
904+ my @filenames = ();
905+ my $scripture = '';
906+
907+ if ($includefile_cache {$outprologue }) {
908+ push @filenames, $outprologue ;
909+ } elsif (-f $inprologue ) {
910+ my $local_scripture . = <<" EOF" ;
911+ $outprologue : $inprologue
912+ COPY $inprologue $outprologue
913+ EOF
914+ $includefile_cache {$outprologue } = $local_scripture ;
915+
916+ push @filenames, $outprologue ;
917+ $scripture . = $local_scripture ;
918+ }
919+ if ($includefile_cache {$outepilogue }) {
920+ push @filenames, $outepilogue ;
921+ } elsif (-f $inepilogue ) {
922+ my $local_scripture . = <<" EOF" ;
923+ $outepilogue : $inepilogue
924+ COPY $inepilogue $outepilogue
925+ EOF
926+ $includefile_cache {$outepilogue } = $local_scripture ;
927+
928+ push @filenames, $outepilogue ;
929+ $scripture . = $local_scripture ;
930+ }
931+
932+ return (@filenames, $scripture );
933+ }
934+
874935 sub generatetarget {
875936 my %args = @_;
876937 my $deps = join(" " , compute_platform_depends(@{$args {deps}}));
@@ -984,12 +1045,18 @@ EOF
9841045 my @perlmodules = ( 'configdata.pm ',
9851046 grep { $_ = ~ m| \.pm $ | } @{$args {deps}} );
9861047 my %perlmoduleincs = map { '" -I'.dirname($_).'" ' = > 1 } @perlmodules;
987- $deps = join(' ', $deps , compute_platform_depends(@perlmodules));
1048+ my @decc_include_data
1049+ = make_decc_include_files(dirname($args {src}), dirname($gen0 ));
1050+ my $decc_include_scripture = pop @decc_include_data;
1051+ $deps = join(' ', $deps , @decc_include_data,
1052+ compute_platform_depends(@perlmodules));
9881053 @perlmodules = map { '" -M'.basename($_, '.pm').'" ' } @perlmodules;
9891054 my $perlmodules = join(' ', '', sort keys %perlmoduleincs, @perlmodules);
1055+
9901056 return <<" EOF" ;
9911057$args {src} : $gen0 $deps
9921058 \$ (PERL)$perlmodules $dofile " -o$target{build_file}" $gen0$gen_args > \$ \@
1059+ $decc_include_scripture
9931060EOF
9941061 } elsif (grep { $_ eq $gen0 } @{$unified_info {programs}}) {
9951062 #
0 commit comments