Skip to content

Commit

Permalink
build: add missing randomness checks in CMakeLists.txt
Browse files Browse the repository at this point in the history
See the previous commit.
  • Loading branch information
div72 committed Jul 3, 2024
1 parent a389a8c commit 4a0371e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,10 @@ if(NOT HAVE_GMTIME_R)
endif()
endif()

check_symbol_exists(SYS_getrandom "sys/syscall.h" HAVE_SYS_GETRANDOM)
check_symbol_exists(getentropy "unistd.h" HAVE_GETENTROPY)
check_symbol_exists(KERN_ARND "sys/sysctl.h" HAVE_SYSCTL_ARND)
check_symbol_exists(getrandom "sys/random.h" HAVE_GETRANDOM)
check_symbol_exists(getentropy "sys/random.h" HAVE_GETENTROPY_RAND)
check_symbol_exists(sysctl "sys/sysctl.h" "sys/types.h" HAVE_SYSCTL)
check_symbol_exists(KERN_ARND "sys/sysctl.h" "sys/types.h" HAVE_SYSCTL_ARND)

check_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC)
check_symbol_exists(getauxval "sys/auxv.h" HAVE_STRONG_GETAUXVAL)
Expand Down
8 changes: 3 additions & 5 deletions src/config/gridcoin-config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@
#cmakedefine01 HAVE_SYSTEM
#cmakedefine HAVE_GMTIME_R

// Define if the Linux getrandom system call is available
#cmakedefine HAVE_SYS_GETRANDOM
// Define if the BSD getentropy system call is available
#cmakedefine HAVE_GETENTROPY
// Define if the BSD sysctl(KERN_ARND) is available
#cmakedefine HAVE_GETRANDOM
#cmakedefine HAVE_GETENTROPY_RAND
#cmakedefine HAVE_SYSCTL
#cmakedefine HAVE_SYSCTL_ARND

#cmakedefine01 HAVE_O_CLOEXEC
Expand Down

0 comments on commit 4a0371e

Please sign in to comment.