Fix compilation on FreeBSD

`make` is `gmake` on FreeBSD, so add a variable to include this change in command.
parent 50c3f864
......@@ -32,7 +32,7 @@ BUILD="$(cc -dumpmachine)"
export PKG_CONFIG_FOR_BUILD="pkg-config"
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "FreeBSD" ]]; then
# GNU find
FIND="gfind";
......@@ -42,6 +42,8 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
elif [ ! -z "$(which port)" ]; then
# TODO: find a programatic way of asking MacPorts for it's root dir.
STAT="/opt/local/opt/coreutils/libexec/gnubin/stat";
elif [ ! -z "$(which pkg)" ]; then
STAT="gnustat"
else
echo "Please install either Homebrew or MacPorts and run the boostrap script."
exit 1
......
......@@ -13,6 +13,11 @@ export DEBUG=
export EXAMPLES=
export PREPARE_COPY=1
SHASUM="sha256sum"
if hash shasum 2>/dev/null; then
SHASUM="shasum -a 256"
fi
if [ ! "$(uname -s)" = "Redox" ]
then
function docgen {
......@@ -96,7 +101,7 @@ function op {
if [ -n "$TAR_SHA256" ]
then
sha256sum -c <<< "${TAR_SHA256} source.tar"
$SHASUM -c <<< "${TAR_SHA256} source.tar"
fi
if [ ! -d source ]
......@@ -470,7 +475,7 @@ function op {
pushd stage > /dev/null
find -L . -type f | cut -d / -f 2- | sort | while read file
do
sha256sum "$file" >> "pkg/$1.sha256sums"
$SHASUM "$file" >> "pkg/$1.sha256sums"
done
popd > /dev/null
......
......@@ -25,7 +25,7 @@ function recipe_build {
--prefix=/ \
--disable-shared \
--enable-static
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -35,13 +35,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
rm -f "$dest/lib/"*.la
skip=1
}
......@@ -14,7 +14,7 @@ function recipe_update {
function recipe_build {
wget -O build-aux/config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub
./configure --build=${BUILD} --host=${HOST} --prefix=''
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -24,12 +24,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
skip=1
}
......@@ -17,7 +17,7 @@ function recipe_build {
sed -i 's|install-info-am install-man|install-info-am|' Makefile.in
./configure --build=${BUILD} --host=${HOST} --prefix=''
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -27,12 +27,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
skip=1
}
......@@ -23,7 +23,7 @@ function recipe_build {
--prefix=/ \
--disable-readline \
bash_cv_getenv_redef=no
make # -j"$(nproc)"
$REDOX_MAKE # -j"$($NPROC)"
skip=1
}
......@@ -33,12 +33,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" ${MAKEFLAGS} install
$REDOX_MAKE DESTDIR="$dest" ${MAKEFLAGS} install
skip=1
}
......@@ -21,7 +21,7 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
......
......@@ -27,7 +27,7 @@ function recipe_build {
--enable-xlib=no \
--enable-script=no \
--enable-interpreter=no
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -37,13 +37,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
rm -f "$dest/lib/"*.la
skip=1
}
......@@ -32,7 +32,7 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
......
......@@ -23,7 +23,7 @@ function recipe_build {
--prefix=/ \
--without-fonts
sed -i'' -e 's|#define USE_TIOCSTI 1|/* #undef USE_TIOCSTI */|g' config.h
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -33,12 +33,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
skip=1
}
......@@ -36,7 +36,7 @@ function recipe_build {
--with-nghttp2="$sysroot" \
--with-ssl="$sysroot" \
--with-zlib="$sysroot"
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -46,13 +46,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
rm -f "$dest/lib/"*.la
skip=1
}
......@@ -22,7 +22,7 @@ function recipe_build {
# See https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux.
sed -i'' -e 's|#define HAVE_GETRLIMIT 1|/* #undef HAVE_GETRLIMIT */|g' config.h
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -32,13 +32,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
ln -s "dash" "$dest/bin/sh"
skip=1
}
......@@ -23,7 +23,7 @@ function recipe_build {
gt_cv_locale_ja=false \
gt_cv_locale_tr_utf8=false \
gt_cv_locale_zh_CN=false
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -33,13 +33,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
${HOST}-strip "$dest"/bin/*
rm -rf "$dest"/{lib,share}
skip=1
......
......@@ -26,7 +26,7 @@ function recipe_build {
--disable-opengl \
--disable-sdltest \
--with-sdl-prefix="$sysroot"
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -36,12 +36,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
skip=1
}
......@@ -13,7 +13,7 @@ function recipe_update {
function recipe_build {
sed -i "s/= gcc/= $TARGET-gcc/g" Makefile.cmdline
make -f Makefile.cmdline -j"$(nproc)"
$REDOX_MAKE -f Makefile.cmdline -j"$($NPROC)"
skip=1
}
......@@ -23,7 +23,7 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
......
......@@ -18,7 +18,7 @@ function recipe_build {
export LDFLAGS="-L$sysroot/lib -static"
export SDLCONFIG="$sysroot/bin/sdl-config --prefix=$sysroot"
PLATFORM=REDOX make -j"$(nproc)"
PLATFORM=REDOX $REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -28,7 +28,7 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
......
......@@ -14,7 +14,7 @@ function recipe_update {
function recipe_build {
export LDFLAGS="--static"
./configure --build=${BUILD} --host=${HOST} --prefix=/
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -24,13 +24,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
rm -f "$dest/lib/"*.la
skip=1
}
......@@ -27,7 +27,7 @@ function recipe_build {
--enable-zlib \
--enable-encoder=png \
--enable-decoder=png
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -37,12 +37,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
skip=1
}
......@@ -24,7 +24,7 @@ function recipe_build {
--disable-shared \
--enable-static \
ac_cv_func_XML_SetDoctypeDeclHandler=yes
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -34,13 +34,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
rm -f "$dest/lib/"*.la
skip=1
}
......@@ -30,7 +30,7 @@ function recipe_build {
ac_cv_lib_SDL_image_IMG_Load=yes \
ac_cv_lib_SDL_ttf_TTF_OpenFont=yes \
ac_cv_lib_SDL_gfx_rotozoomSurface=yes
make -j"$(nproc)" V=1
$REDOX_MAKE -j"$($NPROC)" V=1
skip=1
}
......@@ -40,12 +40,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
skip=1
}
......@@ -23,7 +23,7 @@ function recipe_build {
-D FREEGLUT_GLES=0 \
.
#./configure --host="${HOST}" --prefix=/ --enable-osmesa
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -33,12 +33,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
skip=1
}
......@@ -17,7 +17,7 @@ function recipe_build {
export LDFLAGS="-L$sysroot/lib"
export CPPFLAGS="-I$sysroot/include"
./configure --build=${BUILD} --host=${HOST} --prefix='/'
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -27,13 +27,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
rm -f "$dest/lib/"*.la
skip=1
}
......@@ -23,7 +23,7 @@ function recipe_build {
--disable-shared \
--enable-static
sed -i 's|#define HAVE_SYS_TIMES_H 1|/* #undef HAVE_SYS_TIMES_H */|g' config.h
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -33,13 +33,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
rm -f "$dest/lib/"*.la
skip=1
}
......@@ -9,7 +9,7 @@ function recipe_update {
function recipe_build {
./configure --build=${BUILD} --host=${HOST} --prefix=/ ac_cv_func_gethostbyname=no ac_cv_func_connect=no
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
}
......@@ -19,12 +19,12 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
$REDOX_MAKE DESTDIR="$dest" install
skip=1
}
......@@ -40,7 +40,7 @@ function recipe_build {
--disable-nls \
--enable-languages=c,c++ \
--enable-threads=posix
make -j "$(nproc)" all-gcc all-target-libgcc all-target-libstdc++-v3
$REDOX_MAKE -j "$(nproc)" all-gcc all-target-libgcc all-target-libstdc++-v3
skip=1
}
......@@ -50,13 +50,13 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install-gcc install-target-libgcc install-target-libstdc++-v3
$REDOX_MAKE DESTDIR="$dest" install-gcc install-target-libgcc install-target-libstdc++-v3
find "$dest"/{bin,libexec} -exec $STRIP {} ';' 2> /dev/null
ln -s "gcc" "$1/bin/cc"
skip=1
......
......@@ -68,7 +68,7 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
......
......@@ -30,7 +30,7 @@ function recipe_test {
}
function recipe_clean {
make clean
$REDOX_MAKE clean
skip=1
}
......
......@@ -29,7 +29,7 @@ function recipe_build {
gt_cv_locale_ja=false \
gt_cv_locale_tr_utf8=false \
gt_cv_locale_zh_CN=false
make -j"$(nproc)"
$REDOX_MAKE -j"$($NPROC)"
skip=1
<