summary refs log tree commit diff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2021-05-26 13:49:39 +0800
committerJune McEnroe <june@causal.agency>2022-01-02 20:19:11 -0500
commit6bb684ff16ac5451e9ded6e8fd43654f77887df7 (patch)
tree4a0eee2257d915e45cc04bcd7f71771c9dd35135
parentAdd The City in the Middle of the Night (diff)
downloadsrc-6bb684ff16ac5451e9ded6e8fd43654f77887df7.tar.gz
src-6bb684ff16ac5451e9ded6e8fd43654f77887df7.zip
Call CHECK_DECL on stat64
On macOS it is possible to find stat64 at link-time but not at
compile-time.  To make the build process more robust we should
check for the header file as well as the library.

Reported-by: Saagar Jha <saagar@saagarjha.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--bin/dash/configure.ac5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/dash/configure.ac b/bin/dash/configure.ac
index dc96b748..a395536b 100644
--- a/bin/dash/configure.ac
+++ b/bin/dash/configure.ac
@@ -140,11 +140,12 @@ if test "$ac_cv_func_signal" != yes; then
 fi
 
 dnl Check for stat64 (dietlibc/klibc).
-AC_CHECK_FUNC(stat64,, [
+AC_CHECK_DECL(stat64, AC_CHECK_FUNC(stat64))
+if test "$ac_cv_func_stat64" != yes; then
 	AC_DEFINE(fstat64, fstat, [64-bit operations are the same as 32-bit])
 	AC_DEFINE(lstat64, lstat, [64-bit operations are the same as 32-bit])
 	AC_DEFINE(stat64, stat, [64-bit operations are the same as 32-bit])
-])
+fi
 
 dnl OS X apparently has stat64 but not open64.
 AC_CHECK_FUNC(open64,, [