2023-02-17 Bruno Haible <bruno@clisp.org>
- Improve cross-compilation from midipix.
+ Improve cross-compilation for midipix.
+ Reported by Ørjan Malde <red@foxi.me> at
+ <https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00131.html>.
+ This patch handles the cases where midipix acts like Linux.
+ * m4/chmod.m4 (gl_FUNC_CHMOD): Treat midipix like Linux with glibc or
+ musl libc.
+ * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise.
+ * m4/fchdir.m4 (gl_FUNC_FCHDIR): Likewise.
+ * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise.
+ * m4/link.m4 (gl_FUNC_LINK): Likewise.
+ * m4/linkat.m4 (gl_FUNC_LINKAT): Likewise.
+ * m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise.
+ * m4/mkdir.m4 (gl_FUNC_MKDIR): Likewise.
+ * m4/pselect.m4 (gl_FUNC_PSELECT): Likewise.
+ * m4/ptsname.m4 (gl_FUNC_PTSNAME): Likewise.
+ * m4/readlink.m4 (gl_FUNC_READLINK): Likewise.
+ * m4/rename.m4 (gl_FUNC_RENAME): Likewise.
+ * m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
+ * m4/select.m4 (gl_FUNC_SELECT): Likewise.
+ * m4/sleep.m4 (gl_FUNC_SLEEP): Likewise.
+ * m4/stat.m4 (gl_FUNC_STAT): Likewise.
+ * m4/symlink.m4 (gl_FUNC_SYMLINK): Likewise.
+ * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise.
+ * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
+ * m4/usleep.m4 (gl_FUNC_USLEEP): Likewise.
+
+ Improve cross-compilation for midipix.
Reported by Ørjan Malde <red@foxi.me> at
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00131.html>.
Since midipix consists of musl libc based on an emulation of Linux system
-# chmod.m4 serial 1
+# chmod.m4 serial 2
dnl Copyright (C) 2004-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
# Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, OpenBSD, Solaris, Haiku, Cygwin.
*-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | solaris* | haiku* | cygwin*)
gl_cv_func_chmod_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*)
+ gl_cv_func_chmod_works="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
*)
gl_cv_func_chmod_works="$gl_cross_guess_normal" ;;
-# serial 20
+# serial 21
dnl From Jim Meyering.
dnl
linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
# Guess yes on musl systems with Linux kernel.
linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
-# fchdir.m4 serial 27
+# fchdir.m4 serial 28
dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_open_directory_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
# Guess no on native Windows.
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert.
-# serial 19
+# serial 20
AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
*-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
# Guess yes on musl systems.
*-musl*) gl_cv_func_getcwd_null="guessing yes";;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_getcwd_null="guessing yes";;
# Guess yes on Cygwin.
cygwin*) gl_cv_func_getcwd_null="guessing yes";;
# If we don't know, obey --enable-cross-guesses.
-# link.m4 serial 11
+# link.m4 serial 12
dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_link_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_link_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_link_works="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
-# serial 16
+# serial 17
# See if we need to provide linkat replacement.
dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_linkat_slash="guessing yes";;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_linkat_slash="guessing yes";;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_linkat_slash="guessing yes";;
# If we don't know, obey --enable-cross-guesses.
-# serial 33
+# serial 34
# Copyright (C) 1997-2001, 2003-2023 Free Software Foundation, Inc.
#
linux-* | linux)
# Guess yes on Linux systems.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ midipix*)
+ # Guess yes on systems that emulate the Linux system calls.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
*-gnu* | gnu*)
# Guess yes on glibc systems.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
-# serial 17
+# serial 18
# Copyright (C) 2001, 2003-2004, 2006, 2008-2023 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
# Guess yes on MSVC, no on mingw.
*-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
-# pselect.m4 serial 10
+# pselect.m4 serial 11
dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
-# ptsname.m4 serial 8
+# ptsname.m4 serial 9
dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
*-gnu* | gnu*) gl_cv_func_ptsname_sets_errno="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_ptsname_sets_errno="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_ptsname_sets_errno="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_ptsname_sets_errno="$gl_cross_guess_normal" ;;
esac
-# readlink.m4 serial 16
+# readlink.m4 serial 17
dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
# Guess yes on Linux or glibc systems.
linux-* | linux | *-gnu* | gnu*)
gl_cv_func_readlink_trailing_slash="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*)
+ gl_cv_func_readlink_trailing_slash="guessing yes" ;;
# Guess no on AIX or HP-UX.
aix* | hpux*)
gl_cv_func_readlink_trailing_slash="guessing no" ;;
# Guess yes on Linux or glibc systems.
linux-* | linux | *-gnu* | gnu*)
gl_cv_func_readlink_truncate="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*)
+ gl_cv_func_readlink_truncate="guessing yes" ;;
# Guess no on AIX or HP-UX.
aix* | hpux*)
gl_cv_func_readlink_truncate="guessing no" ;;
-# serial 33
+# serial 34
# Copyright (C) 2001, 2003, 2005-2006, 2009-2023 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
# Guess no on native Windows.
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
# Guess yes on native Windows.
case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_rename_link_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
# Guess yes on native Windows.
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_rmdir_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
# Guess no on native Windows.
-# select.m4 serial 14
+# select.m4 serial 15
dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
-# sleep.m4 serial 11
+# sleep.m4 serial 12
dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
*-gnu* | gnu*) gl_cv_func_sleep_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_sleep_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_sleep_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_sleep_works="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
-# serial 18
+# serial 19
# Copyright (C) 2009-2023 Free Software Foundation, Inc.
#
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_stat_file_slash="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
-# serial 9
+# serial 10
# See if we need to provide symlink replacement.
dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_symlink_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_symlink_works="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
-# serial 12
+# serial 13
# See if we need to provide symlinkat replacement.
dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_symlinkat_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_symlinkat_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_symlinkat_works="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
-# unlink.m4 serial 15
+# unlink.m4 serial 16
dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
# Guess no on native Windows.
-# usleep.m4 serial 7
+# usleep.m4 serial 8
dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
*-gnu* | gnu*) gl_cv_func_usleep_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_usleep_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_usleep_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_usleep_works="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.