mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 17:25:06 +00:00
Build: Modify various parts to allow the build to succeed on FreeBSD
This commit is contained in:
parent
a82c56f9f7
commit
b4790010a8
5 changed files with 11 additions and 6 deletions
|
@ -33,7 +33,7 @@
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__unix__)
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ inline void fill_with_random(void* buffer, size_t length)
|
||||||
{
|
{
|
||||||
#if defined(__serenity__)
|
#if defined(__serenity__)
|
||||||
arc4random_buf(buffer, length);
|
arc4random_buf(buffer, length);
|
||||||
#elif defined(__linux__) or defined(__APPLE__)
|
#elif defined(__unix__) or defined(__APPLE__)
|
||||||
int rc = getentropy(buffer, length);
|
int rc = getentropy(buffer, length);
|
||||||
(void)rc;
|
(void)rc;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,7 +54,7 @@ if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
elif [ "$(uname -s)" = "OpenBSD" ]; then
|
elif [ "$(uname -s)" = "OpenBSD" ]; then
|
||||||
mount -t ext2fs "/dev/${VND}i" mnt/ || die "could not mount filesystem"
|
mount -t ext2fs "/dev/${VND}i" mnt/ || die "could not mount filesystem"
|
||||||
elif [ "$(uname -s)" = "FreeBSD" ]; then
|
elif [ "$(uname -s)" = "FreeBSD" ]; then
|
||||||
fuse-ext2 -o rw+ "/dev/${MD}" mnt/ || die "could not mount filesystem"
|
fuse-ext2 -o rw+,direct_io "/dev/${MD}" mnt/ || die "could not mount filesystem"
|
||||||
else
|
else
|
||||||
if ! mount _disk_image mnt/ ; then
|
if ! mount _disk_image mnt/ ; then
|
||||||
if command -v genext2fs 1>/dev/null ; then
|
if command -v genext2fs 1>/dev/null ; then
|
||||||
|
|
|
@ -12,10 +12,11 @@ window_gid=13
|
||||||
|
|
||||||
CP="cp"
|
CP="cp"
|
||||||
|
|
||||||
# cp on macOS does not support the -d option.
|
# cp on macOS and BSD systems do not support the -d option.
|
||||||
# gcp comes with coreutils, which is already a dependency.
|
# gcp comes with coreutils, which is already a dependency.
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
OS="$(uname -s)"
|
||||||
CP=gcp
|
if [ "$OS" = "Darwin" ] || echo "$OS" | grep -qe 'BSD$'; then
|
||||||
|
CP="gcp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
|
|
|
@ -42,6 +42,8 @@ elif [ "$(uname -s)" = "FreeBSD" ]; then
|
||||||
MAKE=gmake
|
MAKE=gmake
|
||||||
MD5SUM="md5 -q"
|
MD5SUM="md5 -q"
|
||||||
NPROC="sysctl -n hw.ncpu"
|
NPROC="sysctl -n hw.ncpu"
|
||||||
|
export with_gmp=/usr/local
|
||||||
|
export with_mpfr=/usr/local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git_patch=
|
git_patch=
|
||||||
|
|
|
@ -28,6 +28,8 @@ elif [ "$(uname -s)" = "FreeBSD" ]; then
|
||||||
MAKE=gmake
|
MAKE=gmake
|
||||||
MD5SUM="md5 -q"
|
MD5SUM="md5 -q"
|
||||||
NPROC="sysctl -n hw.ncpu"
|
NPROC="sysctl -n hw.ncpu"
|
||||||
|
export with_gmp=/usr/local
|
||||||
|
export with_mpfr=/usr/local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo PREFIX is "$PREFIX"
|
echo PREFIX is "$PREFIX"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue