bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: bug-gnulib@gnu.org
Subject: Follow up to last post
Date: Wed, 18 Jan 2023 21:53:18 +0800	[thread overview]
Message-ID: <87o7qw6jap.fsf@yahoo.com> (raw)
In-Reply-To: 87o7qw6jap.fsf.ref@yahoo.com

Okay, the problem seems to be a little more involved than I initially
thought.

Apparently, it is not ok to use gl_CHECK_FUNCS_ANDROID without removing
utimensat from AC_CHECK_FUNCS_ONCE, because the latter will define
HAVE_UTIMENSAT, leading to a build failure later (I only found this
after running `make maintainer-clean' in lib.)

diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index f4384027e37..dd799ae27db 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -50,6 +50,7 @@ AC_DEFUN_ONCE
     group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
     readlink readlinkat rmdir sethostname sleep symlink symlinkat
     truncate ttyname_r unlink unlinkat usleep])
+  gl_CHECK_FUNCS_ANDROID([ftruncate], [[#include <unistd.h>]])
 
   AC_REQUIRE([AC_C_RESTRICT])
 
diff --git a/m4/utimens.m4 b/m4/utimens.m4
index c5d9b69e6f5..2b87f0149b5 100644
--- a/m4/utimens.m4
+++ b/m4/utimens.m4
@@ -11,7 +11,8 @@ AC_DEFUN
   AC_REQUIRE([gl_FUNC_UTIMES])
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CHECK_FUNCS_ONCE([futimens utimensat lutimes])
+  AC_CHECK_FUNCS_ONCE([futimens lutimes])
+  gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]])
   gl_CHECK_FUNCS_ANDROID([futimes], [[#include <sys/time.h>]])
   gl_CHECK_FUNCS_ANDROID([futimesat], [[#include <sys/time.h>]])
 
diff --git a/m4/utimensat.m4 b/m4/utimensat.m4
index dd210fc989a..8edea60bd10 100644
--- a/m4/utimensat.m4
+++ b/m4/utimensat.m4
@@ -13,9 +13,12 @@ AC_DEFUN
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CHECK_FUNCS_ONCE([utimensat])
+  # This is necessary for cross-compiles, because otherwise utimensat
+  # will appear to work.
+  gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]])
   if test $ac_cv_func_utimensat = no; then
     HAVE_UTIMENSAT=0
+    REPLACE_UTIMENSAT=1
   else
     AC_CACHE_CHECK([whether utimensat works],
       [gl_cv_func_utimensat_works],


       reply	other threads:[~2023-01-18 13:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87o7qw6jap.fsf.ref@yahoo.com>
2023-01-18 13:53 ` Po Lu [this message]
2023-01-18 22:18   ` Follow up to last post Paul Eggert
2023-01-18 23:23     ` API levels and functions on Android Bruno Haible
2023-01-19  4:24       ` Paul Eggert
2023-01-19 10:27         ` Bruno Haible
2023-01-19  0:44     ` Follow up to last post Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7qw6jap.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).