Skip to content

Commit bd9ca8e

Browse files
authored
cons: Use pkg-config to set up external dependency on log4cxx (star-bnl#405)
When we configure the build with log4cxx as external dependency we can rely on pkg-config found in PATH This is similar to star-bnl#357 where we also use config utilities to set up fastjet and gsl packages, star-bnl#402 for mysql, and star-bnl#404 for xml2
1 parent 05ac703 commit bd9ca8e

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

mgr/ConsDefs.pm

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -959,18 +959,19 @@
959959
}
960960

961961
# Logger
962-
$LoggerDir = $MYSTAR . "/include/log4cxx";
963-
964-
if (-d $LoggerDir) {
965-
$LoggerINCDIR = $MYSTAR . "/include";
966-
$LoggerLIBDIR = $MYSTAR . "/lib";
967-
$LoggerLIBS = "-llog4cxx";
968-
print
969-
"Use Logger ",
970-
"LIBDIR = $LoggerLIBDIR \tLoggerINCDIR = $LoggerINCDIR \tLoggerLIBS = $LoggerLIBS\n"
971-
if $LoggerLIBDIR && ! $param::quiet;
962+
chomp($LoggerDir = `pkg-config --variable=prefix liblog4cxx`);
963+
$LoggerDir = $MYSTAR unless $LoggerDir;
964+
965+
if (not -d $LoggerDir."/include/log4cxx") {
966+
die "No log4cxx found\n";
972967
}
973968

969+
$LoggerINCDIR = $LoggerDir . "/include";
970+
$LoggerLIBDIR = $LoggerDir . "/lib";
971+
$LoggerLIBS = "-llog4cxx";
972+
973+
print "Using $LoggerDir\n\tLoggerLIBDIR = $LoggerLIBDIR\n\tLoggerINCDIR = $LoggerINCDIR\n\tLoggerLIBS = $LoggerLIBS\n" unless $param::quiet;
974+
974975
# xml2
975976
chomp(my $xml = `which xml2-config`);
976977

0 commit comments

Comments
 (0)