Skip to content

Commit f4d4b69

Browse files
authored
Update RootCint.pl (#775)
ROOT6 dictionary seem to require full path, added logic for this but there is a caveat in relation to path expansion (see comment inside).
1 parent 1ae6407 commit f4d4b69

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

mgr/RootCint.pl

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
if ( index($IncDirName,$h_dir) == -1 && $h_dir ne $DirName){
224224
# print "=> Adding $h_dir to [$IncDirname]\n";
225225
$IncDirName .= "-I$h_dir ";
226+
#$IncDirName .= "-I$ENV{STAR}/$h_dir -I$h_dir ";
226227
}
227228

228229
if ($class) {
@@ -388,7 +389,7 @@
388389

389390
for my $class (@classes) { #loop over classes
390391
next if ! $class;
391-
my $h = $class_hfile{$class}; #print "Class: $class h: $h written: $class_written{$class} \n";
392+
my $h = $class_hfile{$class}; # print "Class: $class h: $h written: $class_written{$class} \n";
392393
foreach my $ext ((".h",".hh")){ #search for a few
393394
if (!$h) { #No .h for class
394395
my $hfile = $DirName . "/" . $class . $ext; #print "1 hfile = $hfile\n";
@@ -406,7 +407,7 @@
406407

407408
my $hh = " " . basename($h) . " "; #print "hh = $hh\n";
408409
if ($h_files !~ /$hh/ ) {$h_files .= $hh;}
409-
}#end loop over classes
410+
} #end loop over classes
410411

411412
my @h_files = split ' ', $h_files;
412413
my $h_filesC = "";
@@ -422,26 +423,49 @@
422423
if ($h_files) {
423424
$h_files .= " " . "LinkDef.h";
424425

425-
426-
# $CPPFLAGS .= " -I" . $DirName;
427-
# my $cmd = "rootcint -f $Cint_cxx -c -DROOT_CINT -D__ROOT__ -I. $CPPFLAGS $h_files";
428-
429426
$CPPFLAGS = " -I" . $DirName . " " . $IncDirName . $CPPFLAGS;
430427

431428
my $cmd;
432-
#foreach (keys %ENV){
433-
# print "DEBUG ".$_." ".$ENV{$_}."\n";
434-
#}
435429

436-
#if ( defined($ENV{ROOTCINT_CPPFLAGS}) ){
437-
# $cmd = "rootcint -f $Cint_cxx -c -D__NO_STRANGE_MUDST__ -DROOT_CINT -D__ROOT__ $CPPFLAGS $h_files";
438-
# print "cmd (+extra) = ",$cmd,"\n";
430+
# one more loop to add -I$STAR
431+
#my($STAR)=$ENV{STAR};
432+
my(@minusi)=split(" ",$CPPFLAGS);
433+
my($newf,$el)="";
434+
my($cwd)=$ENV{PWD};
435+
436+
# Ideally, this should have returned teh shell path but it
437+
# expands it ... So, we will have an issue, as if it expands
438+
# /star/nfs4/ as /direct/star+nfs4/, making path link tricks
439+
# and code relocation will not work. We will need to re-compile.
440+
#print "-- $cwd\n";
441+
442+
# This should work for both when we are in $STAR or
443+
# compiling private code which will also have the
444+
# same issue if dictionaries are rebuilt ...
445+
#if ( $cwd eq $STAR){
446+
foreach $el ( @minusi ){
447+
#print "--> $el\n";
448+
if ( $el =~ m/(-I)(.*)/ ){
449+
$el = $2;
450+
if ( -d "$cwd/$el"){
451+
$newf .= "-I$cwd/$el -I$el ";
452+
} else {
453+
$newf .= "-I$el ";
454+
}
455+
} else {
456+
$newf .= $el. " ";
457+
}
458+
}
459+
chomp($newf); $CPPFLAGS = $newf;
460+
#print "-- would substitute with $newf\n";
439461
#} else {
440-
$cmd = "rootcint -f $Cint_cxx -c -DROOT_CINT -D__ROOT__ $CPPFLAGS $h_files";
441-
print "cmd (normal)= ",$cmd,"\n";
442-
# die;
462+
# # print "-- not the same directory $cwd $STAR\n";
443463
#}
444464

465+
$cmd = "rootcint -f $Cint_cxx -c -DROOT_CINT -D__ROOT__ $CPPFLAGS $h_files";
466+
# print "DEBUG $CPPFLAGS\n";
467+
print "cmd (normal)= ",$cmd,"\n";
468+
445469

446470
my $flag = `$cmd`; if ($?) {exit 2;}
447471
}

0 commit comments

Comments
 (0)