From: Zeun <95558717+ZeunO8@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:53:13 +0000 (+1300) Subject: Fix -Werror=warning error and wrap some INSTALL directives with an ENABLE_INSTALL... X-Git-Tag: v3.8.0~95 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ebca5ff8312ea15c470067969e43d452e2dceeb;p=thirdparty%2Flibarchive.git Fix -Werror=warning error and wrap some INSTALL directives with an ENABLE_INSTALL guard (#2397) 1. Fixes build when compiling without ZLIB/BZIP/LZMA `char finishing` 2. All INSTALL directives are now guarded by ENABLE_INSTALL --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fd47412f..036aab30c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -378,10 +378,12 @@ ENDMACRO (GENERATE_LIST_H) # Generate installation rules for man pages. # MACRO (INSTALL_MAN __mans) - FOREACH (_man ${ARGV}) - STRING(REGEX REPLACE "^.+[.]([1-9])" "\\1" _mansect ${_man}) - INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}") - ENDFOREACH (_man) + IF(ENABLE_INSTALL) + FOREACH (_man ${ARGV}) + STRING(REGEX REPLACE "^.+[.]([1-9])" "\\1" _mansect ${_man}) + INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}") + ENDFOREACH (_man) + ENDIF(ENABLE_INSTALL) ENDMACRO (INSTALL_MAN __mans) # # Find out what macro is needed to use libraries on Windows. @@ -2176,7 +2178,7 @@ INCLUDE(CreatePkgConfigFile) # # Register installation of PDF documents. # -IF(WIN32 AND NOT CYGWIN) +IF(WIN32 AND NOT CYGWIN AND ENABLE_INSTALL) # # On Windows platform, It's better that we install PDF documents # on one's computer. @@ -2188,7 +2190,7 @@ IF(WIN32 AND NOT CYGWIN) FILES_MATCHING PATTERN "*.pdf" ) ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doc/pdf) -ENDIF(WIN32 AND NOT CYGWIN) +ENDIF(WIN32 AND NOT CYGWIN AND ENABLE_INSTALL) # # # diff --git a/cat/CMakeLists.txt b/cat/CMakeLists.txt index 8660aefb0..d534980b9 100644 --- a/cat/CMakeLists.txt +++ b/cat/CMakeLists.txt @@ -33,8 +33,10 @@ IF(ENABLE_CAT) ENDIF(ENABLE_CAT_SHARED) # Installation rules - INSTALL(TARGETS bsdcat RUNTIME DESTINATION bin) - INSTALL_MAN(${bsdcat_MANS}) + IF(ENABLE_INSTALL) + INSTALL(TARGETS bsdcat RUNTIME DESTINATION bin) + INSTALL_MAN(${bsdcat_MANS}) + ENDIF(ENABLE_INSTALL) ENDIF(ENABLE_CAT) add_subdirectory(test) diff --git a/cpio/CMakeLists.txt b/cpio/CMakeLists.txt index f867bdf95..2fee053bd 100644 --- a/cpio/CMakeLists.txt +++ b/cpio/CMakeLists.txt @@ -42,8 +42,10 @@ IF(ENABLE_CPIO) ENDIF(ENABLE_CPIO_SHARED) # Installation rules - INSTALL(TARGETS bsdcpio RUNTIME DESTINATION bin) - INSTALL_MAN(${bsdcpio_MANS}) + IF(ENABLE_INSTALL) + INSTALL(TARGETS bsdcpio RUNTIME DESTINATION bin) + INSTALL_MAN(${bsdcpio_MANS}) + ENDIF(ENABLE_INSTALL) ENDIF(ENABLE_CPIO) diff --git a/libarchive/archive_write_set_format_zip.c b/libarchive/archive_write_set_format_zip.c index b835695a5..eaa1362a4 100644 --- a/libarchive/archive_write_set_format_zip.c +++ b/libarchive/archive_write_set_format_zip.c @@ -1822,7 +1822,9 @@ archive_write_zip_finish_entry(struct archive_write *a) { struct zip *zip = a->format_data; int ret; +#if defined(HAVE_BZLIB_H) || (defined(HAVE_ZSTD_H) && HAVE_ZSTD_compressStream) || HAVE_LZMA_H char finishing; +#endif switch (zip->entry_compression) { #ifdef HAVE_ZLIB_H diff --git a/tar/CMakeLists.txt b/tar/CMakeLists.txt index a5b83454a..b09426945 100644 --- a/tar/CMakeLists.txt +++ b/tar/CMakeLists.txt @@ -46,8 +46,10 @@ IF(ENABLE_TAR) ENDIF(ENABLE_TAR_SHARED) # Installation rules - INSTALL(TARGETS bsdtar RUNTIME DESTINATION bin) - INSTALL_MAN(${bsdtar_MANS}) + IF(ENABLE_INSTALL) + INSTALL(TARGETS bsdtar RUNTIME DESTINATION bin) + INSTALL_MAN(${bsdtar_MANS}) + ENDIF(ENABLE_INSTALL) ENDIF(ENABLE_TAR) add_subdirectory(test) diff --git a/unzip/CMakeLists.txt b/unzip/CMakeLists.txt index d229507a3..586245b67 100644 --- a/unzip/CMakeLists.txt +++ b/unzip/CMakeLists.txt @@ -38,8 +38,10 @@ IF(ENABLE_UNZIP) ENDIF(ENABLE_UNZIP_SHARED) # Installation rules - INSTALL(TARGETS bsdunzip RUNTIME DESTINATION bin) - INSTALL_MAN(${bsdunzip_MANS}) + IF(ENABLE_INSTALL) + INSTALL(TARGETS bsdunzip RUNTIME DESTINATION bin) + INSTALL_MAN(${bsdunzip_MANS}) + ENDIF(ENABLE_INSTALL) ENDIF(ENABLE_UNZIP) add_subdirectory(test)