sstephenson/ruby-build — pull request #266 by kaspergrubbe (2013-01-08 09:23:26+00:00)
Title: This fixes issue #239 related to building Ruby on FreeBSD systems

This relates to issue #239 that caused Ruby-build to fail when building Ruby on FreeBSD systems.

I tracked down the error, and it was caused by running make with the `make -j 2`-parameter.

Why it failed I don't know, but it would seem that using `-j` is disabling backwards compatibility, from the make man-page:

> -B:
> Try to be backwards compatible by executing a single shell per
> command and by executing the commands to make the sources of a
> dependency line in sequence. This is turned on by default unless
> -j is used.

> -j max_jobs
> Specify the maximum number of jobs that make may have running at
> any one time. Turns compatibility mode off, unless the -B flag
> is also specified.

I don't know if my solution is the "prettiest", but maybe we should consider not using the flag at all. But that would cause the compiling step to be slower on functional system with a working make, and this step is already lengthy, so I don't think that is an option either.

Before my change, running rbenv install 1.9.3-p327 would cause the compiling to fail:

```
installing default wait_for_single_fd libraries
compiling wait_for_single_fd.c
linking shared-object -test-/wait_for_single_fd/wait_for_single_fd.so
make: don't know how to make ../../.ext/common/bigdecimal. Stop
*** [ext/bigdecimal/all] Error code 2
1 error
*** [build-ext] Error code 2
```

After my change, the build would complete and work as expected.

Thoughts about this?