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 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:
pkg-config --libs gtk+-3.0 
-L/usr/local/lib -lgtk-3 -L/usr/local/lib -lgdk-3 -L/usr/local/lib 
-lpangocairo-1.0 -L/usr/local/lib -lpangoft2-1.0 -L/usr/local/lib -lpango-1.0 
-lm -L/usr/X11R6/lib -lfreetype -lz -L/usr/X11R6/lib -lfontconfig 
-L/usr/local/lib -latk-1.0 -L/usr/local/lib -lcairo-gobject -L/usr/local/lib 
-Wl,-rpath-link,/usr/X11R6/lib -lcairo -L/usr/local/lib -lgdk_pixbuf-2.0 
-L/usr/local/lib -lgio-2.0 -L/usr/local/lib -lgobject-2.0 -L/usr/local/lib 
-lglib-2.0 -lintl -L/usr/local/lib -lgtk-3 -L/usr/local/lib -lgdk-3 
-L/usr/local/lib -lpangocairo-1.0 -L/usr/local/lib -lpangoft2-1.0 
-L/usr/local/lib -lpango-1.0 -lm -L/usr/X11R6/lib -lfreetype -lz 
-L/usr/X11R6/lib -lfontconfig -L/usr/local/lib -latk-1.0 -L/usr/local/lib 
-lcairo-gobject -L/usr/local/lib -Wl,-rpath-link,/usr/X11R6/lib -lcairo 
-L/usr/local/lib -lgdk_pixbuf-2.0 -L/usr/local/lib -lgio-2.0 -L/usr/local/lib 
-lgobject-2.0 -L/usr/local/lib -lglib-2.0 -lintl


With compression:
pkg-config --libs gtk+-3.0   
-L/usr/local/lib -L/usr/X11R6/lib -Wl,-rpath-link,/usr/X11R6/lib -lgtk-3 
-lgdk-3 -lpangocairo-1.0 -lpangoft2-1.0 -lpango-1.0 -lm -lfreetype -lz 
-lfontconfig -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 
-lgobject-2.0 -lglib-2.0 -lintl

Yours:
./bsd-pkg-config.txt --prefix /usr/local --libs gtk+-3.0
 -L/usr/local/lib -lgtk-3 



looks like you neither have expansion of dependencies, nor compression...

cat gtk+-3.0.pc:
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
targets=x11

gtk_binary_version=3.0.0
gtk_host=x86_64-unknown-openbsd5.5

Name: GTK+
Description: GTK+ Graphical UI Library
Version: 3.10.7
Requires: gdk-3.0 atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0
Requires.private: atk atk-bridge-2.0 pangoft2 gio-unix-2.0
Libs: -L${libdir} -lgtk-3
Cflags: -I${includedir}/gtk-3.0



Home | Main Index | Thread Index | Old Index