diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-30 19:11:52 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-30 19:11:52 +0000 |
commit | 5924b28e903272f395d53413a783eec3f5489ecb (patch) | |
tree | 898dad0f66d2410fa20e02cacb83b40aefe3d2ab /libstdc++-v3/acinclude.m4 | |
parent | bbce13af8477ef823eba34fdbc49db8d2692090a (diff) |
Implement N4100 File System TS
* acinclude.m4 (GLIBCXX_ENABLE_FILESYSTEM_TS): Define.
(GLIBCXX_CHECK_FILESYSTEM_DEPS): Define.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Enable filesystem TS and check its dependencies.
* include/Makefile.am: Add new headers.
* include/Makefile.in: Regenerate.
* include/bits/locale_conv.h (__do_str_code_cvt, __str_codecvt_in,
__str_codecvt_out): Move code conversion logic from wstring_convert
into new global functions.
(wstring_convert::to_bytes, wstring_convert::from_bytes): Use new
functions.
(wstring_convert::_M_conv): Remove.
* include/bits/quoted_string.h (_Quoted_string): Split out of iomanip.
* include/experimental/filesystem: New.
* include/experimental/fs_dir.h: New.
* include/experimental/fs_fwd.h: New.
* include/experimental/fs_ops.h: New.
* include/experimental/fs_path.h: New.
* include/std/iomanip (_Quoted_string): Move to bits/quoted_string.h.
* python/libstdcxx/v6/printers.py (StdExpPathPrinter): Add.
* src/Makefile.am (SUBDIRS): Add filesystem.
* src/Makefile.in: Regenerate.
* src/filesystem/Makefile.am: New.
* src/filesystem/Makefile.in: New.
* src/filesystem/dir.cc: New.
* src/filesystem/ops.cc: New.
* src/filesystem/path.cc: New.
* testsuite/experimental/filesystem/operations/absolute.cc: New.
* testsuite/experimental/filesystem/operations/copy.cc: New.
* testsuite/experimental/filesystem/operations/current_path.cc: New.
* testsuite/experimental/filesystem/path/append/path.cc: New.
* testsuite/experimental/filesystem/path/assign/assign.cc: New.
* testsuite/experimental/filesystem/path/assign/copy.cc: New.
* testsuite/experimental/filesystem/path/compare/compare.cc: New.
* testsuite/experimental/filesystem/path/compare/path.cc: New.
* testsuite/experimental/filesystem/path/compare/strings.cc: New.
* testsuite/experimental/filesystem/path/concat/path.cc: New.
* testsuite/experimental/filesystem/path/concat/strings.cc: New.
* testsuite/experimental/filesystem/path/construct/copy.cc: New.
* testsuite/experimental/filesystem/path/construct/default.cc: New.
* testsuite/experimental/filesystem/path/construct/locale.cc: New.
* testsuite/experimental/filesystem/path/construct/range.cc: New.
* testsuite/experimental/filesystem/path/decompose/extension.cc: New.
* testsuite/experimental/filesystem/path/decompose/filename.cc: New.
* testsuite/experimental/filesystem/path/decompose/parent_path.cc:
New.
* testsuite/experimental/filesystem/path/decompose/relative_path.cc:
New.
* testsuite/experimental/filesystem/path/decompose/root_directory.cc:
New.
* testsuite/experimental/filesystem/path/decompose/root_name.cc:
New.
* testsuite/experimental/filesystem/path/decompose/root_path.cc:
New.
* testsuite/experimental/filesystem/path/decompose/stem.cc: New.
* testsuite/experimental/filesystem/path/generic/generic_string.cc:
New.
* testsuite/experimental/filesystem/path/itr/traversal.cc: New.
* testsuite/experimental/filesystem/path/modifiers/clear.cc: New.
* testsuite/experimental/filesystem/path/modifiers/make_preferred.cc:
New.
* testsuite/experimental/filesystem/path/modifiers/remove_filename.cc:
New.
* testsuite/experimental/filesystem/path/modifiers/replace_extension.cc:
New.
* testsuite/experimental/filesystem/path/modifiers/replace_filename.cc:
New.
* testsuite/experimental/filesystem/path/modifiers/swap.cc: New.
* testsuite/experimental/filesystem/path/nonmember/hash_value.cc: New.
* testsuite/experimental/filesystem/path/query/empty.cc: New.
* testsuite/experimental/filesystem/path/query/has_extension.cc: New.
* testsuite/experimental/filesystem/path/query/has_filename.cc: New.
* testsuite/experimental/filesystem/path/query/has_parent_path.cc:
New.
* testsuite/experimental/filesystem/path/query/has_relative_path.cc:
New.
* testsuite/experimental/filesystem/path/query/has_root_directory.cc:
New.
* testsuite/experimental/filesystem/path/query/has_root_name.cc:
New.
* testsuite/experimental/filesystem/path/query/has_root_path.cc:
New.
* testsuite/experimental/filesystem/path/query/has_stem.cc: New.
* testsuite/experimental/filesystem/path/query/is_relative.cc: New.
* testsuite/util/testsuite_fs.h: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222654 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 95 |
1 files changed, 94 insertions, 1 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index ffa2122f8a7..537ca6f926c 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -49,7 +49,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [ # Keep these sync'd with the list in Makefile.am. The first provides an # expandable list at autoconf time; the second provides an expandable list # (i.e., shell variable) at configure time. - m4_define([glibcxx_SUBDIRS],[include libsupc++ src src/c++98 src/c++11 doc po testsuite python]) + m4_define([glibcxx_SUBDIRS],[include libsupc++ src src/c++98 src/c++11 src/filesystem doc po testsuite python]) SUBDIRS='glibcxx_SUBDIRS' # These need to be absolute paths, yet at the same time need to @@ -3903,6 +3903,99 @@ AC_DEFUN([GLIBCXX_DEFAULT_ABI], [ GLIBCXX_CONDITIONAL(ENABLE_CXX11_ABI, test $glibcxx_cxx11_abi = 1) ]) +dnl +dnl Check to see whether to build libstdc++fs.a +dnl +dnl --enable-libstdcxx-filesystem-ts +dnl +AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [ + GLIBCXX_ENABLE(libstdcxx-filesystem-ts,auto,, + [turns on ISO/IEC TS 18822 support], + [permit yes|no|auto]) + + AC_MSG_CHECKING([whether to build Filesystem TS support]) + if test x"$enable_libstdcxx_filesystem_ts" = x"auto"; then + case "${target_os}" in + freebsd*|netbsd*|openbsd*|dragonfly*|darwin*) + enable_libstdcxx_filesystem_ts=yes + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + enable_libstdcxx_filesystem_ts=yes + ;; + solaris*) + enable_libstdcxx_filesystem_ts=yes + ;; + *) + enable_libstdcxx_filesystem_ts=no + ;; + esac + fi + AC_MSG_RESULT($enable_libstdcxx_filesystem_ts) + GLIBCXX_CONDITIONAL(ENABLE_FILESYSTEM_TS, test $enable_libstdcxx_filesystem_ts = yes) +]) + +dnl +dnl Check whether the library calls required by the Filesystem TS are present +dnl and define _GLIBCXX_USE_REALPATH and _GLIBCXX_USE_UTIMENSAT. +dnl +AC_DEFUN([GLIBCXX_CHECK_FILESYSTEM_DEPS], [dnl +dnl + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions" +dnl + AC_MSG_CHECKING([for realpath]) + AC_CACHE_VAL(glibcxx_cv_realpath, [dnl + GCC_TRY_COMPILE_OR_LINK( + [#include <stdlib.h>], + [char *tmp = realpath((const char*)NULL, (char*)NULL);], + [glibcxx_cv_realpath=yes], + [glibcxx_cv_realpath=no]) + ]) + if test $glibcxx_cv_realpath = yes; then + AC_DEFINE(_GLIBCXX_USE_REALPATH, 1, [Define if realpath is available in <stdlib.h>.]) + fi + AC_MSG_RESULT($glibcxx_cv_realpath) +dnl + AC_MSG_CHECKING([for utimensat]) + AC_CACHE_VAL(glibcxx_cv_utimensat, [dnl + GCC_TRY_COMPILE_OR_LINK( + [ + #include <fcntl.h> + #include <sys/stat.h> + ], + [ + struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } }; + int i = utimensat(AT_FDCWD, "path", ts, 0); + ], + [glibcxx_cv_utimensat=yes], + [glibcxx_cv_utimensat=no]) + ]) + if test $glibcxx_cv_utimensat = yes; then + AC_DEFINE(_GLIBCXX_USE_UTIMENSAT, 1, [Define if utimensat and UTIME_OMIT are available in <sys/stat.h> and AT_FDCWD in <fcntl.h>.]) + fi + AC_MSG_RESULT($glibcxx_cv_utimensat) +dnl + AC_MSG_CHECKING([for struct stat.st_mtim.tv_nsec]) + AC_CACHE_VAL(glibcxx_cv_st_mtim, [dnl + GCC_TRY_COMPILE_OR_LINK( + [ #include <sys/stat.h> ], + [ + struct stat st; + return st.st_mtim.tv_nsec; + ], + [glibcxx_cv_st_mtim=yes], + [glibcxx_cv_st_mtim=no]) + ]) + if test $glibcxx_cv_st_mtim = yes; then + AC_DEFINE(_GLIBCXX_USE_ST_MTIM, 1, [Define if struct stat has timespec members.]) + fi + AC_MSG_RESULT($glibcxx_cv_st_mtim) +dnl + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) # Macros from the top-level gcc directory. m4_include([../config/gc++filt.m4]) |