gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Installation procedures and paths for third party libraries in


From: Roberto Aragón
Subject: Re: [Gm2] Installation procedures and paths for third party libraries in gm2
Date: Wed, 21 Mar 2018 18:07:34 +0100

El Tue, 20 Mar 2018 12:15:37 +0000
Gaius Mulley <address@hidden> escribió:
> Roberto Aragón <address@hidden> writes:
> 
> > Hi, Gaius:
> >
> > My name is Roberto Aragón and I'm currently developing a C/C++
> > library with bindings to GUI toolkits like Xaw, GTK2 and QT5 to be
> > able to write GUI code in GNU Modula-2.
> >
> > I'd like to take advice in how third party libraries should
> > integrate with gm2 tree. I'd like to make easier to the user the
> > installation and use of the library along with the standard
> > compilation procedures of GM2 but also using simple makefiles.
> >
> > I'm writting this question here because I think it would be useful
> > for other GM2 users in this situation.
> >
> > Regards,
> > Roberto  
> 
> Hi Roberto,
> 
> thank you for your introduction - interesting and useful work creating
> bindings for gm2!
> 
> I think the front end driver the 'gm2' program should be altered so
> that it can pick up third party libraries easily.  This should not be
> a great change as it already has most of this in place.  Currently
> the options gm2 -flibs=iso,pim
> 
> search the system iso and then pim libraries.  I propose that the
> driver is changed so that:
> 
> gm2 -flibs=a,b,iso,pim foo.mod
> 
> will internally change the search path to:
> 
> gm2 -I/opt/gm2/lib/gcc/x86_64-linux-gnu/6.4.0/m2/a \
>     -I/opt/gm2/lib/gcc/x86_64-linux-gnu/6.4.0/m2/b \
>     -I/opt/gm2/lib/gcc/x86_64-linux-gnu/6.4.0/m2/iso \
>     -I/opt/gm2/lib/gcc/x86_64-linux-gnu/6.4.0/m2/pim \
>     foo.mod
> 
> would this be suitable?
> 
> regards,
> Gaius

Hi Gaius,

Sure, it seems a very good solution, but maybe I should elaborate a
little more my case to see if it could fit.

My distribution is made of four shared libraries and four static
libraries with a common interface (a set of .def files), but no .mod
files required. Every library links to one of four available toolkits
(currently Xaw7, Gtk+ 1.2, Gtk 2.0 and Qt5), so the user choose the
look and feel of his/her GUI just by linking to one library or another,
without making any change to the code.

This is a big advantage, but It should require a way to specify not
only the includes of the library, but also which library
will be linked with. It is also very important to note that every
library has its own linking requirements, so the compiler (or the user)
will have to provide linking requirements of the toolkit.

Here comes a sort of use case: suppose the user wants to generate two
executables for a single GUI program, one linked with Gtk 2.0 and the
other with Qt5. So, the compiling process would have to issue, in the
end, some kind of commands like these:

$ gm2 -c -g -I$COMMON_DEFS_INCLUDE_PATH program.mod -o program.o
$ gm2 -fonlylink -g -I/usr/include/glib-2.0 -I/usr/include/gtk-2.0
-lglib-2.0 -lgtk-x11-2.0 -L$LIBRARY_PATH -lmy_gtk2_lib program.mod -o
program_gtk2_linked
$ gm2 -fonlylink -g -I/usr/include/qt5/QtCore -lQt5Core -L$LIBRARY_PATH
-lmy_qt5_lib program.mod -o program_qt5_linked

If your solution takes into account the generation of all these command
lines according to the my_xxx_lib choosen by the user, the compilation
should be done successfully.

Currently, I'm using pkg-config to resolve includes, libs and
linking requirements, but this approach requires the user to
install the libraries in the system. I think this is also a good
alternative, but I'd like to have your opinion.

The project is in pre-alpha stage (no unit tests, no regression
tests, sorry), ugly and untested C-ported code, only inception phase,
but I'll be very pleased to hear feedback from anyone. Source code is
posted in GitHub: https://github.com/robarago/m2gtx

Sorry for the looong response. Regards,
Roberto



reply via email to

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