[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Making swarm use functions from other toolkits (Glib, GNUstep)
From: |
Paul Johnson |
Subject: |
Making swarm use functions from other toolkits (Glib, GNUstep) |
Date: |
Wed, 22 Sep 1999 14:35:08 -0500 |
OK, so I have found a way to use the collections tools from the glib in
swarm.
I hope there is an easier way to do it, but here is what I did. (I went
this route because swarm seems to ignore any CFlags from the command
line).
I edited /usr/etc/swarm/Makefile.common and added stuff in the CFLAGS
and the SWARMLDFLAGS.
I found the correct values by using the command "glib-config --libs" and
"glib-config --cflags". I compiled this version of Swarm with i586
optimizations, so there are some distracting flags in there, but I just
ended up adding the last 2 flags to CFLAGS and then several (eleven) to
SWARMLDFLAGS. SO I ended up with these:
CFLAGS = -O2 -march=pentium -fomit-frame-pointer -fno-exceptions
-fno-rtti -pipe -s -mcpu=pentium -ffast-math -mieee-fp
-fexpensive-optimizations -malign-loops=2 -malign-jumps=2
-malign-functions=2 -I/usr/X11R6/include -I/usr/lib/glib/include
SWARMLDFLAGS = -L${swarm_libdir} -rpath ${swarm_libdir} -L/usr/lib
-L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext
-lX11 -lm
After that, in the source code all it takes is
#include <glib.h>
and you can use their collections. I'm not saying it is the greatest
library on earth, but the documentation is fairly good and that library
is widely used. It has a class called "Array" that works like a swarm
list, but it claims to have fast removal via a hash tree. It is like a
swarm list in that removal of an object causes all of the others to
slide one notch to the left.
I've not had as much luck with GNUstep, although I did try pretty hard.
I can compile some of the test GNUstep applications, but i can't figure
how to make Swarm code find them. I don't understand what changes are
necessary to the Swarm Makefiles, I guess. The error I always get
indicates it cannot find a header file:
HeatbugModelSwarm.m:9: base/KeyedCollection.h: No such file or directory
I tried changing the CFLAGS in /usr/etc/swarm/Makefile.common to add
-I/usr/GNUstep/Headers/gnustep, to mimic the approach that worked for
glib, but I got no satisfaction.
I'm hoping Mr GNUstep Scott Christley is still in this list and he may
tell me the secret words!
I am impressed with the java libraries that Marcus pointed me at. If I
had time to rewrite classes in Java, I might go that route.
That reminds me to ask. Irene's announcement of Swarm 2 said that a
single app can have some Java classes and some Obj-c classes. If I were
to use the Java collection's list library in the Java files, could that
list be then passed over to the Obj-C class? would it know what to do
with it?
--
Paul E. Johnson email: address@hidden
Dept. of Political Science http://lark.cc.ukans.edu/~pauljohn
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66045 FAX: (785) 864-5700
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- Making swarm use functions from other toolkits (Glib, GNUstep),
Paul Johnson <=