Skip to content

Commit 2831d25

Browse files
committed
Made a dynamic check for BSD make and GNU make
1 parent ee3844f commit 2831d25

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bin/ruby-build

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,13 @@ build_package_standard() {
315315
if [ "${MAKEOPTS+defined}" ]; then
316316
MAKE_OPTS="$MAKEOPTS"
317317
elif [ -z "${MAKE_OPTS+defined}" ]; then
318-
if [[ "FreeBSD" = "$(uname)" ]]; then
319-
MAKE_OPTS="-B -j 2" # '-j 2' only builds on FreeBSD with the -B argument
320-
else
318+
make --version &>/dev/null ; PROBE_GCC_MAKE=$?
319+
make -V MAKE_VERSION &>/dev/null ; PROBE_BSD_MAKE=$?
320+
321+
if [ $PROBE_GCC_MAKE -eq 0 ]; then
321322
MAKE_OPTS="-j 2"
323+
elif [ $PROBE_BSD_MAKE -eq 0 ]; then
324+
MAKE_OPTS="-B -j 2" # '-j 2' only builds on BSD make with the -B argument
322325
fi
323326
fi
324327

0 commit comments

Comments
 (0)