* modules/extensions (configure.ac-early): New section.
* m4/extensions-aix.m4: New file.
* modules/extensions-aix: New file.
* m4/errno_h.m4 (gl_HEADER_ERRNO_H): Require gl_USE_AIX_EXTENSIONS,
instead of defining _LINUX_SOURCE_COMPAT at this stage.
* m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Likewise.
* m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Likewise.
* m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Likewise.
* m4/scandir.m4 (gl_FUNC_SCANDIR): Likewise.
* modules/errno (Depends-on): Add extensions-aix.
* modules/malloc-gnu (Depends-on): Likewise.
* modules/calloc-gnu (Depends-on): Likewise.
* modules/realloc-gnu (Depends-on): Likewise.
* modules/scandir (Depends-on): Likewise.
+2024-08-01 Bruno Haible <bruno@clisp.org>
+
+ Ensure consistent effects of _LINUX_SOURCE_COMPAT.
+ * modules/extensions (configure.ac-early): New section.
+ * m4/extensions-aix.m4: New file.
+ * modules/extensions-aix: New file.
+ * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Require gl_USE_AIX_EXTENSIONS,
+ instead of defining _LINUX_SOURCE_COMPAT at this stage.
+ * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Likewise.
+ * m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Likewise.
+ * m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Likewise.
+ * m4/scandir.m4 (gl_FUNC_SCANDIR): Likewise.
+ * modules/errno (Depends-on): Add extensions-aix.
+ * modules/malloc-gnu (Depends-on): Likewise.
+ * modules/calloc-gnu (Depends-on): Likewise.
+ * modules/realloc-gnu (Depends-on): Likewise.
+ * modules/scandir (Depends-on): Likewise.
+
2024-08-01 Bruno Haible <bruno@clisp.org>
strerror_r: Fix for AIX (regression yesterday).
# calloc.m4
-# serial 32
+# serial 33
dnl Copyright (C) 2004-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,
AC_REQUIRE([gl_FUNC_CALLOC_POSIX])
dnl This helps if !(__VEC__ || __AIXVEC), and shouldn't hurt otherwise.
- AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
- [Define so that AIX headers are more compatible with GNU/Linux.])
+ AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
REPLACE_CALLOC_FOR_CALLOC_GNU="$REPLACE_CALLOC_FOR_CALLOC_POSIX"
if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 0; then
# errno_h.m4
-# serial 15
+# serial 16
dnl Copyright (C) 2004, 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,
AC_REQUIRE([AC_PROG_CC])
dnl Persuade AIX 7.3 errno.h to make EEXIST != ENOTEMPTY.
- AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
- [Define so that AIX headers are more compatible with GNU/Linux.])
+ AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
AC_EGREP_CPP([booboo],[
--- /dev/null
+# extensions-aix.m4
+# serial 1
+dnl Copyright (C) 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.
+
+# On AIX, most extensions are already enabled through the _ALL_SOURCE macro,
+# defined by gl_USE_SYSTEM_EXTENSIONS. gl_USE_AIX_EXTENSIONS additionally
+# activates more GNU and Linux-like behaviours, affecting
+# - the time_t type,
+# - errno values in <errno.h>: ENOTEMPTY
+# - functions in <stdlib.h>: malloc calloc realloc valloc
+# <https://www.ibm.com/docs/en/aix/7.3?topic=m-malloc-free-realloc-calloc-mallopt-mallinfo-mallinfo-heap-alloca-valloc-posix-memalign-subroutine>
+# - functions in <string.h>: strerror_r (returns 'char *', like glibc)
+# - functions in <dirent.h>: scandir, alphasort, readdir_r
+# - functions in <netdb.h>: gethostbyname_r gethostbyaddr_r
+# - declarations in <unistd.h>: sbrk
+# and a couple of secondary <sys/*> header files.
+
+AC_DEFUN_ONCE([gl_USE_AIX_EXTENSIONS],
+[
+ AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
+ [Define so that AIX headers are more compatible with GNU/Linux.])
+])
# malloc.m4
-# serial 32
+# serial 33
dnl Copyright (C) 2007, 2009-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,
AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
dnl This helps if !(__VEC__ || __AIXVEC), and shouldn't hurt otherwise.
- AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
- [Define so that AIX headers are more compatible with GNU/Linux.])
+ AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX"
if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then
# realloc.m4
-# serial 30
+# serial 31
dnl Copyright (C) 2007, 2009-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,
AC_REQUIRE([gl_FUNC_REALLOC_POSIX])
dnl This helps if !(__VEC__ || __AIXVEC), and shouldn't hurt otherwise.
- AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
- [Define so that AIX headers are more compatible with GNU/Linux.])
+ AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then
_AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC_FOR_REALLOC_GNU=1])
# scandir.m4
-# serial 3
+# serial 4
dnl Copyright (C) 2009-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 Persuade glibc and Solaris <dirent.h> to declare scandir().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
- [Define so that AIX headers are more compatible with GNU/Linux.])
+ AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
AC_CHECK_FUNCS([scandir])
if test $ac_cv_func_scandir = no; then
Depends-on:
calloc-posix
+extensions-aix
xalloc-oversized [test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1]
configure.ac:
Depends-on:
gen-header
include_next
+extensions-aix
configure.ac:
gl_HEADER_ERRNO_H
Depends-on:
+configure.ac-early:
+# This is actually already done in the pre-early phase.
+# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
configure.ac:
Makefile.am:
--- /dev/null
+Description:
+Enable extensions in AIX standard headers
+
+Files:
+m4/extensions-aix.m4
+
+Depends-on:
+
+configure.ac-early:
+AC_REQUIRE([gl_USE_AIX_EXTENSIONS])
+
+configure.ac:
+
+Makefile.am:
+
+Include:
+
+License:
+LGPLv2+
+
+Maintainer:
+all
Depends-on:
malloc-posix
+extensions-aix
xalloc-oversized [test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1]
configure.ac:
Depends-on:
realloc-posix
+extensions-aix
free-posix [test $REPLACE_REALLOC_FOR_REALLOC_GNU = 1]
malloc-gnu [test $REPLACE_REALLOC_FOR_REALLOC_GNU = 1]
xalloc-oversized [test $REPLACE_REALLOC_FOR_REALLOC_GNU = 1]
closedir
dirent
extensions
+extensions-aix
largefile
opendir
readdir