pkg-config-lite

Oliver Lange bloody at bloody.in-berlin.de
Sun Apr 8 12:29:17 PDT 2012


Am 03.04.2012 18:42, schrieb Kevin Fox:
>
> Would it make sense to do a libglib-lite here? I'm guessing all those
> features would be pretty self contained. You could write a script that
> pulled just the c files that you need from the specified glib source
> tree and fill in the blanks with some typedefs and a little bit of code?
>

It's not that simple. The glib sourcecodes are heavily intertwined,
with multi-threading stuff (atomic ops etc.), slice allocators,
locale & utf-8 support functions, error logging, gnulib, core macros
etc etc., pulling tons of code into even the most trivial functions.
It took me almost a week to extract just the required glib code for
the tiny snippet in -lite. Virtually all functions have been strongly
shaved & simplified to get rid of all the other stuff.

I've started this thing just to have a pkg-config version for MinGW
that doesn't need any more libs, but then i've read about other ppl
mentioning that circular dependency issue, so i decided to make the
code snippet as tiny as possible just to show how little code is
required from glib and then make public what i've got.

Looks like there are alot of opinions about the issue. There was also
a discussion about popt. Well, parsing commandline args by hand isn't
that hard, innit? On the other hand, the included popt code seems to
do the job, so why not either keep it as-is or rewrite commandline
parsing for use with no external lib at all?

However, as i see it, pkg-config might require some rewriting anyhow.
Using glib functions which deliver utf-8 strings/paths and then using
these strings with regular libc functions regardless of the current
locale is problematic anyhow. Either use no glib functions at all,
or use glib only. That's what glib was made for, shield the developer
from all the libc stuff and the incompatibilities on various platforms.

But then, pkg-config is such a tiny tool.. every single piece of it
could be written independently without using any external lib..
If i had to guess, i'd think that pkg-config will be rewritten some day.
My 2 cents (not that $0.02 was worth much these days).

Anyway, i've made public what i've got, you guys have fun with it.. ..or 
not.

-- 

Cheers,

Oliver.


More information about the pkg-config mailing list