Commit 8ffb8cf4 authored by Robert Ricci's avatar Robert Ricci

Remove SWIG from the build process - unfortunately, it's slightly

broken. Also, it made me slightly uneasy that there was no way to
prevent swig from putting one of its generated files in sorce
directory. So, I've just checked in the two major files that get
generated by SWIG, so that the make rule that runs it never gets
invoked.

One of the reasons for doing this is that swig generates slightly
broken code when the -exportall (which does perl module exports
correctly) arugment is given. A very minor amount of manual tweaking
of the generated .pm file can fix this problem. So, the checked in
copy of event.pm has these tweaks applied.

As a result of all of this, exports work correctly in the event perl
module, so the hacky practice of putting your program in the event
namespace is no longer necessary.
parent 447bb8a5
......@@ -7,11 +7,6 @@ grok macros -- some have been 'translated' into regular functions, but not all.
Note that you don't get any magic perl garbage collection, etc, for C objects.
So, you still have to call address_tuple_alloc/address_tuple_free, etc.
Also, SWIG modules do not export functions. This means that you have to either
prefix everthing with 'event::' (cumbersome, since most event system stuff
starts with 'event_' already), or cheat, by putting yourself in the module's
namespace with the line 'package event;'
Examples of the use of the perl event system are in the examples/ directory,
and mirror the C examples.
......
......@@ -11,7 +11,6 @@
use lib '@prefix@/lib';
use event;
package event; # Laziness so that we don't have to specify package name
use Getopt::Std;
use strict;
......
......@@ -10,7 +10,6 @@
use lib '@prefix@/lib';
use event;
package event; # Laziness so that we don't have to specify package name
use Getopt::Std;
use strict;
......
......@@ -36,7 +36,7 @@ event_r.o: event.c
# These three targets are for the perl binding to the event system
#
$(SRCDIR)/event_wrap.c: event.i event.c event.pm.tail
swig -dnone -perl5 -shadow -I$(SRCDIR) $(SRCDIR)/event.i
swig -exportall -dnone -perl5 -shadow -I$(SRCDIR) $(SRCDIR)/event.i
cat $(SRCDIR)/event.pm.tail >> event.pm
event_wrap.o: $(SRCDIR)/event_wrap.c
......
This diff is collapsed.
......@@ -41,6 +41,6 @@ sub event_poll($) {
return 0;
}
push @EXPORT, qw(event_subscribe event_poll);
1;
This diff is collapsed.
......@@ -21,8 +21,6 @@ my $TBOPS = "@TBOPSEMAIL@";
$| = 1;
use event;
package event;
use libdb;
use libtestbed;
use Getopt::Std;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment