2

I am attempting to create a fairly simple BitBake recipe that uses autotools, which you can see here:

SUMMARY = "an example autotools recipe"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit autotools 
SRC_URI = "file://${TOPDIR}/piu/geo_utilities"
S = "${TOPDIR}/piu/geo_utilities"

After starting a BitBake build with this recipe's default package included, do_configure fails with the following:

configure: line 12851: syntax error near unexpected token `GLIB,'          
configure: line 12851: `PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.12.3)'

When I run ldd --version, I get this: ldd (GNU libc) 2.17.

I've found several sites like this Google Groups post and this GitHub issue which suggest that the problem can be solved by updating pkg-config. I'm running Red Hat, so I've run sudo yum install pkgconfig which returns that pkgconfig-0.27.1-4.el7.x86_64 already installed and latest version.

(this question followed after this question was solved by the answerer)

Community
  • 1
  • 1
karobar
  • 1,250
  • 8
  • 30
  • 61

2 Answers2

5

The proper fix is to inherit pkgconfig. Specifically you need pkgconfig-native built.

Ross Burton
  • 3,516
  • 13
  • 12
0

I believe that this error was due to the do_configure step of my custom recipe being ran before the glib for my target machine was generated. I was able to resolve this error by adding this line to the recipe:

DEPENDS += " glib-2.0 pkgconfig "
karobar
  • 1,250
  • 8
  • 30
  • 61
  • 1
    Close but not quite, you need *native* pkg-config not pkg-config for the target. However building those will cause pkgconfig-native to be built, which is why it appeared to work. – Ross Burton Jan 13 '16 at 20:51
  • @RossBurton, why is it that you need pkgconfig-native? I am trying to understand why it matters if the pkgconfig that runs is built for running on the host. Also I actually had trouble with glib-2.0 and one thing I tried was doing an `inherit pkgconfig` which basically is equivalent to `DEPENDS += pkgconfig-native` – akarollil Aug 24 '18 at 23:37
  • You need pkgconfig-native to get the pkgconfig binaries that work on the build host, as you can't run the pkgconfig binaries that are built for the target. – Ross Burton Aug 26 '18 at 08:05