gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] install self made module


From: Gaius Mulley
Subject: Re: [Gm2] install self made module
Date: Fri, 18 Sep 2009 10:40:12 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Martin Kalbfuß <address@hidden> writes:

> Hi,
>
> I like to create a wrapper for a C library. I try to set up a autotool
> distribution for it. I know how to tell autotools to handle unknown
> languages like Modula-2. But I'm not sure how to install the created
> modules.
>
> 1. Which is the right directory for extern modules.

Hi Martin,

on my system it would be:

/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/{iso,pim,ulm}

there after the directories iso, pim, ulm

   iso/*.o        all -g -O0 objects
   iso/O2/*.o     all -g -O2 objects
   iso/SO/*.o     all -g -O0 -fPIC objects
   iso/SO_O2/*.o  all -g -O2 -fPIC objects


> 2. Is there a way to get the standard module install directory? A
> environment variable or something? Autotools doesn't know where to
> install them.

by default gm2 doesn't use an environment variable - although it can
be used to modify the stem of the path if an installation is to be
moved.  But it doesn't tell you the complete path.  One method of
finding this is to take the (non) classic hello world

MODULE hello ;

FROM libc IMPORT printf ;

BEGIN
   printf("hello world\n")
END hello.

and compile it with:

 gm2 -g -fmodules -fpim -c hello.mod

and you get a list of modules and their locations:

Storage.o            : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/iso/Storage.o
SYSTEM.o             : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/iso/SYSTEM.o
M2RTS.o              : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/iso/M2RTS.o
RTExceptions.o       : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/RTExceptions.o
M2EXCEPTION.o        : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/iso/M2EXCEPTION.o
RTentity.o           : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/iso/RTentity.o
EXCEPTIONS.o         : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/iso/EXCEPTIONS.o
ASCII.o              : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/ASCII.o
StrLib.o             : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/StrLib.o
Assertion.o          : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/Assertion.o
DynamicStrings.o     : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/DynamicStrings.o
termios.o            : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/termios.o
FIO.o                : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/FIO.o
errno.o              : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/errno.o
IO.o                 : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/IO.o
StdIO.o              : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/StdIO.o
StrIO.o              : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/StrIO.o
NumberIO.o           : 
/home/gaius/opt/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/gm2/pim/NumberIO.o
hello.o              : hello.o


you can also use:

 gm2 -g -fmodules -fiso -c hello.mod

to find the ISO library path.  If you grep for SYSTEM in both outputs
you will get the appropriate path.  It maybe that gm2 needs a
-fdump-path option - if you need anything like this please drop me a line.


> Another question not related to the topic above. Is there any support
> for objects or are they planed?

no support yet.  Scheduled for after 1.0

> What will happen after 1.0 is reached?

1.0 will be with gcc-4.1.2.  Then I'll port 1.0.x onto later versions
of gcc - (not all gcc versions will be used as the aim is to reach the
head gcc rather than produce a gm2 front end for each intermediate gcc
version :-).  This will likely consume some time.  Once this is
complete (and when gm2 is in the gcc mainline) then work will start on
extending gm2 to include the OO components.  There is also objective
m2 to consider - but a firm definition is needed.

> What are your future plans?

in parallel to the activity of the above gdb hopefully will become
more Modula-2 friendly.  Scopes will be fixed and m2 expressions will
be completed.  Automatic swig production from .def files will also be
improved.

regards,
Gaius




reply via email to

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