summaryrefslogtreecommitdiff
path: root/Examples/ruby/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/ruby/index.html')
-rw-r--r--Examples/ruby/index.html94
1 files changed, 94 insertions, 0 deletions
diff --git a/Examples/ruby/index.html b/Examples/ruby/index.html
new file mode 100644
index 0000000..f04146e
--- /dev/null
+++ b/Examples/ruby/index.html
@@ -0,0 +1,94 @@
+
+<head>
+<title>SWIG:Examples:ruby</title>
+</head>
+
+<body bgcolor="#ffffff">
+<H1>SWIG Ruby Examples</H1>
+
+<p>
+The following examples illustrate the use of SWIG with Ruby.
+
+<ul>
+<li><a href="simple/index.html">simple</a>. A minimal example showing how SWIG can
+be used to wrap a C function, a global variable, and a constant.
+<li><a href="constants/index.html">constants</a>. This shows how preprocessor macros and
+certain C declarations are turned into constants.
+<li><a href="variables/index.html">variables</a>. An example showing how to access C global variables from Ruby.
+<li><a href="value/index.html">value</a>. How to pass and return structures by value.
+<li><a href="class/index.html">class</a>. Wrapping a simple C++ class.
+<li><a href="reference/index.html">reference</a>. C++ references.
+<li><a href="pointer/index.html">pointer</a>. Simple pointer handling.
+<li><a href="funcptr/index.html">funcptr</a>. Pointers to functions.
+<li><a href="enum/index.html">enum</a>. Enumeration.
+</ul>
+
+<h2>Compilation Issues</h2>
+
+<ul>
+<li>To create a Ruby extension, SWIG is run with the following options:
+
+<blockquote>
+<pre>
+% swig -ruby interface.i
+</pre>
+</blockquote>
+
+<li>
+Please see the <a href="../../Doc/Manual/Windows.html">Windows</a> page in the main manual for information on using the examples on Windows. <p>
+</li>
+
+<li>On Unix the compilation of examples is done using the file <tt>Example/Makefile</tt>. This
+makefile performs a manual module compilation which is platform specific. Typically,
+the steps look like this (Linux):
+
+<blockquote>
+<pre>
+% swig -ruby interface.i
+% gcc -fpic -c interface_wrap.c -I/usr/local/lib/ruby/1.4/i686-linux
+% gcc -shared interface_wrap.o $(OBJS) -o interface.so
+% ruby
+require 'interface'
+Interface.blah(...)
+...
+</pre>
+</blockquote>
+
+<li>The politically "correct" way to compile a Ruby extension is to follow the steps
+described <tt>README.EXT</tt> in Ruby distribution:
+
+<p>
+<ol>
+<li>Create a file called <tt>extconf.rb</tt> that looks like the following:
+
+<blockquote>
+<pre>
+require 'mkmf'
+create_makefile('interface')
+</pre>
+</blockquote>
+<li>Type the following to build the extension:
+
+<blockquote>
+<pre>
+% ruby extconf.rb
+% make
+</pre>
+</blockquote>
+</ol>
+</ul>
+
+<h2>Compatibility</h2>
+
+The examples have been extensively tested on the following platforms:
+
+<ul>
+<li>Linux
+</ul>
+
+Your mileage may vary. If you experience a problem, please let us know by
+contacting us on the <a href="http://www.swig.org/mail.html">mailing lists</a>.
+</body>
+</html>
+
+