File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ option(DISABLE_WERROR "Avoid treating compiler warnings as fatal
9797option (ENABLE_RDRAND "Enable RDRAND Hardware RNG Hash Seed." OFF )
9898option (ENABLE_THREADING "Enable partial threading support." OFF )
9999option (OVERRIDE_GET_RANDOM_SEED "Override json_c_get_random_seed() with custom code." OFF )
100+ option (DISABLE_EXTRA_LIBS "Avoid linking against extra libraries, such as libbsd." OFF )
100101
101102
102103if (UNIX OR MINGW OR CYGWIN )
@@ -171,7 +172,7 @@ check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
171172check_symbol_exists(vprintf "stdio.h" HAVE_VPRINTF)
172173
173174check_symbol_exists(arc4random "stdlib.h" HAVE_ARC4RANDOM)
174- if (NOT HAVE_ARC4RANDOM)
175+ if (NOT HAVE_ARC4RANDOM AND DISABLE_EXTRA_LIBS STREQUAL "OFF" )
175176 check_include_file(bsd/stdlib.h HAVE_BSD_STDLIB_H)
176177 if (HAVE_BSD_STDLIB_H)
177178 list (APPEND CMAKE_REQUIRED_LIBRARIES "-lbsd" )
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ $0 [<configure_options>] [-- [<cmake options>]]
3030 --enable-static build static libraries [default=yes]
3131 --disable-Bsymbolic Avoid linking with -Bsymbolic-function
3232 --disable-werror Avoid treating compiler warnings as fatal errors
33+ --disable-extra-libs Avoid linking against extra libraries, such as libbsd
3334
3435EOF
3536 exit
@@ -73,6 +74,9 @@ while [ $# -gt 0 ] ; do
7374 --disable-werror)
7475 FLAGS+=(-DDISABLE_WERROR=ON)
7576 ;;
77+ --disable-extra-libs)
78+ FLAGS+=(-DDISABLE_EXTRA_LIBS=ON)
79+ ;;
7680 --)
7781 shift
7882 break
You can’t perform that action at this time.
0 commit comments