]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd
authorJonathan Wakely <jwakely@redhat.com>
Thu, 7 Sep 2023 16:03:40 +0000 (17:03 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 9 Nov 2023 08:04:30 +0000 (08:04 +0000)
commita0a2d15215152cc430d8fb1e5a600abddbc3b051
tree1ff16d85fa32e82ffb58280199f710ec4b1672d0
parent9847a4e9f025e66bfd09e0174e8bd32aa01939af
libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd

The filesystem code was using these functions without checking for their
existence, assuming that any UNIX-like libc with <unistd.h> would always
provide them. That's not true for some newlib targets like arm-eabi.

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for mkdir,
chmod, chdir, and getcwd.
* config.h.in: Regenerate.
* configure: Regenerate.
* src/c++17/fs_ops.cc (create_dir): Use USE_MKDIR macro.
(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
(fs::permissions): Use USE_CHMOD macro.
* src/filesystem/ops-common.h [FILESYSTEM_IS_WINDOWS]
(chmod, mkdir, getcwd, chdir): Define new macros.
[FILESYSTEM_IS_WINDOWS] (chmod, mkdir, getcwd, chdir): Use
new macros.
* src/filesystem/ops.cc (create_dir): Use USE_MKDIR macro.
(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
(fs::permissions): Use USE_CHMOD macro.

(cherry picked from commit 5435449be0eb9ca41824eb16f774db3ccc2a593b)
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/src/c++17/fs_ops.cc
libstdc++-v3/src/filesystem/ops-common.h
libstdc++-v3/src/filesystem/ops.cc