building on freebsd

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

building on freebsd

Vick Khera
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.

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: building on freebsd

Kevin Smith-5
Vick -

Thanks for trying this out. I know the Spidermonkey integration isn't optimal and we're making progress on smoothing the rough edges. With any luck the shell scripts will be gone and the makefiles will be much more portable.

--Kevin
On Feb 10, 2010, at 8:52 PM, Vick Khera wrote:

> 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.
>
> _______________________________________________
> riak-users mailing list
> [hidden email]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com