[lsb-discuss] pkgconfig in LSB Build Environment

Daniel Yek dyek at real.com
Fri Mar 2 16:38:24 PST 2007


This is the second issue with LSB Build Environment, where too many 
dependencies were pulled into the application.

COMMAND LINE:
gcc -o gtkhello gtkhello.c $(pkg-config --cflags --libs gtk+-2.0) 
-Wl,--dynamic-linker,/lib/ld-lsb.so.3


#include <gtk/gtk.h>
int main(int argc, char **argv)
{
     GtkWindow *window;
     gtk_init(&argc, &argv);
     window = GTK_WINDOW(g_object_new(GTK_TYPE_WINDOW,
                           "title", "My window title",
                           NULL));

     g_signal_connect(G_OBJECT(window),
                      "delete-event", G_CALLBACK(gtk_false),
                      NULL);
     g_signal_connect(G_OBJECT(window),
                      "destroy", G_CALLBACK(gtk_main_quit),
                      NULL);
     gtk_widget_show_all(GTK_WIDGET(window));
     gtk_main();

     return 0;
}

SI:
bash-3.1$ ./gtkhello
./gtkhello: error while loading shared libraries: libXrandr.so.2: cannot 
open shared object file: No such file or directory


bash-3.1$ ./lsbappchk gtkhello
Checking binary gtkhello
DT_NEEDED: libXrandr.so.2 is used, but not part of the LSB
DT_NEEDED: libXinerama.so.1 is used, but not part of the LSB
DT_NEEDED: libXfixes.so.3 is used, but not part of the LSB
DT_NEEDED: libXcursor.so.1 is used, but not part of the LSB
DT_NEEDED: libXft.so.2 is used, but not part of the LSB
DT_NEEDED: libXrender.so.1 is used, but not part of the LSB
DT_NEEDED: libpangox-1.0.so.0 is used, but not part of the LSB
DT_NEEDED: libfreetype.so.6 is used, but not part of the LSB


The problem is pkg-config within LSB BE pulling in modules not defined in LSB:

BE:
bash-3.1$ pkg-config --cflags --libs gtk+-2.0
-DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 
-I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include  -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 
-lXrandr -lXinerama -lXfixes -lXcursor -latk-1.0 -lgdk_pixbuf-2.0 
-lpangoxft-1.0 -lXft -lXrender -lXext -lpangox-1.0 -lX11 -lpangoft2-1.0 
-lfontconfig -lfreetype -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl 
-lglib-2.0



I heard that one possible solution is to use a LSB .pc file, but I couldn't 
find it in my BE; here is the list of all .pc files existing in BE:

BE:
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/fontconfig.pc
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/xcomposite.pc
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/freetype2.pc
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/xevie.pc
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/xfixes.pc
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/xft.pc
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/xcursor.pc
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/xrender.pc
/opt/lsb-buildenv-ia32/usr/X11R6/lib/pkgconfig/xdamage.pc
/opt/lsb-buildenv-ia32/usr/lib/Qt3Support.pc
/opt/lsb-buildenv-ia32/usr/lib/QtNetwork.pc
/opt/lsb-buildenv-ia32/usr/lib/QtOpenGL.pc
/opt/lsb-buildenv-ia32/usr/lib/QtSvg.pc
/opt/lsb-buildenv-ia32/usr/lib/QtSql.pc
/opt/lsb-buildenv-ia32/usr/lib/QtXml.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gtk+-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gtk+-x11-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gmodule-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gthread-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/openssl.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/libcrypto.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/libssl.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/fontconfig.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/pango.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gobject-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gdk-pixbuf-xlib-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/sqlite3.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gmodule-no-export-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gdk-x11-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/libpng.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/libpng12.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/qt-mt.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/freetype2.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/pangoxft.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/pangoft2.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/pangox.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/atk.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/glib-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/neon.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/libxml-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gdk-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/pkgconfig/gdk-pixbuf-2.0.pc
/opt/lsb-buildenv-ia32/usr/lib/QtCore.pc
/opt/lsb-buildenv-ia32/usr/lib/QtGui.pc


I don't know what is the solution to this yet.

Thanks.

-- 
Daniel Yek




More information about the lsb-discuss mailing list