include strtonum for ocspcheck

This commit is contained in:
Brent Cook 2020-10-18 20:47:10 -05:00
parent 01c146e3a5
commit 6359d9404d
4 changed files with 13 additions and 0 deletions

1
.gitignore vendored
View File

@ -141,6 +141,7 @@ include/openssl/*.h
/apps/ocspcheck/ocspcheck*
/apps/ocspcheck/compat/memmem.c
/apps/ocspcheck/compat/inet_ntop.c
/apps/ocspcheck/compat/strtonum.c
/apps/nc/*.h
/apps/nc/*.c

View File

@ -13,6 +13,13 @@ else()
set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c)
endif()
check_function_exists(strtonum HAVE_STRTONUM)
if(HAVE_STRTONUM)
add_definitions(-DHAVE_STRTONUM)
else()
set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/strtonum.c)
endif()
if(NOT "${OPENSSLDIR}" STREQUAL "")
add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
else()

View File

@ -19,3 +19,7 @@ noinst_HEADERS = http.h
if !HAVE_MEMMEM
ocspcheck_SOURCES += compat/memmem.c
endif
if !HAVE_STRTONUM
ocspcheck_SOURCES += compat/strtonum.c
endif

View File

@ -254,6 +254,7 @@ echo "copying ocspcheck(1) source"
$CP $sbin_src/ocspcheck/ocspcheck.8 apps/ocspcheck
rm -f apps/ocspcheck/*.c apps/ocspcheck/*.h
$CP_LIBC $libc_src/string/memmem.c apps/ocspcheck/compat
$CP_LIBC $libc_src/stdlib/strtonum.c apps/ocspcheck/compat
for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/ocspcheck/Makefile.am` ; do
if [ -e $sbin_src/ocspcheck/$i ]; then
$CP $sbin_src/ocspcheck/$i apps/ocspcheck