From 04c620c3541dcb3abc1628952b9ec704ef169e3d Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Mon, 10 Apr 2023 22:36:58 +0100 Subject: [PATCH] Upgrade log4cpp to 1.1.4rc3 to address ARM64 compatibility --- src/CMakeLists.txt | 2 +- .../install_fastnetmon_dependencies.pl | 5 ++-- src/scripts/perllib/Fastnetmon.pm | 29 ++++++++----------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e3e3e83..521997a0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,7 +23,7 @@ set (FASTNETMON_VERSION_MINOR 2) set (FASTNETMON_VERSION_PATCH 5) set(HIREDIS_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/hiredis_0_14") -set(LOG4CPP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/log4cpp_1_1_3") +set(LOG4CPP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/log4cpp_1_1_4") # set(LIBPCAP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/pcap_1.7.4") set(MONGO_C_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/mongo_c_driver_1_23_0") set(CAPNP_CUSTOM_INSTALL_PATH "${FASTNETMON_LIBRARIES_GLOBAL_PATH}/capnproto_0_8_0") diff --git a/src/scripts/install_fastnetmon_dependencies.pl b/src/scripts/install_fastnetmon_dependencies.pl index fdee6009..d9b5b347 100755 --- a/src/scripts/install_fastnetmon_dependencies.pl +++ b/src/scripts/install_fastnetmon_dependencies.pl @@ -109,7 +109,7 @@ sub main { 'cppkafka_0_3_1', 'gobgp_3_12_0', - 'log4cpp_1_1_3', + 'log4cpp_1_1_4', 'gtest_1_13_0' ); @@ -423,7 +423,8 @@ sub main { 'ubuntu:22.04' => 'b3f2168c6b705804155ca944a6c7850057d50652efc57c3c4194838b147176779b98d7b2bf9af72ee141805d62f7a6c1460244ce60b570dbdffc114d5e7dc899', 'ubuntu:aarch64:22.04'=> '4e9114ed4c9fde74517f04fc8b79b44854ee5fc8b51b99816ad60dccbc61a682993c4321a0df6920a40164281ba24d171f9d4972e54a9f3015d993caf7d03c47', }, - 'log4cpp_1_1_3' => { + # It's actually 1_1_4rc3 but we use only minor and major numbers + 'log4cpp_1_1_4' => { 'centos:7' => '5f314177ff82f9b822c76a0256a322e1b8c81575d9b3da33f45532f0942f5358c7588cf1b88a88f8ed99c433c97a3f2fbf59a949eb32a7335c5a8d3a59895a65', 'centos:8' => 'a5e2068788957b9b14042e3ea9cc1aecb4c7910bea770e270d2a21392a7569004bda74546d7025c95f937de6368b705848c151386a765c55f3fa14ef511b67d2', 'centos:9' => '052457ac03a5640e4d51e93f47b83d5990663f0629633c956466bf156fa9bf63052700d4d2c5aae44bc5022dd9b93ef65d2dd1176a675e3dd61a6e960afa58e7', diff --git a/src/scripts/perllib/Fastnetmon.pm b/src/scripts/perllib/Fastnetmon.pm index df53c21a..721eb7fb 100644 --- a/src/scripts/perllib/Fastnetmon.pm +++ b/src/scripts/perllib/Fastnetmon.pm @@ -727,7 +727,7 @@ sub install_boost_build { sub install_log4cpp { my $folder_name = shift; - my $log_cpp_version_short = '1.1.3'; + my $log_cpp_version_short = '1.1.4rc3'; my $log4cpp_install_path = "$library_install_folder/$folder_name"; @@ -737,7 +737,7 @@ sub install_log4cpp { chdir $temp_folder_for_building_project; print "Download log4cpp sources\n"; - my $log4cpp_download_result = download_file($log4cpp_url, $distro_file_name, '74f0fea7931dc1bc4e5cd34a6318cd2a51322041'); + my $log4cpp_download_result = download_file($log4cpp_url, $distro_file_name, 'b32e6ec981a5d75864e1097525e1f502cc242d17'); unless ($log4cpp_download_result) { warn "Can't download log4cpp\n"; @@ -748,29 +748,24 @@ sub install_log4cpp { exec_command("tar -xf $distro_file_name"); chdir "$temp_folder_for_building_project/log4cpp"; - if ($distro_architecture eq 'aarch64') { - # TODO: unfortunately, I removed these files and we need to switch to master build: https://git.code.sf.net/p/log4cpp/codegit - # commit: 2e117d81e94ec4f9c5af42fcf76a0583a036e106 - # For arm64 build we need multiple fixes - # checking build system type... config/config.guess: unable to guess system type - # configure: error: cannot guess build type; you must specify one - exec_command("curl https://raw.githubusercontent.com/pavel-odintsov/config/master/config.guess -o./config/config.guess"); - exec_command("curl https://raw.githubusercontent.com/pavel-odintsov/config/master/config.sub -o./config/config.sub"); - } - print "Build log4cpp\n"; - # TODO: we need some more reliable way to specify options here + my $configure_result = ''; + if ($configure_options) { - exec_command("$configure_options ./configure --prefix=$log4cpp_install_path"); + $configure_result = exec_command("$configure_options ./configure --prefix=$log4cpp_install_path"); } else { - exec_command("./configure --prefix=$log4cpp_install_path"); - } + $configure_result = exec_command("./configure --prefix=$log4cpp_install_path"); + } + + if (!$configure_result) { + die "Cannot configure log4cpp\n"; + } my $make_result = exec_command("$ld_library_path_for_make make $make_options install"); if (!$make_result) { - print "make for log4cpp failed\n"; + die "Make for log4cpp failed\n"; } 1;