From de32511d50ad45e3d0506179b14e8b02de27e0bf Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Thu, 22 Sep 2022 16:07:52 -0400 Subject: [PATCH 1/3] cons: Cleanup commented code in ConsDefs --- mgr/ConsDefs.pm | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/mgr/ConsDefs.pm b/mgr/ConsDefs.pm index 55d96aa00be..53a18d15333 100644 --- a/mgr/ConsDefs.pm +++ b/mgr/ConsDefs.pm @@ -1049,6 +1049,7 @@ "LIBDIR = $LoggerLIBDIR \tLoggerINCDIR = $LoggerINCDIR \tLoggerLIBS = $LoggerLIBS\n" if $LoggerLIBDIR && ! $param::quiet; } + # xml2 my ($XMLINCDIR,$XMLLIBDIR,$XMLLIBS) = ("","",""); my ($xml) = script::find_lib($MYSTAR . "/bin /usr/bin " . $LIBXML2_DIR . "/bin " . dirname(`which xml2-config`), @@ -1072,15 +1073,6 @@ $XMLLIBDIR = "/usr/$LLIB"; } - - # ($XMLLIBDIR,$XMLLIBS) = split(' ', $XML); - # if ($XMLLIBDIR =~ /-L/){ - # $XMLLIBDIR =~ s/-L//; - # } else { - # # may not have any -L - # if ($XMLLIBS - # } - my $XMLVersion = `$xml --version`; # print "XMLVersion = $XMLVersion\n"; my ($major,$minor) = split '\.', $XMLVersion; # print "major = $major,minor = $minor\n"; $XMLCPPFlag = "";#-DXmlTreeReader"; From e889dfcea90f764682da16cf617dd8848069ecaa Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Thu, 22 Sep 2022 16:45:41 -0400 Subject: [PATCH 2/3] cons: Use xml2_config to set up external dependency on libxml2 --- mgr/ConsDefs.pm | 68 ++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/mgr/ConsDefs.pm b/mgr/ConsDefs.pm index 53a18d15333..910f967cabd 100644 --- a/mgr/ConsDefs.pm +++ b/mgr/ConsDefs.pm @@ -1051,43 +1051,43 @@ } # xml2 + chomp(my $xml = `which xml2-config`); + + if ($?) { + die "No xml2-config found\n"; + } + my ($XMLINCDIR,$XMLLIBDIR,$XMLLIBS) = ("","",""); - my ($xml) = script::find_lib($MYSTAR . "/bin /usr/bin " . $LIBXML2_DIR . "/bin " . dirname(`which xml2-config`), - "xml2-config"); - if ($xml) { - $xml .= "/xml2-config"; - $XMLINCDIR = `$xml --cflags`; - chomp($XMLINCDIR); - $XMLINCDIR =~ s/-I//; - my $XML = `$xml --libs`; # die "$XML\n"; - my(@libs)= split(" ", $XML); - - $XMLLIBDIR = shift(@libs); - if ($XMLLIBDIR =~ /-L/){ - $XMLLIBDIR =~ s/-L//; - $XMLLIBS = join(" ",@libs); - } else { - # no -L, assume all were LIBS - $XMLLIBS = $XMLLIBDIR ." ".join(" ",@libs); - # and fix -L / should work for both 32 and 64 - $XMLLIBDIR = "/usr/$LLIB"; - } - my $XMLVersion = `$xml --version`; # print "XMLVersion = $XMLVersion\n"; - my ($major,$minor) = split '\.', $XMLVersion; # print "major = $major,minor = $minor\n"; - $XMLCPPFlag = "";#-DXmlTreeReader"; - if ($major < 2 or $major == 2 and $minor < 5) { - $XMLCPPFlag = "-DNoXmlTreeReader"; - } - if ( ! $param::quiet ){ - if ( $XMLLIBDIR ){ - print "Use xml $xml XMLLIBDIR = $XMLLIBDIR \tXMLINCDIR = $XMLINCDIR \tXMLLIBS = $XMLLIBS XMLCPPFlag =$XMLCPPFlag\n"; - } else { - print "Use xml -> WARNING ** Could not define XMLLIBDIR, XMLINCDIR, XMLLIBS\n"; - } - } + $XMLINCDIR = `$xml --cflags`; + chomp($XMLINCDIR); + $XMLINCDIR =~ s/-I//; + my $XML = `$xml --libs`; # die "$XML\n"; + my(@libs)= split(" ", $XML); + + $XMLLIBDIR = shift(@libs); + if ($XMLLIBDIR =~ /-L/){ + $XMLLIBDIR =~ s/-L//; + $XMLLIBS = join(" ",@libs); } else { - print "Could not find xml libs\n" if (! $param::quiet); + # no -L, assume all were LIBS + $XMLLIBS = $XMLLIBDIR ." ".join(" ",@libs); + # and fix -L / should work for both 32 and 64 + $XMLLIBDIR = "/usr/$LLIB"; + } + + my $XMLVersion = `$xml --version`; # print "XMLVersion = $XMLVersion\n"; + my ($major,$minor) = split '\.', $XMLVersion; # print "major = $major,minor = $minor\n"; + $XMLCPPFlag = "";#-DXmlTreeReader"; + if ($major < 2 or $major == 2 and $minor < 5) { + $XMLCPPFlag = "-DNoXmlTreeReader"; + } + if ( ! $param::quiet ){ + if ( $XMLLIBDIR ){ + print "Use xml $xml XMLLIBDIR = $XMLLIBDIR \tXMLINCDIR = $XMLINCDIR \tXMLLIBS = $XMLLIBS XMLCPPFlag =$XMLCPPFlag\n"; + } else { + print "Use xml -> WARNING ** Could not define XMLLIBDIR, XMLINCDIR, XMLLIBS\n"; + } } chomp($FASTJET_PREFIX = `fastjet-config --prefix`); From 12b62b545d583c89088dae3e2aafc63bb6556b33 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Thu, 22 Sep 2022 16:49:14 -0400 Subject: [PATCH 3/3] cons: Minor change in output info --- mgr/ConsDefs.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgr/ConsDefs.pm b/mgr/ConsDefs.pm index 910f967cabd..9fa3f90fdd7 100644 --- a/mgr/ConsDefs.pm +++ b/mgr/ConsDefs.pm @@ -1084,7 +1084,7 @@ } if ( ! $param::quiet ){ if ( $XMLLIBDIR ){ - print "Use xml $xml XMLLIBDIR = $XMLLIBDIR \tXMLINCDIR = $XMLINCDIR \tXMLLIBS = $XMLLIBS XMLCPPFlag =$XMLCPPFlag\n"; + print "Using $xml\n\tXMLLIBDIR = $XMLLIBDIR\n\tXMLINCDIR = $XMLINCDIR\n\tXMLLIBS = $XMLLIBS\n\tXMLCPPFlag = $XMLCPPFlag\n" if !$param::quiet; } else { print "Use xml -> WARNING ** Could not define XMLLIBDIR, XMLINCDIR, XMLLIBS\n"; }