[libc++][chrono] Adds tzdb_list implementation.

This is the first step to implement time zone support in libc++. This
adds the complete tzdb_list class and a minimal tzdb class. The tzdb
class only contains the version, which is used by reload_tzdb.

Next to these classes it contains documentation and build system support
needed for time zone support. The code depends on the IANA Time Zone
Database, which should be available on the platform used or provided by
the libc++ vendors.

The code is labeled as experimental since there will be ABI breaks
during development; the tzdb class needs to have the standard headers.

Implements parts of:
- P0355 Extending <chrono> to Calendars and Time Zones

Addresses:
- LWG3319 Properly reference specification of IANA time zone database

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D154282
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index b9d0ed5..e135939 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -87,6 +87,24 @@
    support the C functionality for wide characters. When wide characters are
    not supported, several parts of the library will be disabled, notably the
    wide character specializations of std::basic_string." ON)
+
+# To use time zone support in libc++ the platform needs to have the IANA
+# database installed. Libc++ will fail to build if this is enabled on a
+# platform that does not provide the IANA database. The default is set to the
+# current implementation state on the different platforms.
+#
+# TODO TZDB make the default always ON when most platforms ship with the IANA
+# database.
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  set(ENABLE_TIME_ZONE_DATABASE_DEFAULT ON)
+else()
+  set(ENABLE_TIME_ZONE_DATABASE_DEFAULT OFF)
+endif()
+option(LIBCXX_ENABLE_TIME_ZONE_DATABASE
+  "Whether to include support for time zones in the library. Disabling
+  time zone support can be useful when porting to platforms that don't
+  ship the IANA time zone database. When time zones are not supported,
+  time zone support in <chrono> will be disabled." ${ENABLE_TIME_ZONE_DATABASE_DEFAULT})
 option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
   "Whether to turn on vendor availability annotations on declarations that depend
    on definitions in a shared library. By default, we assume that we're not building
@@ -756,6 +774,7 @@
 config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE)
 config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS)
 config_define_if_not(LIBCXX_ENABLE_STD_MODULES _LIBCPP_HAS_NO_STD_MODULES)
+config_define_if_not(LIBCXX_ENABLE_TIME_ZONE_DATABASE _LIBCPP_HAS_NO_TIME_ZONE_DATABASE)
 config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
 if (LIBCXX_HARDENING_MODE STREQUAL "hardened")
   config_define(1 _LIBCPP_ENABLE_HARDENED_MODE_DEFAULT)