11cb0ef41Sopenharmony_ci{
21cb0ef41Sopenharmony_ci  'variables': {
31cb0ef41Sopenharmony_ci    'cares_sources_common': [
41cb0ef41Sopenharmony_ci      'include/ares.h',
51cb0ef41Sopenharmony_ci      'include/ares_dns.h',
61cb0ef41Sopenharmony_ci      'include/ares_dns_record.h',
71cb0ef41Sopenharmony_ci      'include/ares_nameser.h',
81cb0ef41Sopenharmony_ci      'include/ares_rules.h',
91cb0ef41Sopenharmony_ci      'include/ares_version.h',
101cb0ef41Sopenharmony_ci      'src/lib/ares__addrinfo2hostent.c',
111cb0ef41Sopenharmony_ci      'src/lib/ares__addrinfo_localhost.c',
121cb0ef41Sopenharmony_ci      'src/lib/ares__buf.c',
131cb0ef41Sopenharmony_ci      'src/lib/ares__buf.h',
141cb0ef41Sopenharmony_ci      'src/lib/ares__close_sockets.c',
151cb0ef41Sopenharmony_ci      'src/lib/ares__hosts_file.c',
161cb0ef41Sopenharmony_ci      'src/lib/ares__htable.c',
171cb0ef41Sopenharmony_ci      'src/lib/ares__htable.h',
181cb0ef41Sopenharmony_ci      'src/lib/ares__htable_asvp.c',
191cb0ef41Sopenharmony_ci      'src/lib/ares__htable_asvp.h',
201cb0ef41Sopenharmony_ci      'src/lib/ares__htable_strvp.c',
211cb0ef41Sopenharmony_ci      'src/lib/ares__htable_strvp.h',
221cb0ef41Sopenharmony_ci      'src/lib/ares__htable_szvp.c',
231cb0ef41Sopenharmony_ci      'src/lib/ares__htable_szvp.h',
241cb0ef41Sopenharmony_ci      'src/lib/ares__iface_ips.c',
251cb0ef41Sopenharmony_ci      'src/lib/ares__iface_ips.h',
261cb0ef41Sopenharmony_ci      'src/lib/ares__llist.c',
271cb0ef41Sopenharmony_ci      'src/lib/ares__llist.h',
281cb0ef41Sopenharmony_ci      'src/lib/ares__parse_into_addrinfo.c',
291cb0ef41Sopenharmony_ci      'src/lib/ares__read_line.c',
301cb0ef41Sopenharmony_ci      'src/lib/ares__slist.c',
311cb0ef41Sopenharmony_ci      'src/lib/ares__slist.h',
321cb0ef41Sopenharmony_ci      'src/lib/ares__socket.c',
331cb0ef41Sopenharmony_ci      'src/lib/ares__sortaddrinfo.c',
341cb0ef41Sopenharmony_ci      'src/lib/ares__threads.c',
351cb0ef41Sopenharmony_ci      'src/lib/ares__threads.h',
361cb0ef41Sopenharmony_ci      'src/lib/ares__timeval.c',
371cb0ef41Sopenharmony_ci      'src/lib/ares_android.c',
381cb0ef41Sopenharmony_ci      'src/lib/ares_android.h',
391cb0ef41Sopenharmony_ci      'src/lib/ares_cancel.c',
401cb0ef41Sopenharmony_ci      'src/lib/ares_create_query.c',
411cb0ef41Sopenharmony_ci      'src/lib/ares_data.c',
421cb0ef41Sopenharmony_ci      'src/lib/ares_data.h',
431cb0ef41Sopenharmony_ci      'src/lib/ares_destroy.c',
441cb0ef41Sopenharmony_ci      'src/lib/ares_dns_mapping.c',
451cb0ef41Sopenharmony_ci      'src/lib/ares_dns_name.c',
461cb0ef41Sopenharmony_ci      'src/lib/ares_dns_parse.c',
471cb0ef41Sopenharmony_ci      'src/lib/ares_dns_record.c',
481cb0ef41Sopenharmony_ci      'src/lib/ares_dns_private.h',
491cb0ef41Sopenharmony_ci      'src/lib/ares_dns_write.c',
501cb0ef41Sopenharmony_ci      'src/lib/ares_event.h',
511cb0ef41Sopenharmony_ci      'src/lib/ares_event_win32.h',
521cb0ef41Sopenharmony_ci      'src/lib/ares_event_epoll.c',
531cb0ef41Sopenharmony_ci      'src/lib/ares_event_kqueue.c',
541cb0ef41Sopenharmony_ci      'src/lib/ares_event_poll.c',
551cb0ef41Sopenharmony_ci      'src/lib/ares_event_select.c',
561cb0ef41Sopenharmony_ci      'src/lib/ares_event_thread.c',
571cb0ef41Sopenharmony_ci      'src/lib/ares_event_wake_pipe.c',
581cb0ef41Sopenharmony_ci      'src/lib/ares_event_win32.c',
591cb0ef41Sopenharmony_ci      'src/lib/ares_expand_name.c',
601cb0ef41Sopenharmony_ci      'src/lib/ares_expand_string.c',
611cb0ef41Sopenharmony_ci      'src/lib/ares_fds.c',
621cb0ef41Sopenharmony_ci      'src/lib/ares_free_hostent.c',
631cb0ef41Sopenharmony_ci      'src/lib/ares_free_string.c',
641cb0ef41Sopenharmony_ci      'src/lib/ares_freeaddrinfo.c',
651cb0ef41Sopenharmony_ci      'src/lib/ares_getaddrinfo.c',
661cb0ef41Sopenharmony_ci      'src/lib/ares_getenv.c',
671cb0ef41Sopenharmony_ci      'src/lib/ares_getenv.h',
681cb0ef41Sopenharmony_ci      'src/lib/ares_gethostbyaddr.c',
691cb0ef41Sopenharmony_ci      'src/lib/ares_gethostbyname.c',
701cb0ef41Sopenharmony_ci      'src/lib/ares_getnameinfo.c',
711cb0ef41Sopenharmony_ci      'src/lib/ares_getsock.c',
721cb0ef41Sopenharmony_ci      'src/lib/ares_inet_net_pton.h',
731cb0ef41Sopenharmony_ci      'src/lib/ares_init.c',
741cb0ef41Sopenharmony_ci      'src/lib/ares_library_init.c',
751cb0ef41Sopenharmony_ci      'src/lib/ares_ipv6.h',
761cb0ef41Sopenharmony_ci      'src/lib/ares_math.c',
771cb0ef41Sopenharmony_ci      'src/lib/ares_mkquery.c',
781cb0ef41Sopenharmony_ci      'src/lib/ares_options.c',
791cb0ef41Sopenharmony_ci      'src/lib/ares_parse_a_reply.c',
801cb0ef41Sopenharmony_ci      'src/lib/ares_parse_aaaa_reply.c',
811cb0ef41Sopenharmony_ci      'src/lib/ares_parse_caa_reply.c',
821cb0ef41Sopenharmony_ci      'src/lib/ares_parse_mx_reply.c',
831cb0ef41Sopenharmony_ci      'src/lib/ares_parse_naptr_reply.c',
841cb0ef41Sopenharmony_ci      'src/lib/ares_parse_ns_reply.c',
851cb0ef41Sopenharmony_ci      'src/lib/ares_parse_ptr_reply.c',
861cb0ef41Sopenharmony_ci      'src/lib/ares_parse_soa_reply.c',
871cb0ef41Sopenharmony_ci      'src/lib/ares_parse_srv_reply.c',
881cb0ef41Sopenharmony_ci      'src/lib/ares_parse_txt_reply.c',
891cb0ef41Sopenharmony_ci      'src/lib/ares_parse_uri_reply.c',
901cb0ef41Sopenharmony_ci      'src/lib/ares_platform.c',
911cb0ef41Sopenharmony_ci      'src/lib/ares_platform.h',
921cb0ef41Sopenharmony_ci      'src/lib/ares_private.h',
931cb0ef41Sopenharmony_ci      'src/lib/ares_process.c',
941cb0ef41Sopenharmony_ci      'src/lib/ares_qcache.c',
951cb0ef41Sopenharmony_ci      'src/lib/ares_query.c',
961cb0ef41Sopenharmony_ci      'src/lib/ares_rand.c',
971cb0ef41Sopenharmony_ci      'src/lib/ares_search.c',
981cb0ef41Sopenharmony_ci      'src/lib/ares_send.c',
991cb0ef41Sopenharmony_ci      'src/lib/ares_setup.h',
1001cb0ef41Sopenharmony_ci      'src/lib/ares_strcasecmp.c',
1011cb0ef41Sopenharmony_ci      'src/lib/ares_strcasecmp.h',
1021cb0ef41Sopenharmony_ci      'src/lib/ares_str.c',
1031cb0ef41Sopenharmony_ci      'src/lib/ares_str.h',
1041cb0ef41Sopenharmony_ci      'src/lib/ares_strerror.c',
1051cb0ef41Sopenharmony_ci      'src/lib/ares_strsplit.c',
1061cb0ef41Sopenharmony_ci      'src/lib/ares_strsplit.h',
1071cb0ef41Sopenharmony_ci      'src/lib/ares_sysconfig.c',
1081cb0ef41Sopenharmony_ci      'src/lib/ares_sysconfig_files.c',
1091cb0ef41Sopenharmony_ci      'src/lib/ares_timeout.c',
1101cb0ef41Sopenharmony_ci      'src/lib/ares_update_servers.c',
1111cb0ef41Sopenharmony_ci      'src/lib/ares_version.c',
1121cb0ef41Sopenharmony_ci      'src/lib/inet_net_pton.c',
1131cb0ef41Sopenharmony_ci      'src/lib/inet_ntop.c',
1141cb0ef41Sopenharmony_ci      'src/lib/setup_once.h',
1151cb0ef41Sopenharmony_ci      'src/tools/ares_getopt.c',
1161cb0ef41Sopenharmony_ci      'src/tools/ares_getopt.h',
1171cb0ef41Sopenharmony_ci    ],
1181cb0ef41Sopenharmony_ci    'cares_sources_win': [
1191cb0ef41Sopenharmony_ci      'src/lib/config-win32.h',
1201cb0ef41Sopenharmony_ci      'src/lib/windows_port.c',
1211cb0ef41Sopenharmony_ci    ],
1221cb0ef41Sopenharmony_ci  },
1231cb0ef41Sopenharmony_ci
1241cb0ef41Sopenharmony_ci  'target_defaults': {
1251cb0ef41Sopenharmony_ci    'conditions': [
1261cb0ef41Sopenharmony_ci      ['OS!="win"', {
1271cb0ef41Sopenharmony_ci        'defines': [
1281cb0ef41Sopenharmony_ci          '_DARWIN_USE_64_BIT_INODE=1',
1291cb0ef41Sopenharmony_ci          '_LARGEFILE_SOURCE',
1301cb0ef41Sopenharmony_ci          '_FILE_OFFSET_BITS=64',
1311cb0ef41Sopenharmony_ci          '_GNU_SOURCE'
1321cb0ef41Sopenharmony_ci        ]
1331cb0ef41Sopenharmony_ci      }],
1341cb0ef41Sopenharmony_ci      [ 'OS in "aix os400"', {
1351cb0ef41Sopenharmony_ci        'include_dirs': [ 'config/aix' ],
1361cb0ef41Sopenharmony_ci        'sources': [ 'config/aix/ares_config.h' ],
1371cb0ef41Sopenharmony_ci        'defines': [
1381cb0ef41Sopenharmony_ci          # Support for malloc(0)
1391cb0ef41Sopenharmony_ci          '_LINUX_SOURCE_COMPAT=1',
1401cb0ef41Sopenharmony_ci          '_ALL_SOURCE=1'],
1411cb0ef41Sopenharmony_ci      }],
1421cb0ef41Sopenharmony_ci      ['OS=="solaris"', {
1431cb0ef41Sopenharmony_ci        'defines': [
1441cb0ef41Sopenharmony_ci          '__EXTENSIONS__',
1451cb0ef41Sopenharmony_ci          '_XOPEN_SOURCE=500'
1461cb0ef41Sopenharmony_ci        ]
1471cb0ef41Sopenharmony_ci      }]
1481cb0ef41Sopenharmony_ci    ]
1491cb0ef41Sopenharmony_ci  },
1501cb0ef41Sopenharmony_ci
1511cb0ef41Sopenharmony_ci  'targets': [
1521cb0ef41Sopenharmony_ci    {
1531cb0ef41Sopenharmony_ci      'target_name': 'cares',
1541cb0ef41Sopenharmony_ci      'type': '<(library)',
1551cb0ef41Sopenharmony_ci      'include_dirs': [ 'include' ],
1561cb0ef41Sopenharmony_ci      'direct_dependent_settings': {
1571cb0ef41Sopenharmony_ci        'include_dirs': [ 'include' ]
1581cb0ef41Sopenharmony_ci      },
1591cb0ef41Sopenharmony_ci      'sources': [
1601cb0ef41Sopenharmony_ci        '<@(cares_sources_common)',
1611cb0ef41Sopenharmony_ci      ],
1621cb0ef41Sopenharmony_ci      'conditions': [
1631cb0ef41Sopenharmony_ci        [ 'library=="static_library"', {
1641cb0ef41Sopenharmony_ci          'defines': [ 'CARES_STATICLIB' ]
1651cb0ef41Sopenharmony_ci        }, {
1661cb0ef41Sopenharmony_ci          'defines': [ 'CARES_BUILDING_LIBRARY' ]
1671cb0ef41Sopenharmony_ci        }],
1681cb0ef41Sopenharmony_ci        [ 'OS=="win"', {
1691cb0ef41Sopenharmony_ci          'defines': [
1701cb0ef41Sopenharmony_ci            'CARES_PULL_WS2TCPIP_H=1',
1711cb0ef41Sopenharmony_ci            '_WINSOCK_DEPRECATED_NO_WARNINGS',
1721cb0ef41Sopenharmony_ci          ],
1731cb0ef41Sopenharmony_ci          'include_dirs': [ 'config/win32' ],
1741cb0ef41Sopenharmony_ci          'sources': [
1751cb0ef41Sopenharmony_ci            '<@(cares_sources_win)',
1761cb0ef41Sopenharmony_ci          ],
1771cb0ef41Sopenharmony_ci          'libraries': [
1781cb0ef41Sopenharmony_ci            '-lws2_32.lib',
1791cb0ef41Sopenharmony_ci            '-liphlpapi.lib'
1801cb0ef41Sopenharmony_ci          ],
1811cb0ef41Sopenharmony_ci        }, {
1821cb0ef41Sopenharmony_ci          # Not Windows i.e. POSIX
1831cb0ef41Sopenharmony_ci          'cflags': [
1841cb0ef41Sopenharmony_ci            '-g',
1851cb0ef41Sopenharmony_ci            '-pedantic',
1861cb0ef41Sopenharmony_ci            '-Wall',
1871cb0ef41Sopenharmony_ci            '-Wextra',
1881cb0ef41Sopenharmony_ci            '-Wno-unused-parameter'
1891cb0ef41Sopenharmony_ci          ],
1901cb0ef41Sopenharmony_ci          'defines': [ 'HAVE_CONFIG_H' ],
1911cb0ef41Sopenharmony_ci        }],
1921cb0ef41Sopenharmony_ci        [ 'OS not in "win android"', {
1931cb0ef41Sopenharmony_ci          'cflags': [
1941cb0ef41Sopenharmony_ci            '--std=gnu11'
1951cb0ef41Sopenharmony_ci          ],
1961cb0ef41Sopenharmony_ci        }],
1971cb0ef41Sopenharmony_ci        [ 'OS=="linux"', {
1981cb0ef41Sopenharmony_ci          'include_dirs': [ 'config/linux' ],
1991cb0ef41Sopenharmony_ci          'sources': [ 'config/linux/ares_config.h' ]
2001cb0ef41Sopenharmony_ci        }],
2011cb0ef41Sopenharmony_ci        [ 'OS=="mac" or OS=="ios"', {
2021cb0ef41Sopenharmony_ci          'include_dirs': [ 'config/darwin' ],
2031cb0ef41Sopenharmony_ci          'sources': [ 'config/darwin/ares_config.h' ]
2041cb0ef41Sopenharmony_ci        }],
2051cb0ef41Sopenharmony_ci        [ 'OS=="freebsd" or OS=="dragonflybsd"', {
2061cb0ef41Sopenharmony_ci          'include_dirs': [ 'config/freebsd' ],
2071cb0ef41Sopenharmony_ci          'sources': [ 'config/freebsd/ares_config.h' ]
2081cb0ef41Sopenharmony_ci        }],
2091cb0ef41Sopenharmony_ci        [ 'OS=="openbsd"', {
2101cb0ef41Sopenharmony_ci          'include_dirs': [ 'config/openbsd' ],
2111cb0ef41Sopenharmony_ci          'sources': [ 'config/openbsd/ares_config.h' ]
2121cb0ef41Sopenharmony_ci        }],
2131cb0ef41Sopenharmony_ci        [ 'OS=="android"', {
2141cb0ef41Sopenharmony_ci          'include_dirs': [ 'config/android' ],
2151cb0ef41Sopenharmony_ci          'sources': [ 'config/android/ares_config.h' ],
2161cb0ef41Sopenharmony_ci        }],
2171cb0ef41Sopenharmony_ci        [ 'OS=="solaris"', {
2181cb0ef41Sopenharmony_ci          'include_dirs': [ 'config/sunos' ],
2191cb0ef41Sopenharmony_ci          'sources': [ 'config/sunos/ares_config.h' ],
2201cb0ef41Sopenharmony_ci          'direct_dependent_settings': {
2211cb0ef41Sopenharmony_ci            'libraries': [
2221cb0ef41Sopenharmony_ci              '-lsocket',
2231cb0ef41Sopenharmony_ci              '-lnsl'
2241cb0ef41Sopenharmony_ci            ]
2251cb0ef41Sopenharmony_ci          }
2261cb0ef41Sopenharmony_ci        }]
2271cb0ef41Sopenharmony_ci      ]
2281cb0ef41Sopenharmony_ci    }
2291cb0ef41Sopenharmony_ci  ]
2301cb0ef41Sopenharmony_ci}
231