aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-10-16 16:16:24 -0700
committerGitHub <noreply@github.com>2017-10-16 16:16:24 -0700
commita68ad1ececf92190c89223c59fa59677d02bb426 (patch)
tree1ee7b07edf32c77ab3f71992bcd349a5d9945019
parente5867d1d63606cef5c53a764e31ce05385f36497 (diff)
parentbc141aa2c7e9e9adb81c16353d6de7e44c6136a1 (diff)
downloadvcpkg-a68ad1ececf92190c89223c59fa59677d02bb426.tar.gz
vcpkg-a68ad1ececf92190c89223c59fa59677d02bb426.zip
Merge pull request #1964 from lazyhamster/libidn2
[libidn2] initial port
-rw-r--r--ports/libidn2/CMakeLists.txt105
-rw-r--r--ports/libidn2/CONTROL4
-rw-r--r--ports/libidn2/config.h995
-rw-r--r--ports/libidn2/portfile.cmake48
-rw-r--r--ports/libidn2/string.h10
5 files changed, 1162 insertions, 0 deletions
diff --git a/ports/libidn2/CMakeLists.txt b/ports/libidn2/CMakeLists.txt
new file mode 100644
index 000000000..9fbe1bcdd
--- /dev/null
+++ b/ports/libidn2/CMakeLists.txt
@@ -0,0 +1,105 @@
+cmake_minimum_required(VERSION 3.8)
+
+project(libidn2 C)
+
+find_path(ICONV_INCLUDE_DIR iconv.h)
+find_library(ICONV NAMES libiconv)
+find_library(ICONV_CHARSET NAMES libcharset)
+
+set(CMAKE_DEBUG_POSTFIX "d")
+
+if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
+ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+endif()
+
+add_definitions(-DIDN2_BUILDING)
+
+if(NOT BUILD_SHARED_LIBS)
+ add_definitions(-DIDN2_STATIC)
+endif()
+
+# List the source files
+set(LIB_SRC lib/bidi.c
+ lib/context.c
+ lib/data.c
+ lib/decode.c
+ lib/error.c
+ lib/free.c
+ lib/idna.c
+ lib/lookup.c
+ lib/puny_decode.c
+ lib/puny_encode.c
+ lib/register.c
+ lib/tables.c
+ lib/tr46map.c
+ lib/tr46map_data.c
+ lib/version.c
+)
+
+# List the libunistring source files
+set(UNISTR_SRC unistring/c-ctype.c
+ unistring/c-strcasecmp.c
+ unistring/c-strncasecmp.c
+ unistring/malloca.c
+ unistring/striconveh.c
+ unistring/striconveha.c
+ unistring/uniconv/u8-conv-from-enc.c
+ unistring/uniconv/u8-strconv-from-enc.c
+ unistring/uniconv/u8-strconv-from-locale.c
+ unistring/uniconv/u8-strconv-to-enc.c
+ unistring/uniconv/u8-strconv-to-locale.c
+ unistring/unistr/u32-cpy.c
+ unistring/unistr/u32-cpy-alloc.c
+ unistring/unistr/u32-mbtouc-unsafe.c
+ unistring/unistr/u32-strlen.c
+ unistring/unistr/u32-to-u8.c
+ unistring/unistr/u32-uctomb.c
+ unistring/unistr/u8-check.c
+ unistring/unistr/u8-mblen.c
+ unistring/unistr/u8-mbtouc.c
+ unistring/unistr/u8-mbtouc-aux.c
+ unistring/unistr/u8-mbtouc-unsafe.c
+ unistring/unistr/u8-mbtouc-unsafe-aux.c
+ unistring/unistr/u8-mbtoucr.c
+ unistring/unistr/u8-prev.c
+ unistring/unistr/u8-strlen.c
+ unistring/unistr/u8-to-u32.c
+ unistring/unistr/u8-uctomb.c
+ unistring/unistr/u8-uctomb-aux.c
+ unistring/uninorm/canonical-decomposition.c
+ unistring/uninorm/composition.c
+ unistring/uninorm/decompose-internal.c
+ unistring/uninorm/decomposition-table.c
+ unistring/uninorm/nfc.c
+ unistring/uninorm/nfd.c
+ unistring/uninorm/u32-normalize.c
+ unistring/unictype/bidi_of.c
+ unistring/unictype/categ_M.c
+ unistring/unictype/categ_none.c
+ unistring/unictype/categ_of.c
+ unistring/unictype/categ_test.c
+ unistring/unictype/combiningclass.c
+ unistring/unictype/joiningtype_of.c
+ unistring/unictype/scripts.c
+)
+
+# List the gnulib source files
+set(GL_SRC gl/rawmemchr.c
+ gl/strchrnul.c
+ gl/strverscmp.c
+ gl/msvc-inval.c
+ gl/msvc-nothrow.c
+)
+
+add_library(libidn2 ${LIB_SRC} ${UNISTR_SRC} ${GL_SRC})
+
+target_include_directories(libidn2 PRIVATE . ./unistring ./gl ${ICONV_INCLUDE_DIR})
+target_link_libraries(libidn2 PRIVATE ${ICONV} ${ICONV_CHARSET})
+
+install(TARGETS libidn2
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+install(FILES lib/idn2.h DESTINATION include)
diff --git a/ports/libidn2/CONTROL b/ports/libidn2/CONTROL
new file mode 100644
index 000000000..46e81c7bf
--- /dev/null
+++ b/ports/libidn2/CONTROL
@@ -0,0 +1,4 @@
+Source: libidn2
+Version: 2.0.4
+Build-Depends: libiconv
+Description: GNU Libidn is an implementation of the Stringprep, Punycode and IDNA 2003 specifications. Libidn's purpose is to encode and decode internationalized domain names.
diff --git a/ports/libidn2/config.h b/ports/libidn2/config.h
new file mode 100644
index 000000000..9e61bc8f2
--- /dev/null
+++ b/ports/libidn2/config.h
@@ -0,0 +1,995 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to the number of bits in type 'ptrdiff_t'. */
+/* #undef BITSIZEOF_PTRDIFF_T */
+
+/* Define to the number of bits in type 'sig_atomic_t'. */
+/* #undef BITSIZEOF_SIG_ATOMIC_T */
+
+/* Define to the number of bits in type 'size_t'. */
+/* #undef BITSIZEOF_SIZE_T */
+
+/* Define to the number of bits in type 'wchar_t'. */
+/* #undef BITSIZEOF_WCHAR_T */
+
+/* Define to the number of bits in type 'wint_t'. */
+/* #undef BITSIZEOF_WINT_T */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define to 1 if // is a file system root distinct from /. */
+/* #undef DOUBLE_SLASH_IS_DISTINCT_ROOT */
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+/* #undef ENABLE_NLS */
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module fscanf shall be considered present. */
+#define GNULIB_FSCANF 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module msvc-nothrow shall be considered present. */
+#define GNULIB_MSVC_NOTHROW 1
+
+/* Define to 1 if printf and friends should be labeled with attribute
+ "__gnu_printf__" instead of "__printf__" */
+#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module scanf shall be considered present. */
+#define GNULIB_SCANF 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module strerror shall be considered present. */
+#define GNULIB_STRERROR 1
+
+/* Define to 1 when the gnulib module getdelim should be tested. */
+/* #undef GNULIB_TEST_GETDELIM */
+
+/* Define to 1 when the gnulib module getline should be tested. */
+/* #undef GNULIB_TEST_GETLINE */
+
+/* Define to 1 when the gnulib module malloc-posix should be tested. */
+/* #undef GNULIB_TEST_MALLOC_POSIX */
+
+/* Define to 1 when the gnulib module rawmemchr should be tested. */
+/* #undef GNULIB_TEST_RAWMEMCHR */
+
+/* Define to 1 when the gnulib module strchrnul should be tested. */
+/* #undef GNULIB_TEST_STRCHRNUL */
+
+/* Define to 1 when the gnulib module strerror should be tested. */
+/* #undef GNULIB_TEST_STRERROR */
+
+/* Define to 1 when the gnulib module strverscmp should be tested. */
+/* #undef GNULIB_TEST_STRVERSCMP */
+
+/* Define to 1 when the gnulib module uninorm/u32-normalize should be tested.
+ */
+/* #undef GNULIB_TEST_UNINORM_U32_NORMALIZE */
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module unistr/u32-mbtouc-unsafe shall be considered
+ present. */
+#define GNULIB_UNISTR_U32_MBTOUC_UNSAFE 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module unistr/u32-uctomb shall be considered present. */
+#define GNULIB_UNISTR_U32_UCTOMB 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module unistr/u8-mbtouc shall be considered present. */
+#define GNULIB_UNISTR_U8_MBTOUC 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module unistr/u8-mbtoucr shall be considered present. */
+#define GNULIB_UNISTR_U8_MBTOUCR 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module unistr/u8-mbtouc-unsafe shall be considered
+ present. */
+#define GNULIB_UNISTR_U8_MBTOUC_UNSAFE 1
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module unistr/u8-uctomb shall be considered present. */
+#define GNULIB_UNISTR_U8_UCTOMB 1
+
+/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
+ may be supplied by this distribution. */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#define HAVE_DCGETTEXT 1
+
+/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
+ don't. */
+#define HAVE_DECL_GETC_UNLOCKED 0
+
+/* Define to 1 if you have the declaration of `getdelim', and to 0 if you
+ don't. */
+#define HAVE_DECL_GETDELIM 0
+
+/* Define to 1 if you have the declaration of `getline', and to 0 if you
+ don't. */
+#define HAVE_DECL_GETLINE 0
+
+/* Define to 1 if you have the declaration of `program_invocation_name', and
+ to 0 if you don't. */
+#define HAVE_DECL_PROGRAM_INVOCATION_NAME 0
+
+/* Define to 1 if you have the declaration of `program_invocation_short_name',
+ and to 0 if you don't. */
+#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 0
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#define HAVE_DECL_STRERROR_R 0
+
+/* Define to 1 if you have the declaration of `__argv', and to 0 if you don't.
+ */
+#define HAVE_DECL___ARGV 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the `flockfile' function. */
+/* #undef HAVE_FLOCKFILE */
+
+/* Define to 1 if you have the `funlockfile' function. */
+/* #undef HAVE_FUNLOCKFILE */
+
+/* Define to 1 if you have the 'getdelim' function. */
+/* #undef HAVE_GETDELIM */
+
+/* Define to 1 if you have the 'getexecname' function. */
+/* #undef HAVE_GETEXECNAME */
+
+/* Define to 1 if you have the 'getprogname' function. */
+/* #undef HAVE_GETPROGNAME */
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#define HAVE_GETTEXT 1
+
+/* Define if you have the iconv() function and it works. */
+#define HAVE_ICONV 1
+
+/* Define to 1 if you have the <iconv.h> header file. */
+#define HAVE_ICONV_H 1
+
+/* Define to 1 if the compiler supports one of the keywords 'inline',
+ '__inline__', '__inline' and effectively inlines functions marked as such.
+ */
+#define HAVE_INLINE 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+/* #undef HAVE_LANGINFO_CODESET */
+
+/* Define if you have the libunistring library. */
+/* #undef HAVE_LIBUNISTRING */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if the system has the type 'long long int'. */
+#define HAVE_LONG_LONG_INT 1
+
+/* Define if the 'malloc' function is POSIX compliant. */
+/* #undef HAVE_MALLOC_POSIX */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 on MSVC platforms that have the "invalid parameter handler"
+ concept. */
+#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1
+
+/* Define to 1 if you have the `rawmemchr' function. */
+/* #undef HAVE_RAWMEMCHR */
+
+/* Define to 1 if atoll is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ATOLL 1
+
+/* Define to 1 if canonicalize_file_name is declared even after undefining
+ macros. */
+/* #undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME */
+
+/* Define to 1 if chdir is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_CHDIR */
+
+/* Define to 1 if chown is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_CHOWN */
+
+/* Define to 1 if dprintf is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_DPRINTF */
+
+/* Define to 1 if dup is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_DUP */
+
+/* Define to 1 if dup2 is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_DUP2 */
+
+/* Define to 1 if dup3 is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_DUP3 */
+
+/* Define to 1 if endusershell is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_ENDUSERSHELL */
+
+/* Define to 1 if environ is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_ENVIRON */
+
+/* Define to 1 if euidaccess is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_EUIDACCESS */
+
+/* Define to 1 if faccessat is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FACCESSAT */
+
+/* Define to 1 if fchdir is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FCHDIR */
+
+/* Define to 1 if fchownat is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FCHOWNAT */
+
+/* Define to 1 if fdatasync is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FDATASYNC */
+
+/* Define to 1 if ffsl is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FFSL */
+
+/* Define to 1 if ffsll is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FFSLL */
+
+/* Define to 1 if fpurge is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FPURGE */
+
+/* Define to 1 if fseeko is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FSEEKO 1
+
+/* Define to 1 if fsync is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FSYNC */
+
+/* Define to 1 if ftello is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FTELLO 1
+
+/* Define to 1 if ftruncate is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FTRUNCATE 1
+
+/* Define to 1 if getcwd is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETCWD */
+
+/* Define to 1 if getdelim is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETDELIM */
+
+/* Define to 1 if getdomainname is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETDOMAINNAME */
+
+/* Define to 1 if getdtablesize is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETDTABLESIZE */
+
+/* Define to 1 if getgroups is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETGROUPS */
+
+/* Define to 1 if gethostname is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETHOSTNAME */
+
+/* Define to 1 if getline is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETLINE */
+
+/* Define to 1 if getloadavg is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETLOADAVG */
+
+/* Define to 1 if getlogin is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETLOGIN */
+
+/* Define to 1 if getlogin_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETLOGIN_R */
+
+/* Define to 1 if getpagesize is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETPAGESIZE */
+
+/* Define to 1 if gets is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETS */
+
+/* Define to 1 if getsubopt is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETSUBOPT */
+
+/* Define to 1 if getusershell is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETUSERSHELL */
+
+/* Define to 1 if grantpt is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GRANTPT */
+
+/* Define to 1 if group_member is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GROUP_MEMBER */
+
+/* Define to 1 if initstate is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_INITSTATE */
+
+/* Define to 1 if initstate_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_INITSTATE_R */
+
+/* Define to 1 if isatty is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_ISATTY */
+
+/* Define to 1 if lchown is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_LCHOWN */
+
+/* Define to 1 if link is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_LINK */
+
+/* Define to 1 if linkat is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_LINKAT */
+
+/* Define to 1 if lseek is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_LSEEK */
+
+/* Define to 1 if memmem is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_MEMMEM */
+
+/* Define to 1 if mempcpy is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_MEMPCPY */
+
+/* Define to 1 if memrchr is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_MEMRCHR */
+
+/* Define to 1 if mkdtemp is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_MKDTEMP */
+
+/* Define to 1 if mkostemp is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_MKOSTEMP */
+
+/* Define to 1 if mkostemps is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_MKOSTEMPS */
+
+/* Define to 1 if mkstemp is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_MKSTEMP */
+
+/* Define to 1 if mkstemps is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_MKSTEMPS */
+
+/* Define to 1 if pclose is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_PCLOSE */
+
+/* Define to 1 if pipe is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_PIPE */
+
+/* Define to 1 if pipe2 is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_PIPE2 */
+
+/* Define to 1 if popen is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_POPEN */
+
+/* Define to 1 if posix_openpt is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_POSIX_OPENPT */
+
+/* Define to 1 if pread is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_PREAD */
+
+/* Define to 1 if ptsname is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_PTSNAME */
+
+/* Define to 1 if ptsname_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_PTSNAME_R */
+
+/* Define to 1 if pwrite is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_PWRITE */
+
+/* Define to 1 if qsort_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_QSORT_R */
+
+/* Define to 1 if random is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_RANDOM */
+
+/* Define to 1 if random_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_RANDOM_R */
+
+/* Define to 1 if rawmemchr is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_RAWMEMCHR */
+
+/* Define to 1 if readlink is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_READLINK */
+
+/* Define to 1 if readlinkat is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_READLINKAT */
+
+/* Define to 1 if realpath is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_REALPATH */
+
+/* Define to 1 if renameat is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_RENAMEAT */
+
+/* Define to 1 if rmdir is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_RMDIR */
+
+/* Define to 1 if rpmatch is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_RPMATCH */
+
+/* Define to 1 if secure_getenv is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SECURE_GETENV */
+
+/* Define to 1 if setenv is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SETENV */
+
+/* Define to 1 if sethostname is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SETHOSTNAME */
+
+/* Define to 1 if setstate is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SETSTATE */
+
+/* Define to 1 if setstate_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SETSTATE_R */
+
+/* Define to 1 if setusershell is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SETUSERSHELL */
+
+/* Define to 1 if sleep is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SLEEP 1
+
+/* Define to 1 if snprintf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SNPRINTF 1
+
+/* Define to 1 if srandom is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SRANDOM */
+
+/* Define to 1 if srandom_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SRANDOM_R */
+
+/* Define to 1 if stpcpy is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STPCPY */
+
+/* Define to 1 if stpncpy is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STPNCPY */
+
+/* Define to 1 if strcasestr is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRCASESTR */
+
+/* Define to 1 if strchrnul is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRCHRNUL */
+
+/* Define to 1 if strdup is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRDUP 1
+
+/* Define to 1 if strerror_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRERROR_R */
+
+/* Define to 1 if strncat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRNCAT 1
+
+/* Define to 1 if strndup is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRNDUP */
+
+/* Define to 1 if strnlen is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRNLEN 1
+
+/* Define to 1 if strpbrk is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRPBRK */
+
+/* Define to 1 if strsep is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRSEP */
+
+/* Define to 1 if strsignal is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRSIGNAL */
+
+/* Define to 1 if strtod is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRTOD 1
+
+/* Define to 1 if strtok_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRTOK_R */
+
+/* Define to 1 if strtoll is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRTOLL */
+
+/* Define to 1 if strtoull is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRTOULL */
+
+/* Define to 1 if strverscmp is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_STRVERSCMP */
+
+/* Define to 1 if symlink is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SYMLINK */
+
+/* Define to 1 if symlinkat is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_SYMLINKAT */
+
+/* Define to 1 if tmpfile is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_TMPFILE */
+
+/* Define to 1 if truncate is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TRUNCATE 1
+
+/* Define to 1 if ttyname_r is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_TTYNAME_R */
+
+/* Define to 1 if unlink is declared even after undefining macros. */
+#define HAVE_RAW_DECL_UNLINK 1
+
+/* Define to 1 if unlinkat is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_UNLINKAT */
+
+/* Define to 1 if unlockpt is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_UNLOCKPT */
+
+/* Define to 1 if unsetenv is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_UNSETENV */
+
+/* Define to 1 if usleep is declared even after undefining macros. */
+#define HAVE_RAW_DECL_USLEEP 1
+
+/* Define to 1 if vdprintf is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_VDPRINTF */
+
+/* Define to 1 if vsnprintf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_VSNPRINTF 1
+
+/* Define to 1 if _Exit is declared even after undefining macros. */
+#define HAVE_RAW_DECL__EXIT 1
+
+/* Define to 1 if 'sig_atomic_t' is a signed integer type. */
+/* #undef HAVE_SIGNED_SIG_ATOMIC_T */
+
+/* Define to 1 if 'wchar_t' is a signed integer type. */
+/* #undef HAVE_SIGNED_WCHAR_T */
+
+/* Define to 1 if 'wint_t' is a signed integer type. */
+/* #undef HAVE_SIGNED_WINT_T */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchrnul' function. */
+/* #undef HAVE_STRCHRNUL */
+
+/* Define to 1 if you have the `strerror_r' function. */
+/* #undef HAVE_STRERROR_R */
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strverscmp' function. */
+/* #undef HAVE_STRVERSCMP */
+
+/* Define to 1 if you have the 'symlink' function. */
+/* #undef HAVE_SYMLINK */
+
+/* Define to 1 if you have the <sys/bitypes.h> header file. */
+/* #undef HAVE_SYS_BITYPES_H */
+
+/* Define to 1 if you have the <sys/inttypes.h> header file. */
+/* #undef HAVE_SYS_INTTYPES_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if the system has the type 'unsigned long long int'. */
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+
+/* Define if you have a global __progname variable */
+/* #undef HAVE_VAR___PROGNAME */
+
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+ declarations. */
+/* #undef HAVE_VISIBILITY */
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define if you have the 'wchar_t' type. */
+#define HAVE_WCHAR_T 1
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#define HAVE_WINSOCK2_H 1
+
+/* Define if you have the 'wint_t' type. */
+#define HAVE_WINT_T 1
+
+/* Define to 1 if O_NOATIME works. */
+#define HAVE_WORKING_O_NOATIME 0
+
+/* Define to 1 if O_NOFOLLOW works. */
+#define HAVE_WORKING_O_NOFOLLOW 0
+
+/* Define to 1 if the system has the type `_Bool'. */
+#define HAVE__BOOL 1
+
+/* Define to 1 if you have the '_set_invalid_parameter_handler' function. */
+#define HAVE__SET_INVALID_PARAMETER_HANDLER 1
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST
+
+/* Define to a symbolic name denoting the flavor of iconv_open()
+ implementation. */
+/* #undef ICONV_FLAVOR */
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */
+#define MALLOC_0_IS_NONNULL 1
+
+/* Use GNU style printf and scanf. */
+#ifndef __USE_MINGW_ANSI_STDIO
+# define __USE_MINGW_ANSI_STDIO 1
+#endif
+
+
+/* Name of package */
+#define PACKAGE "libidn2"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "help-libidn@gnu.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libidn2"
+
+/* String identifying the packager of this software */
+/* #undef PACKAGE_PACKAGER */
+
+/* Packager info for bug reports (URL/e-mail/...) */
+/* #undef PACKAGE_PACKAGER_BUG_REPORTS */
+
+/* Packager-specific version information */
+/* #undef PACKAGE_PACKAGER_VERSION */
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libidn2 2.0.4"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libidn2"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "https://www.gnu.org/software/libidn/#libidn2"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.0.4"
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'ptrdiff_t'. */
+/* #undef PTRDIFF_T_SUFFIX */
+
+/* Define to 1 if strerror(0) does not return a message implying success. */
+/* #undef REPLACE_STRERROR_0 */
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'sig_atomic_t'. */
+/* #undef SIG_ATOMIC_T_SUFFIX */
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'size_t'. */
+/* #undef SIZE_T_SUFFIX */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if strerror_r returns char *. */
+/* #undef STRERROR_R_CHAR_P */
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable general extensions on macOS. */
+#ifndef _DARWIN_C_SOURCE
+# define _DARWIN_C_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# define __STDC_WANT_IEC_60559_DFP_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
+#ifndef __STDC_WANT_LIB_EXT2__
+# define __STDC_WANT_LIB_EXT2__ 1
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009. */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# define __STDC_WANT_MATH_SPEC_FUNCS__ 1
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+/* # undef _XOPEN_SOURCE */
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
+/* Version number of package */
+#define VERSION "2.0.4"
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'wchar_t'. */
+/* #undef WCHAR_T_SUFFIX */
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'wint_t'. */
+/* #undef WINT_T_SUFFIX */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */
+/* #undef _NETBSD_SOURCE */
+
+/* The _Noreturn keyword of C11. */
+#if ! (defined _Noreturn \
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for 'stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* For standard stat data types on VMS. */
+#define _USE_STD_STAT 1
+
+/* Define to 1 if the system <stdint.h> predates C++11. */
+/* #undef __STDC_CONSTANT_MACROS */
+
+/* Define to 1 if the system <stdint.h> predates C++11. */
+/* #undef __STDC_LIMIT_MACROS */
+
+/* Please see the Gnulib manual for how to use these macros.
+
+ Suppress extern inline with HP-UX cc, as it appears to be broken; see
+ <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+
+ Suppress extern inline with Sun C in standards-conformance mode, as it
+ mishandles inline functions that call each other. E.g., for 'inline void f
+ (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+ 'reference to static identifier "f" in extern inline function'.
+ This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+ Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+ on configurations that mistakenly use 'static inline' to implement
+ functions or macros in standard C headers like <ctype.h>. For example,
+ if isdigit is mistakenly implemented via a static inline function,
+ a program containing an extern inline function that calls isdigit
+ may not work since the C standard prohibits extern inline functions
+ from calling static functions. This bug is known to occur on:
+
+ OS X 10.8 and earlier; see:
+ http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+
+ DragonFly; see
+ http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+
+ FreeBSD; see:
+ http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+
+ OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+ for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
+ Assume DragonFly and FreeBSD will be similar. */
+#if (((defined __APPLE__ && defined __MACH__) \
+ || defined __DragonFly__ || defined __FreeBSD__) \
+ && (defined __header_inline \
+ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+ && ! defined __clang__) \
+ : ((! defined _DONT_USE_CTYPE_INLINE_ \
+ && (defined __GNUC__ || defined __cplusplus)) \
+ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+ && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
+#if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : (199901L <= __STDC_VERSION__ \
+ && !defined __HP_cc \
+ && !defined __PGI \
+ && !(defined __SUNPRO_C && __STDC__))) \
+ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
+ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
+# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+# define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
+#else
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#endif
+
+/* In GCC 4.6 (inclusive) to 5.1 (exclusive),
+ suppress bogus "no previous prototype for 'FOO'"
+ and "no previous declaration for 'FOO'" diagnostics,
+ when FOO is an inline function in the header; see
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
+#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+# define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+# define _GL_INLINE_HEADER_CONST_PRAGMA \
+ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+ _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif
+
+/* A replacement for va_copy, if needed. */
+#define gl_va_copy(a,b) ((a) = (b))
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+ the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+ earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
+ __APPLE__ && __MACH__ test for Mac OS X.
+ __APPLE_CC__ tests for the Apple compiler and its version.
+ __STDC_VERSION__ tests for the C99 mode. */
+#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
+# define __GNUC_STDC_INLINE__ 1
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef mode_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+#define restrict __restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define as a signed type of the same size as size_t. */
+#define ssize_t intptr_t
+
+/* Define as a marker that can be attached to declarations that might not
+ be used. This helps to reduce warnings, such as from
+ GCC -Wunused-parameter. */
+#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_UNUSED
+#endif
+/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
+ is a misnomer outside of parameter lists. */
+#define _UNUSED_PARAMETER_ _GL_UNUSED
+
+/* gcc supports the "unused" attribute on possibly unused labels, and
+ g++ has since version 4.5. Note to support C++ as well as C,
+ _GL_UNUSED_LABEL should be used with a trailing ; */
+#if !defined __cplusplus || __GNUC__ > 4 \
+ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define _GL_UNUSED_LABEL _GL_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+
+/* The __pure__ attribute was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The __const__ attribute was added in gcc 2.95. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
+
+
+/* Define as a macro for copying va_list variables. */
+/* #undef va_copy */
diff --git a/ports/libidn2/portfile.cmake b/ports/libidn2/portfile.cmake
new file mode 100644
index 000000000..bbe8f7bbe
--- /dev/null
+++ b/ports/libidn2/portfile.cmake
@@ -0,0 +1,48 @@
+include(vcpkg_common_functions)
+
+set(IDN2_VERSION 2.0.4)
+set(IDN2_FILENAME libidn2-${IDN2_VERSION}.tar.gz)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libidn2-${IDN2_VERSION})
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}"
+ FILENAME "${IDN2_FILENAME}"
+ SHA512 1e51bd4b8f8907531576291f1c2a8865d17429b4105418b4c98754eb982cd1cbb3adbeab4ec0c1c561d2dba11d876c7c09e5dc5b315c55a2c24986d7a2a3b4d2
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH})
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/string.h DESTINATION ${SOURCE_PATH}/gl)
+
+function(simple_copy_template_header FILE_PATH BASE_NAME)
+ if(NOT EXISTS ${FILE_PATH}/${BASE_NAME}.h)
+ if(EXISTS ${FILE_PATH}/${BASE_NAME}.in.h)
+ configure_file(${FILE_PATH}/${BASE_NAME}.in.h ${FILE_PATH}/${BASE_NAME}.h)
+ endif()
+ endif()
+endfunction()
+
+# There seems to be no difference between source and destination files after 'configure'
+# apart from auto-generated notification at the top. So why not just do a simple copy.
+simple_copy_template_header(${SOURCE_PATH}/unistring uniconv)
+simple_copy_template_header(${SOURCE_PATH}/unistring unictype)
+simple_copy_template_header(${SOURCE_PATH}/unistring uninorm)
+simple_copy_template_header(${SOURCE_PATH}/unistring unistr)
+simple_copy_template_header(${SOURCE_PATH}/unistring unitypes)
+simple_copy_template_header(${SOURCE_PATH}/unistring alloca)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# License and man
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libidn2 RENAME copyright)
+file(INSTALL ${SOURCE_PATH}/doc/libidn2.pdf DESTINATION ${CURRENT_PACKAGES_DIR}/share/libidn2)
+
+vcpkg_copy_pdbs()
diff --git a/ports/libidn2/string.h b/ports/libidn2/string.h
new file mode 100644
index 000000000..7ed5f5fdc
--- /dev/null
+++ b/ports/libidn2/string.h
@@ -0,0 +1,10 @@
+#ifndef _GL_STRING_H
+#define _GL_STRING_H
+
+char * strchrnul (const char *s, int c_in);
+int strverscmp (const char *s1, const char *s2);
+void * rawmemchr (const void *s, int c_in);
+
+#include <../ucrt/string.h>
+
+#endif /* _GL_STRING_H */