After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693764 - configure script fails to call pkg-config properly when cross-compiling
configure script fails to call pkg-config properly when cross-compiling
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-14 07:36 UTC by Alexey Chernov
Modified: 2013-02-14 10:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Autogen and configure log (21.51 KB, application/octet-stream)
2013-02-14 09:35 UTC, Alexey Chernov
Details
printenv output (3.30 KB, application/octet-stream)
2013-02-14 09:36 UTC, Alexey Chernov
Details

Description Alexey Chernov 2013-02-14 07:36:38 UTC
When performing cross-compilation of master branch of gstreamer git against custom sysroot, configure fails to find GLib as it calls pkg-config some wrong way, although pkg-config itself is configured properly (using PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR according to man page) and single call to it gives proper results:

Here's a debug logs with PKG_CONFIG_DEBUG_SPEW on:
export PKG_CONFIG_SYSROOT_DIR=/mnt/rasp-pi-rootfs
export PKG_CONFIG_LIBDIR=/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig
export PKG_CONFIG_DEBUG_SPEW=1
1. single call: pkg-config --cflags glib-2.0
PKG_CONFIG_DEBUG_SPEW variable enabling debug spew
Adding directory '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig' from PKG_CONFIG_PATH
Global variable definition 'pc_sysrootdir' = '/mnt/rasp-pi-rootfs'
Global variable definition 'pc_top_builddir' = '$(top_builddir)'
Option --cflags seen
Error printing enabled by default due to use of --version, --libs, --cflags, --libs-only-l, --libs-only-L, --libs-only-other, --cflags-only-I, --cflags-only-other or --list. Value of --silence-errors: 0
Error printing enabled
Adding virtual 'pkg-config' package to list of known packages
Scanning directory '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig'
File 'freetype2.pc' appears to be a .pc file
Will find package 'freetype2' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/freetype2.pc'
Ignoring file '..' in search directory; not a .pc file
File 'lxpanel.pc' appears to be a .pc file
Will find package 'lxpanel' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/lxpanel.pc'
File 'lxappearance.pc' appears to be a .pc file
Will find package 'lxappearance' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/lxappearance.pc'
File 'gio-unix-2.0.pc' appears to be a .pc file
Will find package 'gio-unix-2.0' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/gio-unix-2.0.pc'
File 'gmodule-no-export-2.0.pc' appears to be a .pc file
Will find package 'gmodule-no-export-2.0' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/gmodule-no-export-2.0.pc'
File 'gmodule-2.0.pc' appears to be a .pc file
Will find package 'gmodule-2.0' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/gmodule-2.0.pc'
Ignoring file '.' in search directory; not a .pc file
File 'gthread-2.0.pc' appears to be a .pc file
Will find package 'gthread-2.0' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/gthread-2.0.pc'
File 'libpcrecpp.pc' appears to be a .pc file
Will find package 'libpcrecpp' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/libpcrecpp.pc'
File 'gmodule-export-2.0.pc' appears to be a .pc file
Will find package 'gmodule-export-2.0' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/gmodule-export-2.0.pc'
File 'libpcre.pc' appears to be a .pc file
Will find package 'libpcre' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/libpcre.pc'
File 'libpcreposix.pc' appears to be a .pc file
Will find package 'libpcreposix' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/libpcreposix.pc'
File 'gobject-2.0.pc' appears to be a .pc file
Will find package 'gobject-2.0' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/gobject-2.0.pc'
File 'zlib.pc' appears to be a .pc file
Will find package 'zlib' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/zlib.pc'
File 'glib-2.0.pc' appears to be a .pc file
Will find package 'glib-2.0' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/glib-2.0.pc'
File 'gio-2.0.pc' appears to be a .pc file
Will find package 'gio-2.0' in file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/gio-2.0.pc'
Looking for package 'glib-2.0'
Looking for package 'glib-2.0-uninstalled'
Reading 'glib-2.0' from file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/glib-2.0.pc'
Parsing package file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/glib-2.0.pc'
  line>prefix=/usr
 Variable declaration, 'prefix' has value '/usr'
  line>exec_prefix=${prefix}
 Variable declaration, 'exec_prefix' has value '/usr'
  line>libdir=${prefix}/lib/arm-linux-gnueabihf
 Variable declaration, 'libdir' has value '/usr/lib/arm-linux-gnueabihf'
  line>includedir=${prefix}/include
 Variable declaration, 'includedir' has value '/usr/include'
  line>
  line>glib_genmarshal=glib-genmarshal
 Variable declaration, 'glib_genmarshal' has value 'glib-genmarshal'
  line>gobject_query=gobject-query
 Variable declaration, 'gobject_query' has value 'gobject-query'
  line>glib_mkenums=glib-mkenums
 Variable declaration, 'glib_mkenums' has value 'glib-mkenums'
  line>
  line>Name: GLib
  line>Description: C Utility Library
  line>Version: 2.32.4
  line>Requires.private: libpcre
Looking for package 'libpcre'
Looking for package 'libpcre-uninstalled'
Reading 'libpcre' from file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/libpcre.pc'
Parsing package file '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/libpcre.pc'
  line>
  line>
  line>prefix=/usr
 Variable declaration, 'prefix' has value '/usr'
  line>exec_prefix=${prefix}
 Variable declaration, 'exec_prefix' has value '/usr'
  line>libdir=${prefix}/lib/arm-linux-gnueabihf
 Variable declaration, 'libdir' has value '/usr/lib/arm-linux-gnueabihf'
  line>includedir=${prefix}/include
 Variable declaration, 'includedir' has value '/usr/include'
  line>
  line>Name: libpcre
  line>Description: PCRE - Perl compatible regular expressions C library with 8 bit character support
  line>Version: 8.30
  line>Libs: -L${libdir} -lpcre
  line>Cflags: -I${includedir} 
Path position of 'libpcre' is 1
Package libpcre has -I/usr/include in Cflags
Removing -I/usr/include from cflags for libpcre
Adding 'libpcre' to list of known packages, returning as package 'libpcre'
  line>Libs: -L${libdir} -lglib-2.0 
  line>Libs.private: -pthread -lrt  -lpcre    
Unknown keyword 'Libs.private' in '/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig/glib-2.0.pc'
  line>Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include 
Path position of 'GLib' is 1
Adding 'glib-2.0' to list of known packages, returning as package 'glib-2.0'
 original:  GLib  libpcre 
 sorted:  GLib  libpcre 
 original:  GLib  libpcre 
 sorted:  GLib  libpcre 
-I/mnt/rasp-pi-rootfs/usr/include/glib-2.0 -I/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/glib-2.0/include

2. Inside ./configure:
checking for GLIB... PKG_CONFIG_DEBUG_SPEW variable enabling debug spew
Adding directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/pkgconfig' from PKG_CONFIG_PATH
Adding directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/lib/pkgconfig' from PKG_CONFIG_PATH
Adding directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/share/pkgconfig' from PKG_CONFIG_PATH
Global variable definition 'pc_sysrootdir' = '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc'
Global variable definition 'pc_top_builddir' = '$(top_builddir)'
Option --atleast-pkgconfig-version seen
Error printing disabled by default, value of --print-errors: 1
Error printing enabled
PKG_CONFIG_DEBUG_SPEW variable enabling debug spew
Adding directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/pkgconfig' from PKG_CONFIG_PATH
Adding directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/lib/pkgconfig' from PKG_CONFIG_PATH
Adding directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/share/pkgconfig' from PKG_CONFIG_PATH
Global variable definition 'pc_sysrootdir' = '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc'
Global variable definition 'pc_top_builddir' = '$(top_builddir)'
Option --short-errors seen
no
configure: Option --errors-to-stdout seen
Option --print-errors seen
Error printing disabled by default, value of --print-errors: 1
Error printing enabled
Adding virtual 'pkg-config' package to list of known packages
Cannot open directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/pkgconfig' in package search path: No such file or directory
Cannot open directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/lib/pkgconfig' in package search path: No such file or directory
Cannot open directory '/home/alex/unzip/rpi-qt5/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../arm-linux-gnueabihf/libc/usr/share/pkgconfig' in package search path: No such file or directory
Looking for package 'glib-2.0'
Looking for package 'glib-2.0-uninstalled'
Looking for 'glib-2.0' using legacy -config scripts
Calling gnome-config
No package 'glib-2.0' found
Looking for package 'gobject-2.0'
Looking for package 'gobject-2.0-uninstalled'
Looking for 'gobject-2.0' using legacy -config scripts
Calling gnome-config
No package 'gobject-2.0' found
Looking for package 'gmodule-no-export-2.0'
Looking for package 'gmodule-no-export-2.0-uninstalled'
Looking for 'gmodule-no-export-2.0' using legacy -config scripts
Calling gnome-config
No package 'gmodule-no-export-2.0' found
configure: error: This package requires GLib >= 2.32.0 to compile.

Host system is Kubuntu 12.10 x86_64, autotools versions are
  checking for autoconf >= 2.62 ... found 2.69, ok.
  checking for automake >= 1.11 ... found 1.11.6, ok.
  checking for autopoint >= 0.17 ... found 0.18.1, ok.
  checking for libtoolize >= 2.2.6 ... found 2.4.2, ok.
  checking for pkg-config >= 0.8.0 ... found 0.26, ok.
Comment 1 Sebastian Dröge (slomo) 2013-02-14 09:20:57 UTC
How and where do you think is it calling pkg-config incorrectly? It works fine in other cross-compilation scenarios
Comment 2 Tim-Philipp Müller 2013-02-14 09:27:18 UTC
Could you provide the output of:

 $ (printenv)

and the *whole* output of autogen.sh/configure.

Both as attachements please, not inline.
Comment 3 Alexey Chernov 2013-02-14 09:31:51 UTC
Yes, I forgot to mention configure string: CROSS_COMPILE=arm-linux-gnueabihf-
./configure --host=arm-linux-gnueabihf --with-sysroot=/mnt/rasp-pi-tools
--prefix=/usr/local

It doesn't respect both PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR variables
for unknown reason when searching for GLib while it is required to do so to
make a proper cross-compilation. Perhaps, something else should be set up, but
according to pkg-config documentation states it's enough to search for target
packages.
Comment 4 Alexey Chernov 2013-02-14 09:35:29 UTC
Created attachment 236013 [details]
Autogen and configure log

Sure, here they are.
Comment 5 Alexey Chernov 2013-02-14 09:36:43 UTC
Created attachment 236014 [details]
printenv output
Comment 6 Sebastian Dröge (slomo) 2013-02-14 09:42:00 UTC
Well, those variables are not touched anywhere in configure and only interpreted by pkg-config. I used those variables successfully some days ago with git master.
Comment 7 Alexey Chernov 2013-02-14 10:16:11 UTC
Right you are, configure happens to call arm-linux-gnueabihf-pkg-config which eventually exists in the cross-toolchain and is actually a script with all the affected PKG_CONFIG_* variables overriden.

So, yes, problems with settings. Sorry for disturbing with the report.