Alpine’s <sys/cdefs.h> is a stub that issues a deprecation #warning.
* m4/getopt.m4 (gl_GETOPT_SUBSTITUTE_HEADER):
* m4/sched_h.m4 (gl_SCHED_H): Use the new macro
gl_CHECK_HEADER_SYS_CDEFS_H instead of checking independently.
* m4/sys_cdefs_h.m4: New file.
* modules/getopt-posix, modules/sched (Files): Add m4/sys_cdefs_h.m4.
+2024-05-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ getopt-posix: port better to Alpine 3.20.0_rc1
+ Alpine’s <sys/cdefs.h> is a stub that issues a deprecation #warning.
+ * m4/getopt.m4 (gl_GETOPT_SUBSTITUTE_HEADER):
+ * m4/sched_h.m4 (gl_SCHED_H): Use the new macro
+ gl_CHECK_HEADER_SYS_CDEFS_H instead of checking independently.
+ * m4/sys_cdefs_h.m4: New file.
+ * modules/getopt-posix, modules/sched (Files): Add m4/sys_cdefs_h.m4.
+
2024-05-20 Collin Funk <collin.funk1@gmail.com>
utimensat, utimens: Work around NetBSD 10.0 bugs.
-# getopt.m4 serial 48
-dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
+# getopt.m4 serial 48.1
+dnl Copyright (C) 2002-2006, 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
[
- AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
- if test $ac_cv_header_sys_cdefs_h = yes; then
- HAVE_SYS_CDEFS_H=1
- else
- HAVE_SYS_CDEFS_H=0
- fi
- AC_SUBST([HAVE_SYS_CDEFS_H])
-
+ gl_CHECK_HEADER_SYS_CDEFS_H
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
[Define to rpl_ if the getopt replacement functions and variables
should be used.])
-# sched_h.m4 serial 15
-dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+# sched_h.m4 serial 16
+dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
+ AC_REQUIRE([gl_CHECK_HEADER_SYS_CDEFS_H])
+
AC_CHECK_HEADERS([sched.h], [], [],
[[#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
fi
AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
- if test "$ac_cv_header_sys_cdefs_h" = yes; then
- HAVE_SYS_CDEFS_H=1
- else
- HAVE_SYS_CDEFS_H=0
- fi
- AC_SUBST([HAVE_SYS_CDEFS_H])
-
dnl Ensure the type pid_t gets defined.
AC_REQUIRE([AC_TYPE_PID_T])
--- /dev/null
+# sys_cdefs_h.m4 - Is <sys/cdefs.h> compatible enough with glibc?
+# serial 2
+dnl Copyright 2024 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN_ONCE([gl_CHECK_HEADER_SYS_CDEFS_H],
+ [AC_CACHE_CHECK([for glibc-compatible sys/cdefs.h],
+ [gl_cv_header_sys_cdefs_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_DEFINES_PROVIDED
+ [#include <sys/cdefs.h>
+ enum { foo = __GNUC_PREREQ (14, 1) } bar;
+ ]],
+ [gl_cv_header_sys_cdefs_h=yes],
+ [gl_cv_header_sys_cdefs_h=no])])
+ if test "$gl_cv_header_sys_cdefs_h" = yes; then
+ HAVE_SYS_CDEFS_H=1
+ else
+ HAVE_SYS_CDEFS_H=0
+ fi
+ AC_SUBST([HAVE_SYS_CDEFS_H])])
lib/getopt-pfx-ext.h
lib/getopt_int.h
m4/getopt.m4
+m4/sys_cdefs_h.m4
Depends-on:
unistd
lib/sched.in.h
m4/sched_h.m4
m4/pid_t.m4
+m4/sys_cdefs_h.m4
Depends-on:
gen-header