]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Build: Check for dirent.h.
authorJia Tan <jiat0218@gmail.com>
Wed, 1 Nov 2023 06:39:36 +0000 (14:39 +0800)
committerJia Tan <jiat0218@gmail.com>
Mon, 29 Jan 2024 13:40:53 +0000 (21:40 +0800)
For both CMake and Autotools, define HAVE_DIRENT_H if the header file
is found.

CMakeLists.txt
configure.ac

index c5573d7b32a07604d5d41044098df09d50c7d49d..e0221eabfdaaf0d9c15bc83233553521e968fbcd 100644 (file)
@@ -1006,6 +1006,15 @@ calculation if supported by the system" ON)
     endif()
 endif()
 
+# MSVC shouldn't have this header file anyway but this won't waste time
+# checking.
+if(NOT MSVC)
+    # dirent.h
+    check_include_file(dirent.h HAVE_DIRENT_H)
+    tuklib_add_definition_if(liblzma HAVE_DIRENT_H)
+endif()
+
+
 # Support -fvisiblity=hidden when building shared liblzma.
 # These lines do nothing on Windows (even under Cygwin).
 # HAVE_VISIBILITY should always be defined to 0 or 1.
index bb2697f6d2e3b7ac51883a6f5e8fb20fdb3f3464..3b8db6c39f5007ada88e6172321c3e503d1f1dd6 100644 (file)
@@ -793,6 +793,8 @@ AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
 # cpuid.h may be used for detecting x86 processor features at runtime.
 AC_CHECK_HEADERS([immintrin.h cpuid.h])
 
+# dirent.h allows for directory parsing in xz.
+AC_CHECK_HEADERS([dirent.h])
 
 ###############################################################################
 # Checks for typedefs, structures, and compiler characteristics.