]> 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, 7 Sep 2023 16:03:40 +0000 (17:03 +0100)
commit5435449be0eb9ca41824eb16f774db3ccc2a593b
treec9ccc4204c4e98e79474ae7ce87037ba48627db5
parentd295a5341d0cae95c199e0aabcbcde82c6fff0d1
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.
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