]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
build: fix detection of readdir_r() and dirfd() in configure.ac
authorMartin Matuska <martin@matuska.org>
Thu, 10 Mar 2022 10:00:26 +0000 (11:00 +0100)
committerMartin Matuska <martin@matuska.org>
Thu, 10 Mar 2022 10:00:26 +0000 (11:00 +0100)
Fixes #1537

configure.ac

index 05aa0407b678cf30d95e99d2e80f0b45bb204f53..2c9e1f957e116fe6226d64014eee47498ddcbfd0 100644 (file)
@@ -715,14 +715,14 @@ AC_CHECK_TYPES(struct statfs,,,
 
 # There are several variants of readdir_r around; we only
 # accept the POSIX-compliant version.
-AC_COMPILE_IFELSE(
+AC_LINK_IFELSE(
  [AC_LANG_PROGRAM([[#include <dirent.h>]],
                   [[DIR *dir; struct dirent e, *r;
                    return(readdir_r(dir, &e, &r));]])],
  [AC_DEFINE(HAVE_READDIR_R,1,[Define to 1 if you have a POSIX compatible readdir_r])]
 )
 # dirfd can be either a function or a macro.
-AC_COMPILE_IFELSE(
+AC_LINK_IFELSE(
  [AC_LANG_PROGRAM([[#include <dirent.h>
                     DIR *dir;]],
                   [[return(dirfd(dir));]])],