mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-08-08 17:22:05 +03:00
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.
This commit is contained in:
18
ChangeLog
18
ChangeLog
@@ -1,3 +1,21 @@
|
||||
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).
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# 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,
|
||||
@@ -60,8 +60,7 @@ AC_DEFUN([gl_FUNC_CALLOC_GNU],
|
||||
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
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# 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,
|
||||
@@ -12,8 +12,7 @@ AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
|
||||
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],[
|
||||
|
25
m4/extensions-aix.m4
Normal file
25
m4/extensions-aix.m4
Normal file
@@ -0,0 +1,25 @@
|
||||
# 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.])
|
||||
])
|
@@ -1,5 +1,5 @@
|
||||
# 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,
|
||||
@@ -47,8 +47,7 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU],
|
||||
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
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# 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,
|
||||
@@ -47,8 +47,7 @@ AC_DEFUN([gl_FUNC_REALLOC_GNU],
|
||||
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])
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# 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,
|
||||
@@ -12,8 +12,7 @@ AC_DEFUN([gl_FUNC_SCANDIR],
|
||||
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
|
||||
|
@@ -7,6 +7,7 @@ m4/calloc.m4
|
||||
|
||||
Depends-on:
|
||||
calloc-posix
|
||||
extensions-aix
|
||||
xalloc-oversized [test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1]
|
||||
|
||||
configure.ac:
|
||||
|
@@ -8,6 +8,7 @@ m4/errno_h.m4
|
||||
Depends-on:
|
||||
gen-header
|
||||
include_next
|
||||
extensions-aix
|
||||
|
||||
configure.ac:
|
||||
gl_HEADER_ERRNO_H
|
||||
|
@@ -6,6 +6,10 @@ m4/extensions.m4
|
||||
|
||||
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:
|
||||
|
22
modules/extensions-aix
Normal file
22
modules/extensions-aix
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
@@ -6,6 +6,7 @@ lib/malloc.c
|
||||
|
||||
Depends-on:
|
||||
malloc-posix
|
||||
extensions-aix
|
||||
xalloc-oversized [test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1]
|
||||
|
||||
configure.ac:
|
||||
|
@@ -6,6 +6,7 @@ lib/realloc.c
|
||||
|
||||
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]
|
||||
|
@@ -10,6 +10,7 @@ builtin-expect
|
||||
closedir
|
||||
dirent
|
||||
extensions
|
||||
extensions-aix
|
||||
largefile
|
||||
opendir
|
||||
readdir
|
||||
|
Reference in New Issue
Block a user