Skip to content
Snippets Groups Projects
Commit 2b0d134d authored by mooney's avatar mooney
Browse files

Modified makeIocCdCommands.pl to support "include" directives

and the EPICS_SUPPORT_PATH environment variable.
parent 288a7843
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,14 @@ eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*- ...@@ -2,6 +2,14 @@ eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeIocCdCommands.pl if $running_under_some_shell; # makeIocCdCommands.pl
use Cwd; use Cwd;
use Env;
$post = $ENV{"EPICS_SUPPORT_PATH"};
if ($post ne "")
{
$prefix = "EPICS_SUPPORT_PATH";
$applications{$prefix} = $post;
}
$cwd = cwd(); $cwd = cwd();
#hack for sun4 #hack for sun4
...@@ -24,37 +32,63 @@ print OUT "top = \"$top\"\n"; ...@@ -24,37 +32,63 @@ print OUT "top = \"$top\"\n";
$topbin = "${top}/bin/${arch}"; $topbin = "${top}/bin/${arch}";
#skip check that top/bin/${arch} exists; src may not have been builT #skip check that top/bin/${arch} exists; src may not have been builT
print OUT "topbin = \"$topbin\"\n"; print OUT "topbin = \"$topbin\"\n";
$release = "$top/config/RELEASE";
if (-r "$release") { @files =();
open(IN, "$release") or die "Cannot open $release\n"; push(@files,"$top/config/RELEASE");
while ($line = <IN>) { foreach $file (@files) {
next if ( $line =~ /\s*#/ ); if (-r "$file") {
chomp($line); open(IN, "$file") or die "Cannot open $file\n";
$_ = $line; while ($line = <IN>) {
#the following looks for next if ( $line =~ /\s*#/ );
# prefix = $(macro)post chomp($line);
($prefix,$macro,$post) = /(.*)\s*=\s*\$\((.*)\)(.*)/; $_ = $line;
if ($macro eq "") { # true if no macro is present ($prefix,$macro,$post) = /(.*)\s* \s*\$\((.*)\)(.*)/;
# the following looks for #test for "include" command
# prefix = post if ($prefix eq "include") {
($prefix,$post) = /(.*)\s*=\s*(.*)/; if ($macro eq "") {
} else { # true if no macro is present
$base = $applications{$macro}; #the following looks for
if ($base eq "") { #prefix = post
print "error: $macro was not previously defined\n"; ($prefix,$post) = /(.*)\s* \s*(.*)/;
} else { }
$post = $base . $post; else {
} $base = $applications{$macro};
} if ($base eq "") {
$applications{$prefix} = $post; #print "error: $macro was not previously defined\n";
$app = lc($prefix); }
if ( -d "$post") { #check that directory exists else {
print OUT "$app = \"$post\"\n"; $post = $base . $post;
} }
if ( -d "$post/bin/$arch") { #check that directory exists }
print OUT "${app}bin = \"$post/bin/$arch\"\n"; push(@files,"$post")
} }
else {
#the following looks for
# prefix = $(macro)post
($prefix,$macro,$post) = /(.*)\s*=\s*\$\((.*)\)(.*)/;
if ($macro eq "") { # true if no macro is present
# the following looks for
# prefix = post
($prefix,$post) = /(.*)\s*=\s*(.*)/;
} else {
$base = $applications{$macro};
if ($base eq "") {
print "error: $macro was not previously defined\n";
} else {
$post = $base . $post;
}
}
$applications{$prefix} = $post;
$app = lc($prefix);
if ( -d "$post") { #check that directory exists
print OUT "$app = \"$post\"\n";
}
if ( -d "$post/bin/$arch") { #check that directory exists
print OUT "${app}bin = \"$post/bin/$arch\"\n";
}
}
}
close IN;
} }
close IN;
} }
close OUT; close OUT;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment