Paul Eggert wrote: > I had originally thought to put the "#define _LINUX_SOURCE_COMPAT 1" > into AC_USE_SYSTEM_EXTENSIONS, which would have fixed it in a different > way. However, it's not really an extension to AIX but more of a change > (since it changes the strerror_r API) so I didn't do that.
Yes, I thought the same way. > With so many Gnulib modules now defining _LINUX_SOURCE_COMPAT directly > or indirectly, we're probably not that far from what my original thought > would have done, in a practical sense. But it's clearer to have a > separate macro since it really is a behavior change, not an extension. And the separate macro allows packages to decline the use of this Linux-like behaviour, via the gnulib-tool option --avoid=extensions-aix. To make this work, only a small change is needed: 2024-08-02 Bruno Haible <br...@clisp.org> Allow use of --avoid=extensions-aix. * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Don't require gl_USE_AIX_EXTENSIONS explicitly. * 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. diff --git a/m4/calloc.m4 b/m4/calloc.m4 index 6d9a808dbf..c69ce414a0 100644 --- a/m4/calloc.m4 +++ b/m4/calloc.m4 @@ -1,5 +1,5 @@ # calloc.m4 -# serial 33 +# serial 34 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, @@ -59,8 +59,9 @@ AC_DEFUN([gl_FUNC_CALLOC_GNU] AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_CALLOC_POSIX]) - dnl This helps if !(__VEC__ || __AIXVEC), and shouldn't hurt otherwise. - AC_REQUIRE([gl_USE_AIX_EXTENSIONS]) + dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT + dnl gets defined already before this macro gets invoked. This helps + dnl if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise. REPLACE_CALLOC_FOR_CALLOC_GNU="$REPLACE_CALLOC_FOR_CALLOC_POSIX" if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 0; then diff --git a/m4/errno_h.m4 b/m4/errno_h.m4 index 9738a49f19..18bfd7b1c1 100644 --- a/m4/errno_h.m4 +++ b/m4/errno_h.m4 @@ -1,5 +1,5 @@ # errno_h.m4 -# serial 16 +# serial 17 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, @@ -11,8 +11,9 @@ AC_DEFUN_ONCE([gl_HEADER_ERRNO_H] [ AC_REQUIRE([AC_PROG_CC]) - dnl Persuade AIX 7.3 errno.h to make EEXIST != ENOTEMPTY. - AC_REQUIRE([gl_USE_AIX_EXTENSIONS]) + dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT + dnl gets defined already before this macro gets invoked. This persuades + dnl AIX 7.3 errno.h to assign ENOTEMPTY a value different than EEXIST. AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ AC_EGREP_CPP([booboo],[ diff --git a/m4/malloc.m4 b/m4/malloc.m4 index 4a71b060b9..ee6df5c3fb 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,5 +1,5 @@ # malloc.m4 -# serial 33 +# serial 34 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, @@ -46,8 +46,9 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU] AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) - dnl This helps if !(__VEC__ || __AIXVEC), and shouldn't hurt otherwise. - AC_REQUIRE([gl_USE_AIX_EXTENSIONS]) + dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT + dnl gets defined already before this macro gets invoked. This helps + dnl if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise. REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX" if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then diff --git a/m4/realloc.m4 b/m4/realloc.m4 index b3ec43a8a7..cc91102836 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,5 +1,5 @@ # realloc.m4 -# serial 31 +# serial 32 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, @@ -46,8 +46,9 @@ AC_DEFUN([gl_FUNC_REALLOC_GNU] AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_REALLOC_POSIX]) - dnl This helps if !(__VEC__ || __AIXVEC), and shouldn't hurt otherwise. - AC_REQUIRE([gl_USE_AIX_EXTENSIONS]) + dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT + dnl gets defined already before this macro gets invoked. This helps + dnl if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise. if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then _AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC_FOR_REALLOC_GNU=1]) diff --git a/m4/scandir.m4 b/m4/scandir.m4 index c8673fc880..27b8af860d 100644 --- a/m4/scandir.m4 +++ b/m4/scandir.m4 @@ -1,5 +1,5 @@ # scandir.m4 -# serial 4 +# serial 5 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, @@ -12,8 +12,6 @@ AC_DEFUN([gl_FUNC_SCANDIR] dnl Persuade glibc and Solaris <dirent.h> to declare scandir(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([gl_USE_AIX_EXTENSIONS]) - AC_CHECK_FUNCS([scandir]) if test $ac_cv_func_scandir = no; then HAVE_SCANDIR=0