Fritti wrote:
> Hi,
>
> I'm trying to build PSM from mozilla-0.7 source on FreeBSD, and I keep
> running into errors. I'm trying to build in a seperate dir. The steps
> I've taken come down to this:
For what it's worth, I recently got the FreeBSD mozilla "port" to
generate a working PSM, but it took a little hacking. I opened a Mozilla
bug (#65549) about one of them. I wrote a bunch of e-mail about all of
this to the FreeBSD-mozilla list. You can find archives at
http://docs.freebsd.org/mail/current/freebsd-mozilla.html (if you read
this message in the distant future you may have to change this URL as
they rotate out the archives periodically).
The procedure goes something like this:
In /usr/ports/www/mozilla, do a make configure. This sets up the source
tree for you. cd into work/mozilla and you're at the top of the 0.7 tree.
In security/psm/server/servutil.c, in PSM_OpenPort(), find this chunk of
code:
/* Bind to PSM port on loopback address: connections from non-localhosts
* will be disallowed
*/
status = PR_InitializeNetAddr(PR_IpAddrLoopback, 0, &servaddr);
if (status != PR_SUCCESS)
goto loser;
status = PR_Bind(datasocket, &servaddr);
if (status != PR_SUCCESS)
goto loser;
and #if 0 it out. For some reason it always fails, with the result that
psm quits immediately. I did not investigate further other than to
simply point a finger at this code as being somehow broken. I suspect it
could be confusion over IPv6ishness, but whatever. :-)
Next, cd to security/coreconf and cp FreeBSD2.mk to FreeBSD4.2.mk (this
may need to change depending on your version of FreeBSD. I'm not sure).
Next, edit security/psm/server/Makefile. A couple of things have to
change here. First, look for the section that says that on Linux the c++
library is stdc++ and everywhere else it's C. Make FreeBSD use the Linux
case. Next, find the bit that says that on SunOS the NSPR_LINK_LIBS get
-L$(DIST)/lib -lnspr4 -lplc4 -lplds4 whereas other platforms get the
whole path to the .so. Make FreeBSD also do the SunOS case. Otherwise
you get a psm that won't work after the port directory is 'make clean'ed.
Lastly, edit /usr/ports/www/mozilla/Makefile and add MAKE_ARGS= BUILD_MODULES=psm
then run 'make' in /usr/ports/www/mozilla followed by a make install.
Then go have a Fresca.
Note that if you deinstall this port, you will leave some psm stuff
behind. This is because a PSM equipped mozilla has more files that the
port's package list doesn't know about. This will have to be fixed in
the FreeBSD port at some point.
I suspect that before too long the mozilla port maintainer will see all
of this stuff and fix the mozilla port to actually do it properly
(someone may even fix the bug in PR_Bind()!). I just throught I'd give a
dump of what it took for me to get a working PSM.