@@ -282,7 +282,7 @@ for f in all extra error shadow "format=2" missing-prototypes \
282282 missing-include-dirs old-style-definition \
283283 init-self redundant-decls float-equal missing-noreturn \
284284 cast-align cast-qual pointer-arith comment \
285- declaration-after-statement write-strings stack-protector; do
285+ write-strings stack-protector; do
286286 check_compiler_flag ${f} W
287287done
288288
@@ -613,6 +613,48 @@ else
613613fi
614614rm -f _$func .c _$func
615615
616+ #
617+ # Check for getrandom().
618+ #
619+ func=getrandom
620+ printf " Checking for $func () ... "
621+ cat << EOF > _$func .c
622+ #include <sys/random.h>
623+ int main(void) {
624+ char buf[16];
625+ getrandom(buf, sizeof(buf), 0);
626+ return 0;
627+ }
628+ EOF
629+ if $XCC _$func .c -o _$func 2> /dev/null; then
630+ echo yes.
631+ echo " CPPFLAGS += -DHAVE_GETRANDOM" >> $CONFIG_MK
632+ else
633+ echo no.
634+ fi
635+ rm -f _$func .c _$func
636+
637+ #
638+ # Check for arc4random_buf().
639+ #
640+ func=arc4random_buf
641+ printf " Checking for $func () ... "
642+ cat << EOF > _$func .c
643+ #include <stdlib.h>
644+ int main(void) {
645+ char buf[16];
646+ arc4random_buf(buf, sizeof(buf));
647+ return 0;
648+ }
649+ EOF
650+ if $XCC _$func .c -o _$func 2> /dev/null; then
651+ echo yes.
652+ echo " CPPFLAGS += -DHAVE_ARC4RANDOM_BUF" >> $CONFIG_MK
653+ else
654+ echo no.
655+ fi
656+ rm -f _$func .c _$func
657+
616658#
617659# zlib is required.
618660#
@@ -757,6 +799,8 @@ if [ "$SET_RPATH" ]; then
757799 sed -i ' s,XORIGIN,$$ORIGIN,' $CONFIG_MK
758800fi
759801
802+ echo " CFLAGS += -Wno-error=deprecated-declarations" >> $CONFIG_MK
803+
760804echo
761805echo " XBPS has been configured with the following options:"
762806echo
0 commit comments