add compat getopt implementation, remove patches

This adds a getopt implementation for compatibility where it is not
available, removing a couple of regress patches.

Note, this is a slightly modified copy from OpenBSD libc that doesn't
expose getopt_long, which has dependency conflicts with Windows system
headers and isn't needed anyway.
This commit is contained in:
Brent Cook
2023-07-07 11:46:21 +03:00
parent e06ce19f95
commit 7463f87cf1
8 changed files with 594 additions and 37 deletions

View File

@@ -818,6 +818,11 @@ if(NOT HAVE_FREEZERO)
set(EXTRA_EXPORT ${EXTRA_EXPORT} freezero)
endif()
if(NOT HAVE_GETOPT)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/getopt_long.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} getopt)
endif()
if(NOT HAVE_GETPAGESIZE)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/getpagesize.c)
endif()