building on freebsd

Vick Khera vivek at khera.org
Wed Feb 10 20:52:25 EST 2010


I'm just starting out playing with riak, after reading up on it quite
a lot.  However, building release 0.8 on FreeBSD is, shall we say,
challenging.

I think my main hangup is building the included spidermonkey.  Is
there a way to hack it up so that it uses the libjs that's already
installed on the system?  It would be a *ton* easier.

I did make a few hacks to get the build to work.  The first was to
edit the apps/erlang_js/c_src/Makefile to use $(MAKE) instead of
hard-coding "make" as the command.  The Makefile is written in the GNU
Make flavor, and BSD make does not like it.  This also means that the
apps/erlang_js/c_src/build_driver_deps.sh script also needs to be
changed to call gmake.  I'm not sure how to make that generic.

The build_drive_deps.sh script is hard coded to run /bin/bash which
does not exist on freebsd, even with bash installed. It is found in
/usr/local/bin/bash.  But... the script does nothing fancy and can run
with /bin/sh just fine if you change the "pushd" to "cd".  This is ok
since the CWD does not persist once the script exits anyway (that is,
pushd is overkill since you never popd).  That makes it incredibly
more portable.  I think there are other scripts to build the docs that
have the same /bin/bash call, but I haven't gotten that far yet.

When building spidermonkey, you have to do the following in
apps/erlang_js/c_src/deps/js/src/config: cp Linux_All.mk FreeBSD`uname
-r`.mk

That's as far as I've gotten so far.  I'm stuck at the build of libjs.so:

ld -shared  -o FreeBSD7.2-RELEASE-p3_OPT.OBJ/libjs.so
FreeBSD7.2-RELEASE-p3_OPT.OBJ/jsapi.o
FreeBSD7.2-RELEASE-p3_OPT.OBJ/jsare...
ld: FreeBSD7.2-RELEASE-p3_OPT.OBJ/jsapi.o: relocation R_X86_64_32S can
not be used when making a shared object; recompile with -fPIC
FreeBSD7.2-RELEASE-p3_OPT.OBJ/jsapi.o: could not read symbols: Bad value

I'll play some more and report any more progress if I make any.




More information about the riak-users mailing list