gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] building a shared object


From: Gaius Mulley
Subject: Re: [Gm2] building a shared object
Date: Thu, 22 Apr 2010 00:20:35 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

SiTex Graphics <address@hidden> writes:

> Is there a simple example of how to build a shared object with gm2?  I
> assume I can just use -fshared to produce a .so, but how do I specify
> which functions or symbols are exported?
>
> I failed to find any info in the manual but I may well have overlooked
> something...
>
> Thanks,
> Scott

Hi Scott,

there is a section:  How to produce swig interface files 
in the documentation - which describes the process.  I need to write
another section just describing the shared library, rather than the
combination of swig and shared libraries..

Also there are a few examples under:

gcc-4.1.2/gcc/gm2/examples/swig

I've recently modified the examples so that most of them build from
the build directory:

so:

$ cd build-4.1.2/gcc/gm2/examples/swig/tiny
$ make pre-install

should yield:

rm -f -f *.o *.so a.out *.pyc *~ *_wrap* tiny.py *.i *.lst *_m2.cpp
../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fshared
-fswig
-I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny:../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs-iso
-c -fPIC -g -fswig
../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
swig -c++ -python tiny.i
../../../../g++ -c -fPIC tiny_wrap.cxx -I/usr/include/python2.5
../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fshared -c
-fPIC -g -fmakelist
-I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny:../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs-iso
../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fuselist
-fobject-path=.:../../../gm2-libs/SO:../../../gm2-libs-pim/SO:../../../gm2-libs-iso/SO
-fPIC -g -shared -fshared
-I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny
../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
tiny_wrap.o -o _tiny.so
PYTHONPATH=.:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny
python
../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/testtiny.py
starting Modula-2 tiny
inside Python
calling out
finishing Python
finishing Modula-2 tiny

regards,
Gaius




reply via email to

[Prev in Thread] Current Thread [Next in Thread]