aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac24
-rw-r--r--crypto/Makefile.am74
-rw-r--r--m4/check-libc.m485
-rwxr-xr-xupdate.sh14
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
54CHECK_VA_COPY 54CHECK_VA_COPY
55CHECK_B64_NTOP 55CHECK_B64_NTOP
56 56
57GENERATE_CRYPTO_PORTABLE_SYM
58
59AC_ARG_WITH([openssldir], 57AC_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)
81CFLAGS="$old_cflags" 79CFLAGS="$old_cflags"
82 80
83case $host_cpu in 81AS_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*) 89AM_CONDITIONAL([HOST_CPU_IS_INTEL], [test "x$HOSTARCH" = "xintel"])
92 host_cpu=x86_64
93 ;;
94
95esac
96 90
97AC_MSG_CHECKING([if .gnu.warning accepts long strings]) 91AC_MSG_CHECKING([if .gnu.warning accepts long strings])
98AC_LINK_IFELSE([AC_LANG_SOURCE([[ 92AC_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
18BUILT_SOURCES = crypto_portable.sym 18BUILT_SOURCES = crypto_portable.sym
19CLEANFILES = crypto_portable.sym 19CLEANFILES = crypto_portable.sym
20 20
21crypto_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
25if !HAVE_ARC4RANDOM_BUF
26 -echo arc4random >> crypto_portable.sym
27 -echo arc4random_buf >> crypto_portable.sym
28 -echo arc4random_uniform >> crypto_portable.sym
29if !HAVE_GETENTROPY
30 -echo getentropy >> crypto_portable.sym
31endif
32endif
33if !HAVE_ASPRINTF
34 -echo asprintf >> crypto_portable.sym
35 -echo vasprintf >> crypto_portable.sym
36endif
37if !HAVE_EXPLICIT_BZERO
38 -echo explicit_bzero >> crypto_portable.sym
39endif
40if !HAVE_FREEZERO
41 -echo freezero >> crypto_portable.sym
42endif
43if !HAVE_INET_PTON
44 -echo inet_pton >> crypto_portable.sym
45endif
46if !HAVE_REALLOCARRAY
47 -echo reallocarray >> crypto_portable.sym
48endif
49if !HAVE_RECALLOCARRAY
50 -echo recallocarray >> crypto_portable.sym
51endif
52if !HAVE_STRLCAT
53 -echo strlcat >> crypto_portable.sym
54endif
55if !HAVE_STRLCPY
56 -echo strlcpy >> crypto_portable.sym
57endif
58if !HAVE_STRNDUP
59 -echo strndup >> crypto_portable.sym
60endif
61if !HAVE_STRNLEN
62 -echo strnlen >> crypto_portable.sym
63endif
64if !HAVE_STRSEP
65 -echo strsep >> crypto_portable.sym
66endif
67if !HAVE_TIMEGM
68 -echo timegm >> crypto_portable.sym
69endif
70if !HAVE_TIMINGSAFE_BCMP
71 -echo timingsafe_bcmp >> crypto_portable.sym
72endif
73if !HAVE_TIMINGSAFE_MEMCMP
74 -echo timingsafe_memcmp >> crypto_portable.sym
75endif
76if HOST_CPU_IS_INTEL
77 -echo OPENSSL_ia32cap_P >> crypto_portable.sym
78endif
79if 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
93endif
94
21libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym 95libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym
22libcrypto_la_LIBADD = libcompat.la 96libcrypto_la_LIBADD = libcompat.la
23if !HAVE_EXPLICIT_BZERO 97if !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])
149fi 149fi
150]) 150])
151
152AC_DEFUN([GENERATE_CRYPTO_PORTABLE_SYM], [
153AS_CASE([$host_cpu],
154 [i?86], [HOSTARCH=intel],
155 [x86_64], [HOSTARCH=intel],
156 [amd64], [HOSTARCH=intel],
157)
158AC_SUBST([HOSTARCH])
159crypto_sym=$srcdir/crypto/crypto.sym
160crypto_p_sym=./crypto/crypto_portable.sym
161echo "generating $crypto_p_sym ..."
162mkdir -p ./crypto
163cp $crypto_sym $crypto_p_sym
164chmod u+w $crypto_p_sym
165if 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
172fi
173if test "x$ac_cv_func_asprintf" = "xno" ; then
174 echo asprintf >> $crypto_p_sym
175 echo vasprintf >> $crypto_p_sym
176fi
177if test "x$ac_cv_func_explicit_bzero" = "xno" ; then
178 echo explicit_bzero >> $crypto_p_sym
179fi
180if test "x$ac_cv_func_freezero" = "xno" ; then
181 echo freezero >> $crypto_p_sym
182fi
183if test "x$ac_cv_func_inet_pton" = "xno" ; then
184 echo inet_pton >> $crypto_p_sym
185fi
186if test "x$ac_cv_func_reallocarray" = "xno" ; then
187 echo reallocarray >> $crypto_p_sym
188fi
189if test "x$ac_cv_func_recallocarray" = "xno" ; then
190 echo recallocarray >> $crypto_p_sym
191fi
192if test "x$ac_cv_func_strlcat" = "xno" ; then
193 echo strlcat >> $crypto_p_sym
194fi
195if test "x$ac_cv_func_strlcpy" = "xno" ; then
196 echo strlcpy >> $crypto_p_sym
197fi
198if test "x$ac_cv_func_strndup" = "xno" ; then
199 echo strndup >> $crypto_p_sym
200fi
201if test "x$ac_cv_func_strnlen" = "xno" ; then
202 echo strnlen >> $crypto_p_sym
203fi
204if test "x$ac_cv_func_strsep" = "xno" ; then
205 echo strsep >> $crypto_p_sym
206fi
207if test "x$ac_cv_func_timegm" = "xno" ; then
208 echo timegm >> $crypto_p_sym
209fi
210if test "x$ac_cv_func_timingsafe_bcmp" = "xno" ; then
211 echo timingsafe_bcmp >> $crypto_p_sym
212fi
213if test "x$ac_cv_func_timingsafe_memcmp" = "xno" ; then
214 echo timingsafe_memcmp >> $crypto_p_sym
215fi
216if test "x$HOSTARCH" = "xintel" ; then
217 echo OPENSSL_ia32cap_P >> $crypto_p_sym
218fi
219if 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
234fi
235])
diff --git a/update.sh b/update.sh
index 90dbde6..ec69dfc 100755
--- a/update.sh
+++ b/update.sh
@@ -63,6 +63,10 @@ do_cp_libc() {
63CP_LIBC='do_cp_libc' 63CP_LIBC='do_cp_libc'
64 64
65CP='cp -p' 65CP='cp -p'
66GREP='grep'
67if [ -x /opt/csw/bin/ggrep ]; then
68 GREP='/opt/csw/bin/ggrep'
69fi
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
155grep -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
158asm_src=$libcrypto_src 162asm_src=$libcrypto_src
@@ -207,7 +211,7 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do
207 fi 211 fi
208done 212done
209# add the libtls symbol export list 213# add the libtls symbol export list
210grep '^[[:alpha:]]' < $libtls_src/Symbols.list > tls/tls.sym 214$GREP '^[[:alpha:]]' < $libtls_src/Symbols.list > tls/tls.sym
211 215
212mkdir -p libtls-standalone/m4 216mkdir -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
261done 265done
262# add the libssl symbol export list 266# add the libssl symbol export list
263grep '^[[: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
266echo "copying tests" 270echo "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