everything i know about building rmd on a mac

It isn’t a heck of a lot but I’ve heard from a few folks asking for pointers on how to get setup to try building RMD on the Mac.

Last night after I’d finished typing up an email response to one such request I flipped over to Bloglines and ran across Jeff Atwood’s reminder of a great post from Jon Udell. Both Jon and Jeff make the point that blogging something like say, a collection of pointers for building a binary XPCOM on the Mac is much more useful to more people than sending it off in an email or two. Unfortunately, they didn’t email me those thoughts so I almost didn’t realize they were talking to me ;-)

Like I said, it’s not much but hopefully this will help to get you started if you’d like to contribute the Mac version of the XPCOM component to RMD. And if I’ve said something that is not correct or you have any more insight on the topic, we’ll all benefit if you’d like to share it…

One of the first things you’ll need in order to build the XPCOM component fro RMD is the Gecko SDK for your platform. For an Intel Mac you’d need to build XULRunner in order to get the SDK. There is what appears to be a good set of build docs (including a build requirements section).

[Update 2007-05-20]: A couple of people have pointed out that Dave Townsend is hosting an “unofficial” Intel SDK build (thank you Dave!). That’s one less step.

For PPC you should be able to skip that step and grab the “official” Mozilla Gecko SDK.

Once you have the SDK for your platform I’d guess you really only need XCode on the Mac (I’m really Mac illiterate but I think this is a part OSX so you shouldn’t need to install any additional packages) . If you download my component’s source you’ll find a Linux make file that should be a good starting point for the Mac build.

If you use the Linux Makefile included as a starting point and you get link errrors that look something like “ld: -L: directory name missing” try removing the space in the LD flags:
-GECKO_LDFLAGS = -L $(GECKO_SDK_PATH)/lib \
+GECKO_LDFLAGS = -L$(GECKO_SDK_PATH)/lib \

FWIW, Mozilla have a pretty good tutorial for building C++ XPCOM using Visual Studio on Windows.

Good luck!

21 Responses

  1. Stian says:

    May 8, 2007 at 5:12 pm

    Thank you VERY much for RMD – I have started using Tb and got really annoyed with constant popups :D


  2. Tony says:

    May 11, 2007 at 8:30 pm

    /usr/bin/ld: warning ../../gecko-sdk/lib/libxpcom.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
    /usr/bin/ld: warning ../../gecko-sdk/lib/libnspr4.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
    /usr/bin/ld: warning ../../gecko-sdk/lib/libplds4.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)

    Figures :( Looks like I can’t use the Mac SDK since it’s PPC.


  3. andrew says:

    May 12, 2007 at 6:27 pm

    Hey Tony,

    Yeah, I’m not sure why mozilla.org isn’t providing an SDK for the x86 Mac.

    Obviously it can be built for your architecture. Sounds more daunting that it is really. From what I hear, the challenge is sorting through the build lists to find one that does the trick for you…

    I’m here with moral support ;-)

    Cheers,
    A.


  4. holehan says:

    May 19, 2007 at 2:54 pm

    Someone was listening. Have a look at the bottom of the afore mentioned page http://developer.mozilla.org/en/docs/Gecko_SDK#Resources There you will now find a link to an (unofficial) build of the gecko SDK for Intel Macs (it’s at http://www.oxymoronical.com/view/1114). I really hope this is not news and another someone is already using it to build RMD on the Mac ;)


  5. fishy says:

    May 22, 2007 at 9:42 am

    I try to build it on Intel Mac (with Dave’s unofficial sdk) and get this error:
    /usr/bin/ld: Undefined symbols:
    _main
    nsCOMPtr_base::assign_from_gs_contractid(nsGetServiceByContractID, nsID const&)
    nsCOMPtr_base::~nsCOMPtr_base()
    NS_NewGenericModule2(nsModuleInfo const*, nsIModule**)
    symbol _poll used from dynamic library /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib(poll.So) not from earlier dynamic library @executable_path/libnspr4.dylib(unix.o)
    collect2: ld returned 1 exit status
    make: *** [build] Error 1

    there’re also many warnings


  6. Michael Baltaks says:

    May 25, 2007 at 1:35 am

    I’ve had a quick look and managed to hack the code to compile on Mac OS X 10.4.9 x86, so I now have an .xpt file and a .so (Mach-O bundle i386) – but what do I do with these now? How do I register these with Thunderbird?


  7. andrew says:

    May 25, 2007 at 7:32 am

    Michael,

    Nice!

    So a quick way you could get things hooked up in TB would be to download the latest version of RMD and try to install it. You’ll get an error message about how it’s not compatible with your platform. Make a note of how it identifies your platform (should be something like “Darwin_x86-gcc3″).

    Next open the xpi (it’s just a formatted zip archive) and modify the install.rdf by adding a targetPlatform line that specifies your platform string (you’ll see the others). That will get RMD to install on your TB.

    After installing it browse to your TB extensions directory and in RMD’s install location place the binary component in a platform specific directory (of course, change the WINNT_x86-msvc below for your platform string):
    …\{c8961d25-7d90-4c7e-893b-400a5c882920}\platform\WINNT_x86-msvc\components\

    Finally remove the compreg.dat file in your TB profile and launch TB (compreg is the component ‘database’ and deleting it forces mozilla to re-register components the next time it starts). If all went well you should be in mismatched domain remembering heaven ;-)

    To verify that your new component is registered you can look through compreg.dat for it…

    Cheers,
    A.


  8. fishy says:

    May 25, 2007 at 11:44 am

    this is great news! hope we can use rmd in the near future :)


  9. Michael Baltaks says:

    May 27, 2007 at 8:10 pm

    Ok, I’ve followed the instructions and all is well. I now have the x86 Mac OS X bundle and the Makefile I used to build it. Where can I put them? I can also build a PPC version later. And thanks, Thunderbird 2 is nice – I didn’t want to try it without this extension.


  10. andrew says:

    May 28, 2007 at 9:36 am

    Great news Michael!

    I setup a project on Google code with the goal of formally hosting the RMD files there. I think with contributed binary code now a part of RMD it’s even more important that things be as transparent as we can make ‘em.

    Right now the project page is empty – I still need to get RMD into SVN so I can upload it… I’ll try to get that done this week.

    If you want, you can shoot your files to me and I’ll tuck them in when I’m doing the SVN upload or we can wait ’til I’m more setup.

    I know some folks are going to be grateful for your efforts. Many thanks.

    http://code.google.com/p/rmd/

    Cheers,
    A.


  11. Michael Baltaks says:

    May 28, 2007 at 8:52 pm

    I’ve put a ticket in at http://code.google.com/p/rmd/issues/detail?id=1&can=2&q= since that was the only way I could get this up straight away. I’ll try to remember to build a PowerPC binary soon.


  12. andrew says:

    May 28, 2007 at 9:24 pm

    Perfect. Now anyone itching to get RMD up on their Intel Mac should be able to with a bit of tinkering

    Thanks again Michael!


  13. andreas says:

    May 30, 2007 at 3:23 am

    Awesome. Thank you very much for the effort guys, this is just what I needed!


  14. Jonathan says:

    June 2, 2007 at 8:39 am

    So I just got a new Macbook pro and I’m really excited about it, but I can’t seem to get RMD to work on it either quite yet…

    When will there be a working version of RMD for the latest version of FF?


  15. andrew says:

    June 2, 2007 at 12:30 pm

    Congrats on the new computer Johnathan.

    “When will there be a working version of RMD for the latest version of FF?”

    Four days ago if you want to do a little bit of work.

    A bit longer if you don’t ;-)


  16. used smt equipment says:

    May 15, 2014 at 9:36 am

    Point-to-point communication was a big deal decades ago.

    General, you is going to be getting an excellent unit for any excellent price tag.
    Most the rental companies are well equipped to supply global telecommunications conferencing and nationwide video installation.


  17. ps3 Backup creator download says:

    June 28, 2014 at 1:22 am

    Generally I do not learn post on blogs, but I would like to
    say that this write-up very forced me to takee a look
    at and do it! Your writing taste has been amazed me.
    Thank you, very great article.


  18. Bradford Manuia says:

    September 4, 2014 at 4:42 am

    I do not know whether it’sjust me or if perhaps
    eeveryone else encountering issues with your blog.
    It appears like some of the written text within your posts are running ooff the
    screen. Can someone else pleae comment annd let me know if this is happening to them too?
    This could be a issue with my web browser because I’ve had this happen previously.
    Thanks


  19. Krystal says:

    September 25, 2014 at 11:39 pm

    I read a lot of interesting content here.
    Probably you spend a lot of time writing, i know how
    to save you a lot of work, there is an online tool that creates unique, SEO friendly
    posts in minutes, just type in google – laranitas free content source


  20. BryonCHeppel says:

    August 29, 2016 at 7:52 pm

    Your way of describing all in this particular component of writing is really
    fastidious, all can effortlessly be aware of it,
    Thanks a good deal.


  21. 95Myrna says:

    August 12, 2017 at 9:05 am

    Hi blogger, i must say you have very interesting articles here.

    Your website should go viral. You need initial traffic only.
    How to get it? Search for: Mertiso’s tips go viral


Leave a Reply