Re: the *-config scripts

Owen Taylor <> writes:
> > Don't you just do this by installing package "gnome1", "gnome2", etc.?
> This doesn't feel right to me. We definitely want to support simultaneous
> GTK+-1.2 and 1.4 build environments in the short term. I don't think that
> means we want to have gtk-config --libs gtk14.

Any concrete reason for this feeling?

(I would expect gtk-config --libs to always return the libs for the
GTK that particular gtk-config was installed from, so a module arg
makes no sense for gtk-config - but pkg-config is a different case...)
> It's possible that a path is sufficient to handle this. If you want
> the 1.2 development environment you put /usr/share/pkgconfig first in
> your path, if you want the 1.4 development environment; you put
> /opt/gtk14/pkgconfig first in your path.

All pkg-config scripts are the same, with the exception of where they
look for the files by default. There's no reason you would
install two pkg-config scripts. If you have stuff in nonstandard
locations, you add those locations to your PKGCONFIG_PATH. You can
even make up your own module names if you have strange multiple

To me, futzing around with my path is far more annoying than just
specifying which lib I want:
 pkg-config --libs gtk12
 pkg-config --libs gtk14
 pkg-config --libs gtkmyfunkyhackedcopy

I see no value to a "symlink" module name (plain "gtk") that points to
the "default version of gtk", because there are no cases whatsoever
where you want the default (major) version rather than a specific
version. And if there are, you could always do this:
 if pkg-config --test gtk14
    # use 1.4
    # use 1.2

But, at least in the GTK case (I can think of exceptions for other
libs that remain more backward compatible), you never want "the
default version", always a specific version.

When you might conceivably want a default version, just add a
"symlink" module name without a version number, and like gtk-config
that will give you the flags for the "primary" installation of the
library. So pkg-config --libs gtk gives you the equivalent of
gtk-config --libs and may well be implemented that way.

(Of course, a larger problem is that even if you say 'pkg-config --libs
gtk14', if that gives you back -lgtk and is actually GTK
1.2, you are in a world of hurt. 

I think there may be a category mistake: from the perspective of the
software, there is no sense in which GTK 1.2 and GTK 1.4 are "the
same" library, they are never interchangeable, and they only have the
same name as an assist to human understanding.

Therefore I tend to say we should just have -lgtk14, much like
-lX11, because giving the same name to two things that are never
interchangeable is just asking for pain...

After all the whole point of these foo-config scripts is that you
don't care what weird junk is in the compile/link flags and it all
just works.)


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