From efe89784fcd8c12be4bb8126ec66f2dfcae74574 Mon Sep 17 00:00:00 2001 From: Aditya Vidyadhar Kamath Date: Tue, 8 Oct 2024 07:01:09 -0500 Subject: [PATCH] Build system improvements to support AIX Closes #1383 --- CMakeLists.txt | 2 ++ libclamav/CMakeLists.txt | 2 +- libclamunrar/CMakeLists.txt | 2 +- libclamunrar_iface/CMakeLists.txt | 2 +- libfreshclam/CMakeLists.txt | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 56ebe71aab..b5e84655f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(C_LINUX 1) elseif(APPLE OR CMAKE_SYSTEM_NAME MATCHES "BSD") set(C_BSD 1) +elseif(CMAKE_SYSTEM_NAME MATCHES "AIX") + set(AIX TRUE) endif() # Git optionally used to add commit info into build to differentiate in bug reports. diff --git a/libclamav/CMakeLists.txt b/libclamav/CMakeLists.txt index ef619a6223..ca8578a236 100644 --- a/libclamav/CMakeLists.txt +++ b/libclamav/CMakeLists.txt @@ -474,7 +474,7 @@ if(ENABLE_SHARED_LIB) else() target_link_libraries( clamav PUBLIC Iconv::Iconv ) endif() - if(UNIX AND NOT APPLE) + if(UNIX AND NOT APPLE AND NOT AIX) target_link_options( clamav PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libclamav.map") endif() if(WIN32) diff --git a/libclamunrar/CMakeLists.txt b/libclamunrar/CMakeLists.txt index 2500a42fa9..e39273ef1c 100644 --- a/libclamunrar/CMakeLists.txt +++ b/libclamunrar/CMakeLists.txt @@ -97,7 +97,7 @@ if(ENABLE_SHARED_LIB) if(WIN32) set_target_properties(clamunrar PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) - elseif(UNIX AND NOT APPLE) + elseif(UNIX AND NOT APPLE AND NOT AIX) target_link_options(clamunrar PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libclamunrar.map") endif() diff --git a/libclamunrar_iface/CMakeLists.txt b/libclamunrar_iface/CMakeLists.txt index f2f68fa0a7..03c35f6684 100644 --- a/libclamunrar_iface/CMakeLists.txt +++ b/libclamunrar_iface/CMakeLists.txt @@ -64,7 +64,7 @@ if(ENABLE_UNRAR) if(WIN32) set_target_properties(clamunrar_iface PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) - elseif(UNIX AND NOT APPLE) + elseif(UNIX AND NOT APPLE AND NOT AIX) target_link_options(clamunrar_iface PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libclamunrar_iface.map") endif() diff --git a/libfreshclam/CMakeLists.txt b/libfreshclam/CMakeLists.txt index 284ae14b2d..ae09880aec 100644 --- a/libfreshclam/CMakeLists.txt +++ b/libfreshclam/CMakeLists.txt @@ -52,7 +52,7 @@ if(ENABLE_SHARED_LIB) target_link_libraries( freshclam PUBLIC network ) - elseif(UNIX) + elseif(UNIX AND NOT AIX) if(HAVE_RESOLV_H AND NOT C_BSD) # BSD appears to have libresolv inside libc target_link_libraries( freshclam PUBLIC @@ -62,7 +62,7 @@ if(ENABLE_SHARED_LIB) if(WIN32) set_target_properties(freshclam PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) - elseif(UNIX AND NOT APPLE) + elseif(UNIX AND NOT APPLE AND NOT AIX) target_link_options(freshclam PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libfreshclam.map") endif() set_target_properties(freshclam PROPERTIES