|
223 | 223 | if ( index($IncDirName,$h_dir) == -1 && $h_dir ne $DirName){ |
224 | 224 | # print "=> Adding $h_dir to [$IncDirname]\n"; |
225 | 225 | $IncDirName .= "-I$h_dir "; |
| 226 | + #$IncDirName .= "-I$ENV{STAR}/$h_dir -I$h_dir "; |
226 | 227 | } |
227 | 228 |
|
228 | 229 | if ($class) { |
|
388 | 389 |
|
389 | 390 | for my $class (@classes) { #loop over classes |
390 | 391 | 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"; |
392 | 393 | foreach my $ext ((".h",".hh")){ #search for a few |
393 | 394 | if (!$h) { #No .h for class |
394 | 395 | my $hfile = $DirName . "/" . $class . $ext; #print "1 hfile = $hfile\n"; |
|
406 | 407 |
|
407 | 408 | my $hh = " " . basename($h) . " "; #print "hh = $hh\n"; |
408 | 409 | if ($h_files !~ /$hh/ ) {$h_files .= $hh;} |
409 | | -}#end loop over classes |
| 410 | +} #end loop over classes |
410 | 411 |
|
411 | 412 | my @h_files = split ' ', $h_files; |
412 | 413 | my $h_filesC = ""; |
|
422 | 423 | if ($h_files) { |
423 | 424 | $h_files .= " " . "LinkDef.h"; |
424 | 425 |
|
425 | | - |
426 | | -# $CPPFLAGS .= " -I" . $DirName; |
427 | | -# my $cmd = "rootcint -f $Cint_cxx -c -DROOT_CINT -D__ROOT__ -I. $CPPFLAGS $h_files"; |
428 | | - |
429 | 426 | $CPPFLAGS = " -I" . $DirName . " " . $IncDirName . $CPPFLAGS; |
430 | 427 |
|
431 | 428 | my $cmd; |
432 | | - #foreach (keys %ENV){ |
433 | | - # print "DEBUG ".$_." ".$ENV{$_}."\n"; |
434 | | - #} |
435 | 429 |
|
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"; |
439 | 461 | #} 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"; |
443 | 463 | #} |
444 | 464 |
|
| 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 | + |
445 | 469 |
|
446 | 470 | my $flag = `$cmd`; if ($?) {exit 2;} |
447 | 471 | } |
|
0 commit comments