diff options
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r-- | crypto/Makefile.am | 74 | ||||
-rw-r--r-- | m4/check-libc.m4 | 85 | ||||
-rwxr-xr-x | update.sh | 14 |
4 files changed, 92 insertions, 105 deletions
diff --git a/configure.ac b/configure.ac index 9fd7c2d..6f98b3e 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -54,8 +54,6 @@ CHECK_CRYPTO_COMPAT | |||
54 | CHECK_VA_COPY | 54 | CHECK_VA_COPY |
55 | CHECK_B64_NTOP | 55 | CHECK_B64_NTOP |
56 | 56 | ||
57 | GENERATE_CRYPTO_PORTABLE_SYM | ||
58 | |||
59 | AC_ARG_WITH([openssldir], | 57 | AC_ARG_WITH([openssldir], |
60 | AS_HELP_STRING([--with-openssldir], | 58 | AS_HELP_STRING([--with-openssldir], |
61 | [Set the default openssl directory]), | 59 | [Set the default openssl directory]), |
@@ -80,19 +78,15 @@ AC_TRY_COMPILE([#include "$srcdir/crypto/modes/modes_lcl.h"], | |||
80 | BSWAP4=no) | 78 | BSWAP4=no) |
81 | CFLAGS="$old_cflags" | 79 | CFLAGS="$old_cflags" |
82 | 80 | ||
83 | case $host_cpu in | 81 | AS_CASE([$host_cpu], |
84 | *sparc*) | 82 | [*sparc*], [CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"], |
85 | CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT" | 83 | [*arm*], AS_IF([test "x$BSWAP4" = "xyes"],, |
86 | ;; | 84 | CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT"), |
87 | *arm*) | 85 | [*amd64*], [host_cpu=x86_64, HOSTARCH=intel], |
88 | AS_IF([test "x$BSWAP4" = "xyes"],, | 86 | [i?86], [HOSTARCH=intel], |
89 | CPPFLAGS="$CPPFLAGS -D__STRICT_ALIGNMENT") | 87 | [x86_64], [HOSTARCH=intel] |
90 | ;; | 88 | ) |
91 | *amd64*) | 89 | AM_CONDITIONAL([HOST_CPU_IS_INTEL], [test "x$HOSTARCH" = "xintel"]) |
92 | host_cpu=x86_64 | ||
93 | ;; | ||
94 | |||
95 | esac | ||
96 | 90 | ||
97 | AC_MSG_CHECKING([if .gnu.warning accepts long strings]) | 91 | AC_MSG_CHECKING([if .gnu.warning accepts long strings]) |
98 | AC_LINK_IFELSE([AC_LANG_SOURCE([[ | 92 | AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
diff --git a/crypto/Makefile.am b/crypto/Makefile.am index 701cd4a..046a623 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am | |||
@@ -18,6 +18,80 @@ EXTRA_DIST += compat/strcasecmp.c | |||
18 | BUILT_SOURCES = crypto_portable.sym | 18 | BUILT_SOURCES = crypto_portable.sym |
19 | CLEANFILES = crypto_portable.sym | 19 | CLEANFILES = crypto_portable.sym |
20 | 20 | ||
21 | crypto_portable.sym: | ||
22 | -echo "generating crypto_portable.sym ..." | ||
23 | -cp $(top_srcdir)/crypto/crypto.sym crypto_portable.sym | ||
24 | -chmod u+w crypto_portable.sym | ||
25 | if !HAVE_ARC4RANDOM_BUF | ||
26 | -echo arc4random >> crypto_portable.sym | ||
27 | -echo arc4random_buf >> crypto_portable.sym | ||
28 | -echo arc4random_uniform >> crypto_portable.sym | ||
29 | if !HAVE_GETENTROPY | ||
30 | -echo getentropy >> crypto_portable.sym | ||
31 | endif | ||
32 | endif | ||
33 | if !HAVE_ASPRINTF | ||
34 | -echo asprintf >> crypto_portable.sym | ||
35 | -echo vasprintf >> crypto_portable.sym | ||
36 | endif | ||
37 | if !HAVE_EXPLICIT_BZERO | ||
38 | -echo explicit_bzero >> crypto_portable.sym | ||
39 | endif | ||
40 | if !HAVE_FREEZERO | ||
41 | -echo freezero >> crypto_portable.sym | ||
42 | endif | ||
43 | if !HAVE_INET_PTON | ||
44 | -echo inet_pton >> crypto_portable.sym | ||
45 | endif | ||
46 | if !HAVE_REALLOCARRAY | ||
47 | -echo reallocarray >> crypto_portable.sym | ||
48 | endif | ||
49 | if !HAVE_RECALLOCARRAY | ||
50 | -echo recallocarray >> crypto_portable.sym | ||
51 | endif | ||
52 | if !HAVE_STRLCAT | ||
53 | -echo strlcat >> crypto_portable.sym | ||
54 | endif | ||
55 | if !HAVE_STRLCPY | ||
56 | -echo strlcpy >> crypto_portable.sym | ||
57 | endif | ||
58 | if !HAVE_STRNDUP | ||
59 | -echo strndup >> crypto_portable.sym | ||
60 | endif | ||
61 | if !HAVE_STRNLEN | ||
62 | -echo strnlen >> crypto_portable.sym | ||
63 | endif | ||
64 | if !HAVE_STRSEP | ||
65 | -echo strsep >> crypto_portable.sym | ||
66 | endif | ||
67 | if !HAVE_TIMEGM | ||
68 | -echo timegm >> crypto_portable.sym | ||
69 | endif | ||
70 | if !HAVE_TIMINGSAFE_BCMP | ||
71 | -echo timingsafe_bcmp >> crypto_portable.sym | ||
72 | endif | ||
73 | if !HAVE_TIMINGSAFE_MEMCMP | ||
74 | -echo timingsafe_memcmp >> crypto_portable.sym | ||
75 | endif | ||
76 | if HOST_CPU_IS_INTEL | ||
77 | -echo OPENSSL_ia32cap_P >> crypto_portable.sym | ||
78 | endif | ||
79 | if HOST_WIN | ||
80 | -echo posix_perror >> crypto_portable.sym | ||
81 | -echo posix_fopen >> crypto_portable.sym | ||
82 | -echo posix_fgets >> crypto_portable.sym | ||
83 | -echo posix_open >> crypto_portable.sym | ||
84 | -echo posix_rename >> crypto_portable.sym | ||
85 | -echo posix_connect >> crypto_portable.sym | ||
86 | -echo posix_close >> crypto_portable.sym | ||
87 | -echo posix_read >> crypto_portable.sym | ||
88 | -echo posix_write >> crypto_portable.sym | ||
89 | -echo posix_getsockopt >> crypto_portable.sym | ||
90 | -echo posix_setsockopt >> crypto_portable.sym | ||
91 | -grep -v BIO_s_log crypto_portable.sym > crypto_portable.sym.tmp | ||
92 | -mv crypto_portable.sym.tmp crypto_portable.sym | ||
93 | endif | ||
94 | |||
21 | libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym | 95 | libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym |
22 | libcrypto_la_LIBADD = libcompat.la | 96 | libcrypto_la_LIBADD = libcompat.la |
23 | if !HAVE_EXPLICIT_BZERO | 97 | if !HAVE_EXPLICIT_BZERO |
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4 index 0b7ffb0..b1b5ef4 100644 --- a/m4/check-libc.m4 +++ b/m4/check-libc.m4 | |||
@@ -148,88 +148,3 @@ if test "x$ac_cv_have___va_copy" = "xyes" ; then | |||
148 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) | 148 | AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) |
149 | fi | 149 | fi |
150 | ]) | 150 | ]) |
151 | |||
152 | AC_DEFUN([GENERATE_CRYPTO_PORTABLE_SYM], [ | ||
153 | AS_CASE([$host_cpu], | ||
154 | [i?86], [HOSTARCH=intel], | ||
155 | [x86_64], [HOSTARCH=intel], | ||
156 | [amd64], [HOSTARCH=intel], | ||
157 | ) | ||
158 | AC_SUBST([HOSTARCH]) | ||
159 | crypto_sym=$srcdir/crypto/crypto.sym | ||
160 | crypto_p_sym=./crypto/crypto_portable.sym | ||
161 | echo "generating $crypto_p_sym ..." | ||
162 | mkdir -p ./crypto | ||
163 | cp $crypto_sym $crypto_p_sym | ||
164 | chmod u+w $crypto_p_sym | ||
165 | if test "x$ac_cv_func_arc4random_buf" = "xno" ; then | ||
166 | echo arc4random >> $crypto_p_sym | ||
167 | echo arc4random_buf >> $crypto_p_sym | ||
168 | echo arc4random_uniform >> $crypto_p_sym | ||
169 | if test "x$ac_cv_func_getentropy" = "xno" ; then | ||
170 | echo getentropy >> $crypto_p_sym | ||
171 | fi | ||
172 | fi | ||
173 | if test "x$ac_cv_func_asprintf" = "xno" ; then | ||
174 | echo asprintf >> $crypto_p_sym | ||
175 | echo vasprintf >> $crypto_p_sym | ||
176 | fi | ||
177 | if test "x$ac_cv_func_explicit_bzero" = "xno" ; then | ||
178 | echo explicit_bzero >> $crypto_p_sym | ||
179 | fi | ||
180 | if test "x$ac_cv_func_freezero" = "xno" ; then | ||
181 | echo freezero >> $crypto_p_sym | ||
182 | fi | ||
183 | if test "x$ac_cv_func_inet_pton" = "xno" ; then | ||
184 | echo inet_pton >> $crypto_p_sym | ||
185 | fi | ||
186 | if test "x$ac_cv_func_reallocarray" = "xno" ; then | ||
187 | echo reallocarray >> $crypto_p_sym | ||
188 | fi | ||
189 | if test "x$ac_cv_func_recallocarray" = "xno" ; then | ||
190 | echo recallocarray >> $crypto_p_sym | ||
191 | fi | ||
192 | if test "x$ac_cv_func_strlcat" = "xno" ; then | ||
193 | echo strlcat >> $crypto_p_sym | ||
194 | fi | ||
195 | if test "x$ac_cv_func_strlcpy" = "xno" ; then | ||
196 | echo strlcpy >> $crypto_p_sym | ||
197 | fi | ||
198 | if test "x$ac_cv_func_strndup" = "xno" ; then | ||
199 | echo strndup >> $crypto_p_sym | ||
200 | fi | ||
201 | if test "x$ac_cv_func_strnlen" = "xno" ; then | ||
202 | echo strnlen >> $crypto_p_sym | ||
203 | fi | ||
204 | if test "x$ac_cv_func_strsep" = "xno" ; then | ||
205 | echo strsep >> $crypto_p_sym | ||
206 | fi | ||
207 | if test "x$ac_cv_func_timegm" = "xno" ; then | ||
208 | echo timegm >> $crypto_p_sym | ||
209 | fi | ||
210 | if test "x$ac_cv_func_timingsafe_bcmp" = "xno" ; then | ||
211 | echo timingsafe_bcmp >> $crypto_p_sym | ||
212 | fi | ||
213 | if test "x$ac_cv_func_timingsafe_memcmp" = "xno" ; then | ||
214 | echo timingsafe_memcmp >> $crypto_p_sym | ||
215 | fi | ||
216 | if test "x$HOSTARCH" = "xintel" ; then | ||
217 | echo OPENSSL_ia32cap_P >> $crypto_p_sym | ||
218 | fi | ||
219 | if test "x$HOST_OS" = "xwin" ; then | ||
220 | echo posix_perror >> $crypto_p_sym | ||
221 | echo posix_fopen >> $crypto_p_sym | ||
222 | echo posix_fgets >> $crypto_p_sym | ||
223 | echo posix_open >> $crypto_p_sym | ||
224 | echo posix_rename >> $crypto_p_sym | ||
225 | echo posix_connect >> $crypto_p_sym | ||
226 | echo posix_close >> $crypto_p_sym | ||
227 | echo posix_read >> $crypto_p_sym | ||
228 | echo posix_write >> $crypto_p_sym | ||
229 | echo posix_getsockopt >> $crypto_p_sym | ||
230 | echo posix_setsockopt >> $crypto_p_sym | ||
231 | |||
232 | grep -v BIO_s_log $crypto_p_sym > $crypto_p_sym.tmp | ||
233 | mv $crypto_p_sym.tmp $crypto_p_sym | ||
234 | fi | ||
235 | ]) | ||
@@ -63,6 +63,10 @@ do_cp_libc() { | |||
63 | CP_LIBC='do_cp_libc' | 63 | CP_LIBC='do_cp_libc' |
64 | 64 | ||
65 | CP='cp -p' | 65 | CP='cp -p' |
66 | GREP='grep' | ||
67 | if [ -x /opt/csw/bin/ggrep ]; then | ||
68 | GREP='/opt/csw/bin/ggrep' | ||
69 | fi | ||
66 | 70 | ||
67 | $CP $libssl_src/LICENSE COPYING | 71 | $CP $libssl_src/LICENSE COPYING |
68 | 72 | ||
@@ -152,7 +156,7 @@ done | |||
152 | $CP crypto/compat/b_win.c crypto/bio | 156 | $CP crypto/compat/b_win.c crypto/bio |
153 | $CP crypto/compat/ui_openssl_win.c crypto/ui | 157 | $CP crypto/compat/ui_openssl_win.c crypto/ui |
154 | # add the libcrypto symbol export list | 158 | # add the libcrypto symbol export list |
155 | grep -v OPENSSL_ia32cap_P $libcrypto_src/Symbols.list | grep '^[[:alpha:]]' > crypto/crypto.sym | 159 | $GREP -v OPENSSL_ia32cap_P $libcrypto_src/Symbols.list | $GREP '^[[:alpha:]]' > crypto/crypto.sym |
156 | 160 | ||
157 | # generate assembly crypto algorithms | 161 | # generate assembly crypto algorithms |
158 | asm_src=$libcrypto_src | 162 | asm_src=$libcrypto_src |
@@ -207,7 +211,7 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do | |||
207 | fi | 211 | fi |
208 | done | 212 | done |
209 | # add the libtls symbol export list | 213 | # add the libtls symbol export list |
210 | grep '^[[:alpha:]]' < $libtls_src/Symbols.list > tls/tls.sym | 214 | $GREP '^[[:alpha:]]' < $libtls_src/Symbols.list > tls/tls.sym |
211 | 215 | ||
212 | mkdir -p libtls-standalone/m4 | 216 | mkdir -p libtls-standalone/m4 |
213 | $CP m4/check*.m4 \ | 217 | $CP m4/check*.m4 \ |
@@ -260,7 +264,7 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' ssl/Makefile.am` ; do | |||
260 | $CP $libssl_src/$i ssl | 264 | $CP $libssl_src/$i ssl |
261 | done | 265 | done |
262 | # add the libssl symbol export list | 266 | # add the libssl symbol export list |
263 | grep '^[[:alpha:]]' < $libssl_src/Symbols.list > ssl/ssl.sym | 267 | $GREP '^[[:alpha:]]' < $libssl_src/Symbols.list > ssl/ssl.sym |
264 | 268 | ||
265 | # copy libcrypto tests | 269 | # copy libcrypto tests |
266 | echo "copying tests" | 270 | echo "copying tests" |
@@ -305,7 +309,7 @@ add_man_links() { | |||
305 | filter=$1 | 309 | filter=$1 |
306 | dest=$2 | 310 | dest=$2 |
307 | echo "install-data-hook:" >> $dest | 311 | echo "install-data-hook:" >> $dest |
308 | for i in `grep $filter man/links`; do | 312 | for i in `$GREP $filter man/links`; do |
309 | IFS=","; set $i; unset IFS | 313 | IFS=","; set $i; unset IFS |
310 | if [ "$2" != "" ]; then | 314 | if [ "$2" != "" ]; then |
311 | echo " ln -sf \"$1\" \"\$(DESTDIR)\$(mandir)/man3/$2\"" >> $dest | 315 | echo " ln -sf \"$1\" \"\$(DESTDIR)\$(mandir)/man3/$2\"" >> $dest |
@@ -313,7 +317,7 @@ add_man_links() { | |||
313 | done | 317 | done |
314 | echo "" >> $dest | 318 | echo "" >> $dest |
315 | echo "uninstall-local:" >> $dest | 319 | echo "uninstall-local:" >> $dest |
316 | for i in `grep $filter man/links`; do | 320 | for i in `$GREP $filter man/links`; do |
317 | IFS=","; set $i; unset IFS | 321 | IFS=","; set $i; unset IFS |
318 | if [ "$2" != "" ]; then | 322 | if [ "$2" != "" ]; then |
319 | echo " -rm -f \"\$(DESTDIR)\$(mandir)/man3/$2\"" >> $dest | 323 | echo " -rm -f \"\$(DESTDIR)\$(mandir)/man3/$2\"" >> $dest |