JSctypes: Difference between revisions

1,249 bytes added ,  15 April 2008
Added a section on build instructions
(Separated out a "technical notes and limitations" section.)
(Added a section on build instructions)
Line 50: Line 50:
The js-ctypes code uses the same [http://sourceware.org/libffi/ libffi] library as the Python ctypes module. It is currently known to work on Windows and Linux. We need to start the Mac implementation. We also need to add support for struct and more primitive types.
The js-ctypes code uses the same [http://sourceware.org/libffi/ libffi] library as the Python ctypes module. It is currently known to work on Windows and Linux. We need to start the Mac implementation. We also need to add support for struct and more primitive types.


== Contributing ==
== Getting the Code ==


Contributions are welcome!  The code can be checked out using Subversion:
The code can be checked out using Subversion:


<pre>
<pre>
Line 60: Line 60:
It can also be viewed online [http://viewvc.svn.mozilla.org/vc/projects/js-ctypes/ here].
It can also be viewed online [http://viewvc.svn.mozilla.org/vc/projects/js-ctypes/ here].


We have a Bugzilla component too ([https://bugzilla.mozilla.org/buglist.cgi?query_format=advanced&product=Other+Applications&component=js-ctypes&resolution=---&chfieldto=Now see bugs], [https://bugzilla.mozilla.org/enter_bug.cgi?product=Other%20Applications&component=js-ctypes file bug]).
== Build Instructions ==
 
Until js-ctypes makes its way into the Mozilla tree, building it will be a bit of a chore.
 
You'll first want to check out and build the Mozilla tree.  See the [http://developer.mozilla.org/en/docs/Build_Documentation Build Documentation] for information on how to do this.  The rest of these instructions assume that the path to your mozilla tree source is called <tt>PATH_TO_MOZILLA</tt> and that your objdir is in <tt>PATH_TO_OBJDIR</tt>.
 
You'll first want to create a directory called <tt>PATH_TO_MOZILLA/components/js-ctypes</tt> and put the svn checkout there.
 
Then, from your objdir root, run the following command:
 
<pre>
PATH_TO_MOZILLA/build/autoconf/make-makefile components/js-ctypes
</pre>
 
This should build the necessary Makefiles in your objdir, creating directories as necessary.
 
Now enter the <tt>PATH_TO_OBJDIR/components/js-ctypes</tt> directory and run <tt>make</tt>.
 
Once that's done, you should be able to enter <tt>PATH_TO_OBJDIR/dist/bin</tt> and use [http://www.mozilla.org/scriptable/XPCShell.html xpcshell] to play around with the component (see the example usage code above).
 
== Contributing ==
 
Contributions are welcome!  We have a Bugzilla component ([https://bugzilla.mozilla.org/buglist.cgi?query_format=advanced&product=Other+Applications&component=js-ctypes&resolution=---&chfieldto=Now see bugs], [https://bugzilla.mozilla.org/enter_bug.cgi?product=Other%20Applications&component=js-ctypes file bug]).  Please feel free to join <tt>#labs</tt> on irc.mozilla.org if you have any other questions.
874

edits