Binary Components In Extensions
So, you've decided you need a binary component in you add-on? Great! read this. Okay, that's a little long and complicated (sorry, Matt). How about this? Ah, that does look simpler, but it doesn't work on a recent Mozilla build, you say? Fear not, I have for you:
The Binary XPCOM Component Starter Kit
The actual component is the same from Alex Sirota, so do read his page, it has a ton of useful information. My version has an updated makefile (not yet tested on windows, I plan to do that soon), and is designed to be unpacked directly into your extension. It will create a "src" directory with sample sources.
What you need:
Once you unpack the tarball into your extension, go into the src directory and run 'make sdkdir=/path/to/sdk'. If all goes well, it should build the component and place it into a platform-specific directory in your extension (did you know you can include multiple builds of a binary component, for each platform, in the same extension?).
It's pretty rough, I just spent some time on the makefile yesterday and haven't tried to make it work on Windows yet. But it's a start!
* The Gecko SDK is more than just [objdir]/dist/sdk so presumably you need to point to the appropriate place if you download the SDK to use.
* I presume you mean a mozilla-config.h file which is what the bug you mention is about.
http://zenit.senecac.on.ca/wiki/index.php/Real_World_Mozilla_First_XPCOM_Component
I didn't know there was a difference between a downloadable SDK (assuming you could get one for 1.9) and [objdir]/dist/sdk - what's the difference?
Dave, cool! My goal was to 1) make it as easy as possible to get started, and 2) to keep my files separate from the mozilla build tree.
I don't like modifying the mozilla build tree to add a component to my extension (which I track using a separate repository).
dist/bin
dist/host/bin
dist/sdk
dist/include
dist/idl
dist/lib (copied from dist/sdk/lib)
They are spat out as part of the xulrunner build: http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/
You might be interested to look at how McCoy builds since it can now build against just the downloadable SDK: http://wiki.mozilla.org/McCoy:Building
Matt, yup! Things are easier now, for sure, though the documentation isn't all there yet.