aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkinichiro <kinichiro.inoguchi@gmail.com>2021-12-26 15:42:47 +0900
committerkinichiro <kinichiro.inoguchi@gmail.com>2021-12-26 16:00:25 +0900
commitadde656bb7a859fb4cc334cb89a00840a7023c2e (patch)
treef366c790f1e3afc3782b7f5224a823b2c9b8993b
parent1b95c5d584c5db4f08160299f5bf66acf654875d (diff)
downloadportable-adde656bb7a859fb4cc334cb89a00840a7023c2e.tar.gz
portable-adde656bb7a859fb4cc334cb89a00840a7023c2e.tar.bz2
portable-adde656bb7a859fb4cc334cb89a00840a7023c2e.zip
Add strtonum to compat library and export it
crypto library requires strtonum now, and add it to compat library. remove it from applications compat/ directories.
-rw-r--r--apps/nc/CMakeLists.txt8
-rw-r--r--apps/nc/Makefile.am4
-rw-r--r--apps/ocspcheck/CMakeLists.txt8
-rw-r--r--apps/ocspcheck/Makefile.am4
-rw-r--r--apps/openssl/CMakeLists.txt8
-rw-r--r--apps/openssl/Makefile.am4
-rw-r--r--crypto/CMakeLists.txt5
-rw-r--r--crypto/Makefile.am7
-rw-r--r--tests/optionstest.c1
-rwxr-xr-xupdate.sh4
10 files changed, 13 insertions, 40 deletions
diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt
index e873de8..bd59211 100644
--- a/apps/nc/CMakeLists.txt
+++ b/apps/nc/CMakeLists.txt
@@ -29,14 +29,6 @@ else()
29 set(NC_SRC ${NC_SRC} compat/readpassphrase.c) 29 set(NC_SRC ${NC_SRC} compat/readpassphrase.c)
30endif() 30endif()
31 31
32check_function_exists(strtonum HAVE_STRTONUM)
33if(HAVE_STRTONUM AND CMAKE_SYSTEM_NAME MATCHES "Darwin" AND
34 CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20)
35 add_definitions(-DHAVE_STRTONUM)
36else()
37 set(NC_SRC ${NC_SRC} compat/strtonum.c)
38endif()
39
40if(NOT "${OPENSSLDIR}" STREQUAL "") 32if(NOT "${OPENSSLDIR}" STREQUAL "")
41 add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") 33 add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
42else() 34else()
diff --git a/apps/nc/Makefile.am b/apps/nc/Makefile.am
index 58b5c01..e9db6e5 100644
--- a/apps/nc/Makefile.am
+++ b/apps/nc/Makefile.am
@@ -43,8 +43,4 @@ if !HAVE_READPASSPHRASE
43nc_SOURCES += compat/readpassphrase.c 43nc_SOURCES += compat/readpassphrase.c
44endif 44endif
45 45
46if !HAVE_STRTONUM
47nc_SOURCES += compat/strtonum.c
48endif
49
50endif 46endif
diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt
index 249f0f4..2dddb6e 100644
--- a/apps/ocspcheck/CMakeLists.txt
+++ b/apps/ocspcheck/CMakeLists.txt
@@ -13,14 +13,6 @@ else()
13 set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c) 13 set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c)
14endif() 14endif()
15 15
16check_function_exists(strtonum HAVE_STRTONUM)
17if(HAVE_STRTONUM AND CMAKE_SYSTEM_NAME MATCHES "Darwin" AND
18 CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20)
19 add_definitions(-DHAVE_STRTONUM)
20else()
21 set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/strtonum.c)
22endif()
23
24if(NOT "${OPENSSLDIR}" STREQUAL "") 16if(NOT "${OPENSSLDIR}" STREQUAL "")
25 add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\") 17 add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
26else() 18else()
diff --git a/apps/ocspcheck/Makefile.am b/apps/ocspcheck/Makefile.am
index 71a73ea..7c7b454 100644
--- a/apps/ocspcheck/Makefile.am
+++ b/apps/ocspcheck/Makefile.am
@@ -22,7 +22,3 @@ noinst_HEADERS = http.h
22if !HAVE_MEMMEM 22if !HAVE_MEMMEM
23ocspcheck_SOURCES += compat/memmem.c 23ocspcheck_SOURCES += compat/memmem.c
24endif 24endif
25
26if !HAVE_STRTONUM
27ocspcheck_SOURCES += compat/strtonum.c
28endif
diff --git a/apps/openssl/CMakeLists.txt b/apps/openssl/CMakeLists.txt
index bb058e1..2a84178 100644
--- a/apps/openssl/CMakeLists.txt
+++ b/apps/openssl/CMakeLists.txt
@@ -61,14 +61,6 @@ if(WIN32)
61 set(OPENSSL_SRC ${OPENSSL_SRC} compat/poll_win.c) 61 set(OPENSSL_SRC ${OPENSSL_SRC} compat/poll_win.c)
62endif() 62endif()
63 63
64check_function_exists(strtonum HAVE_STRTONUM)
65if(HAVE_STRTONUM AND CMAKE_SYSTEM_NAME MATCHES "Darwin" AND
66 CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20)
67 add_definitions(-DHAVE_STRTONUM)
68else()
69 set(OPENSSL_SRC ${OPENSSL_SRC} compat/strtonum.c)
70endif()
71
72if(CMAKE_SYSTEM_NAME MATCHES "Darwin") 64if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
73 check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) 65 check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
74 if(NOT HAVE_CLOCK_GETTIME) 66 if(NOT HAVE_CLOCK_GETTIME)
diff --git a/apps/openssl/Makefile.am b/apps/openssl/Makefile.am
index b98e08d..7cbac48 100644
--- a/apps/openssl/Makefile.am
+++ b/apps/openssl/Makefile.am
@@ -84,10 +84,6 @@ openssl_SOURCES += compat/clock_gettime_osx.c
84endif 84endif
85endif 85endif
86 86
87if !HAVE_STRTONUM
88openssl_SOURCES += compat/strtonum.c
89endif
90
91noinst_HEADERS = apps.h 87noinst_HEADERS = apps.h
92noinst_HEADERS += progs.h 88noinst_HEADERS += progs.h
93noinst_HEADERS += s_apps.h 89noinst_HEADERS += s_apps.h
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 12bc8ae..196ae4a 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -888,6 +888,11 @@ if(NOT HAVE_STRSEP)
888 set(EXTRA_EXPORT ${EXTRA_EXPORT} strsep) 888 set(EXTRA_EXPORT ${EXTRA_EXPORT} strsep)
889endif() 889endif()
890 890
891if(NOT HAVE_STRTONUM)
892 set(CRYPTO_SRC ${CRYPTO_SRC} compat/strtonum.c)
893 set(EXTRA_EXPORT ${EXTRA_EXPORT} strtonum)
894endif()
895
891if(NOT HAVE_SYSLOG_R) 896if(NOT HAVE_SYSLOG_R)
892 set(CRYPTO_SRC ${CRYPTO_SRC} compat/syslog_r.c) 897 set(CRYPTO_SRC ${CRYPTO_SRC} compat/syslog_r.c)
893endif() 898endif()
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index 155df59..42d0dd9 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -76,6 +76,9 @@ endif
76if !HAVE_STRSEP 76if !HAVE_STRSEP
77 -echo strsep >> crypto_portable.sym 77 -echo strsep >> crypto_portable.sym
78endif 78endif
79if !HAVE_STRTONUM
80 -echo strtonum >> crypto_portable.sym
81endif
79if !HAVE_TIMEGM 82if !HAVE_TIMEGM
80 -echo timegm >> crypto_portable.sym 83 -echo timegm >> crypto_portable.sym
81endif 84endif
@@ -175,6 +178,10 @@ if !HAVE_STRSEP
175libcompat_la_SOURCES += compat/strsep.c 178libcompat_la_SOURCES += compat/strsep.c
176endif 179endif
177 180
181if !HAVE_STRTONUM
182libcompat_la_SOURCES += compat/strtonum.c
183endif
184
178if !HAVE_ASPRINTF 185if !HAVE_ASPRINTF
179libcompat_la_SOURCES += compat/bsd-asprintf.c 186libcompat_la_SOURCES += compat/bsd-asprintf.c
180endif 187endif
diff --git a/tests/optionstest.c b/tests/optionstest.c
index e860f0d..af9dc1e 100644
--- a/tests/optionstest.c
+++ b/tests/optionstest.c
@@ -24,7 +24,6 @@
24 24
25#include <apps.h> 25#include <apps.h>
26#include <apps.c> 26#include <apps.c>
27#include <strtonum.c>
28 27
29/* Needed to keep apps.c happy... */ 28/* Needed to keep apps.c happy... */
30BIO *bio_err; 29BIO *bio_err;
diff --git a/update.sh b/update.sh
index 311ce4e..265afab 100755
--- a/update.sh
+++ b/update.sh
@@ -82,6 +82,7 @@ for i in crypto/compat; do
82 $libc_src/crypt/chacha_private.h \ 82 $libc_src/crypt/chacha_private.h \
83 $libc_src/stdlib/reallocarray.c \ 83 $libc_src/stdlib/reallocarray.c \
84 $libc_src/stdlib/recallocarray.c \ 84 $libc_src/stdlib/recallocarray.c \
85 $libc_src/stdlib/strtonum.c \
85 $libc_src/string/explicit_bzero.c \ 86 $libc_src/string/explicit_bzero.c \
86 $libc_src/string/strcasecmp.c \ 87 $libc_src/string/strcasecmp.c \
87 $libc_src/string/strlcpy.c \ 88 $libc_src/string/strlcpy.c \
@@ -243,7 +244,6 @@ echo "copying nc(1) source"
243$CP $bin_src/nc/nc.1 apps/nc 244$CP $bin_src/nc/nc.1 apps/nc
244rm -f apps/nc/*.c apps/nc/*.h 245rm -f apps/nc/*.c apps/nc/*.h
245$CP_LIBC $libc_src/net/base64.c apps/nc/compat 246$CP_LIBC $libc_src/net/base64.c apps/nc/compat
246$CP_LIBC $libc_src/stdlib/strtonum.c apps/nc/compat
247for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/nc/Makefile.am` ; do 247for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/nc/Makefile.am` ; do
248 if [ -e $bin_src/nc/$i ]; then 248 if [ -e $bin_src/nc/$i ]; then
249 $CP $bin_src/nc/$i apps/nc 249 $CP $bin_src/nc/$i apps/nc
@@ -255,7 +255,6 @@ echo "copying ocspcheck(1) source"
255$CP $sbin_src/ocspcheck/ocspcheck.8 apps/ocspcheck 255$CP $sbin_src/ocspcheck/ocspcheck.8 apps/ocspcheck
256rm -f apps/ocspcheck/*.c apps/ocspcheck/*.h 256rm -f apps/ocspcheck/*.c apps/ocspcheck/*.h
257$CP_LIBC $libc_src/string/memmem.c apps/ocspcheck/compat 257$CP_LIBC $libc_src/string/memmem.c apps/ocspcheck/compat
258$CP_LIBC $libc_src/stdlib/strtonum.c apps/ocspcheck/compat
259for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/ocspcheck/Makefile.am` ; do 258for i in `awk '/SOURCES|HEADERS|MANS/ { print $3 }' apps/ocspcheck/Makefile.am` ; do
260 if [ -e $sbin_src/ocspcheck/$i ]; then 259 if [ -e $sbin_src/ocspcheck/$i ]; then
261 $CP $sbin_src/ocspcheck/$i apps/ocspcheck 260 $CP $sbin_src/ocspcheck/$i apps/ocspcheck
@@ -265,7 +264,6 @@ done
265# copy openssl(1) source 264# copy openssl(1) source
266echo "copying openssl(1) source" 265echo "copying openssl(1) source"
267$CP $bin_src/openssl/openssl.1 apps/openssl 266$CP $bin_src/openssl/openssl.1 apps/openssl
268$CP_LIBC $libc_src/stdlib/strtonum.c apps/openssl/compat
269$CP $libcrypto_src/cert.pem . 267$CP $libcrypto_src/cert.pem .
270$CP $libcrypto_src/openssl.cnf . 268$CP $libcrypto_src/openssl.cnf .
271$CP $libcrypto_src/x509v3.cnf . 269$CP $libcrypto_src/x509v3.cnf .