tech-pkg archive

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

Re: Requirements for specifying dependencies on libraries



On Mon, Mar 17, 2014 at 03:17:44PM +0100, Marc Espie wrote:
> On Sun, Mar 16, 2014 at 04:07:18PM +0100, Alistair Crooks wrote:
> > Take a look at othersrc/external/bsd/bsd-pkg-config for a rewritten
> > pkg-config without the perl bootstrapping worries.
> > 
> >     revision 1.1.1.1
> >     date: 2012-08-13 23:45:30 -0700;  author: agc;  state: Exp;  lines: +0 
> > -0;
> >     Dust off my old bsd-pkg-config script and commit it to othersrc.
> > 
> >     Seems to do most of the things that other pkg-config scripts do, albeit
> >     in 150 grungy lines of shell, so I must be missing something.
> 
> Indeed, you are missing something :)
> 
> The main difficulty in pkg-config is recursive expansion of variable
> values *and trimming of duplicate stuff*.
> 
> Without compression of duplicates:
> [...]
> 
> 
> With compression:
> [...]
> 
> Yours:
> [...]
> 
> looks like you neither have expansion of dependencies, nor compression...

Thanks, I've committed some changes to add recursive expansion of
libs, and compression of flags and libs.

Again, I must be missing something - I can't get the line count in my
script above 191 lines :-)

% wc bsd-pkg-config.sh
    191     687    4698 bsd-pkg-config.sh
%

% ./bsd-pkg-config.sh --cflags gtk+-2.0
-I/usr/pkg/include/gtk-2.0 -I/usr/pkg/lib/gtk-2.0/include 
-I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/glib/glib-2.0 
-I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include/cairo 
-I/usr/X11R7/include/freetype2 -I/usr/X11R7/include 
-I/usr/pkg/include/glib/gio-unix-2.0/ -D_REENTRANT 
-I/usr/pkg/include/gdk-pixbuf-2.0 -I/usr/pkg/include/atk-1.0

% ./bsd-pkg-config.sh --libs gtk+-2.0
-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpango-1.0 -lm 
-lglib-2.0 -lintl -lgobject-2.0 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 
-Wl,-rpath,/usr/X11R7/lib -L/usr/X11R7/lib -lfreetype -lz -lfontconfig 
-lgio-2.0 -lX11 -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes 
-lXcomposite -lXdamage -lgdk_pixbuf-2.0 -latk-1.0

%

Regards,
Alistair


Home | Main Index | Thread Index | Old Index