aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkinichiro <kinichiro.inoguchi@gmail.com>2017-02-20 10:28:49 +0900
committerkinichiro <kinichiro.inoguchi@gmail.com>2017-02-20 11:50:47 +0900
commit5297e9d486d4c0119e697d80eb53c8ef298f0bd7 (patch)
tree2a829cb3f132f51564bc7d702b8e992caf04dfb5
parent9d75e5ea975fc6d1b8b6eb333416d76144f7d2ee (diff)
downloadportable-5297e9d486d4c0119e697d80eb53c8ef298f0bd7.tar.gz
portable-5297e9d486d4c0119e697d80eb53c8ef298f0bd7.tar.bz2
portable-5297e9d486d4c0119e697d80eb53c8ef298f0bd7.zip
Fix condition of arc4random* and getentropy for Cygwin build
- Fix the condition of exporting getentropy - Modify the CMake condition of including arc4random_uniform as same as autoconf
-rw-r--r--crypto/CMakeLists.txt7
-rw-r--r--m4/check-libc.m412
2 files changed, 6 insertions, 13 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 41dc37b..6388cb0 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -736,8 +736,10 @@ endif()
736 736
737if(NOT HAVE_ARC4RANDOM_BUF) 737if(NOT HAVE_ARC4RANDOM_BUF)
738 set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random.c) 738 set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random.c)
739 set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random_uniform.c)
739 set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random) 740 set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random)
740 set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_buf) 741 set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_buf)
742 set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_uniform)
741 743
742 if(NOT HAVE_GETENTROPY) 744 if(NOT HAVE_GETENTROPY)
743 if(CMAKE_HOST_WIN32) 745 if(CMAKE_HOST_WIN32)
@@ -761,11 +763,6 @@ if(NOT HAVE_ARC4RANDOM_BUF)
761 endif() 763 endif()
762endif() 764endif()
763 765
764if(NOT HAVE_ARC4RANDOM_UNIFORM)
765 set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random_uniform.c)
766 set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_uniform)
767endif()
768
769if(NOT HAVE_TIMINGSAFE_BCMP) 766if(NOT HAVE_TIMINGSAFE_BCMP)
770 set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_bcmp.c) 767 set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_bcmp.c)
771 set(EXTRA_EXPORT ${EXTRA_EXPORT} timingsafe_bcmp) 768 set(EXTRA_EXPORT ${EXTRA_EXPORT} timingsafe_bcmp)
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4
index c66364e..53ffce6 100644
--- a/m4/check-libc.m4
+++ b/m4/check-libc.m4
@@ -152,14 +152,13 @@ echo "generating $crypto_p_sym ..."
152chmod u+w $srcdir/crypto 152chmod u+w $srcdir/crypto
153cp $crypto_sym $crypto_p_sym 153cp $crypto_sym $crypto_p_sym
154chmod u+w $crypto_p_sym 154chmod u+w $crypto_p_sym
155if test "x$ac_cv_func_arc4random" = "xno" ; then
156 echo arc4random >> $crypto_p_sym
157fi
158if test "x$ac_cv_func_arc4random_buf" = "xno" ; then 155if test "x$ac_cv_func_arc4random_buf" = "xno" ; then
156 echo arc4random >> $crypto_p_sym
159 echo arc4random_buf >> $crypto_p_sym 157 echo arc4random_buf >> $crypto_p_sym
160fi
161if test "x$ac_cv_func_arc4random_uniform" = "xno" ; then
162 echo arc4random_uniform >> $crypto_p_sym 158 echo arc4random_uniform >> $crypto_p_sym
159 if test "x$ac_cv_func_getentropy" = "xno" ; then
160 echo getentropy >> $crypto_p_sym
161 fi
163fi 162fi
164if test "x$ac_cv_func_asprintf" = "xno" ; then 163if test "x$ac_cv_func_asprintf" = "xno" ; then
165 echo asprintf >> $crypto_p_sym 164 echo asprintf >> $crypto_p_sym
@@ -168,9 +167,6 @@ fi
168if test "x$ac_cv_func_explicit_bzero" = "xno" ; then 167if test "x$ac_cv_func_explicit_bzero" = "xno" ; then
169 echo explicit_bzero >> $crypto_p_sym 168 echo explicit_bzero >> $crypto_p_sym
170fi 169fi
171if test "x$ac_cv_func_getentropy" = "xno" ; then
172 echo getentropy >> $crypto_p_sym
173fi
174if test "x$ac_cv_func_inet_pton" = "xno" ; then 170if test "x$ac_cv_func_inet_pton" = "xno" ; then
175 echo inet_pton >> $crypto_p_sym 171 echo inet_pton >> $crypto_p_sym
176fi 172fi