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

Re: chonfigure and glib-config



Mohammed Elzubeir wrote:

> Chahine,
>
> I noticed you are using glib-config in chonfigure.. which is deprecated and
> now it's pkg-config.

I don't know Moe, you just informed me of pkg-config's existence:)
Maybe for glib the package name is simply glib, I don't know, I don't have
pkg-config.
What we could do in the macros in that case is to test what a system uses. It
would be simpler to write a function dedicated to locating pkg-config or the
equivalent helper and reusing in the macros. I guess you read the glib.pl
macro, it is trivial...

In any case, I'm seizing this opportunity to give a very brief description of
the way chonfigure works in case someone out there would be interested in
writing a more detailed "internals guide" or user guide for anyone who would be
interested in writing macros for it, or better, extend it:

- open the make.dirs to loacte the source directories where the makefiles
should be generated,
- execute the "macros" in the directory macros
- in each directory,
    * read the make.src in order to determine dependencies; the make src files
only contain the names of the modules a binary depends on, and possibly a few
other options like executing a perl instruction or changing some flag
- guess which source files are going to be automatically generated by swig or
idl tools
- guess which source files will generate the given binary modules
- determine the header files dependencies by reading the source files or
examining the info about automatically generated files
- spread the relevant information from the above computed data for all
makefiles
- generate the config.h if relevant and the makefiles

In the macros, the information is given to a makefile node through a call in
that node's make.src configuration to the macro. The result of the call is
stored in a cache hash table explicitely structured:
$Main::cache{$command}{libs}
$Main::cache{$command}{cflags}
$Main::cache{$command}{config}
You don't have to use all the fields or actually any of them. The macros can
simply do anything you want.

Salam,
Chahine