Skip to contentSkip to conversation

swig + pcre-config

PATCH New Patrick Ohly 1 participant 3 messages Jan 23, 2015

lore
Share & tools
lore
#0 lore raw

cover swig + pcre-config

The reason for the patch series is the observation that swig from meta-openembedded requires pcre-config to be installed on the host system, even though it does not actually get used.

While that can be fixed in the swig recipe, investigating the situation led to the conclusion that the current handling of obsolete config scripts is sub-optimal and does not actually cause undesired usage of the patched scripts to fail.

These two patches address that. They apply to master and dizzy. Applying also to dizzy would have the desirable effect of removing swig's host dependency without having to modify swig, but might also be a bit too intrusive for the stable series.

Patrick Ohly (2):
binconfig-disabled: try harder to prevent usage of config scripts
binconfig-disabled: install config scripts in sysroot

 meta/classes/binconfig-disabled.bbclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH 1/2 binconfig-disabled: try harder to prevent usage of config scripts

Returning a non-zero exit code is not enough to cause errors when configure scripts call the patched config scripts: for example, swig's configure script uses PCRE_LIBS=$PCRE_CONFIG --libs and does not abort on errors. Using empty output may then succeed, for example when the required library is available indirectly.

Returning some nonsense command line arguments covers such cases, because using them will definitely lead to errors during compilation. The faked arguments were chosen such that these errors can be linked back to the root cause.

---
 meta/classes/binconfig-disabled.bbclass | 3 +++
 1 file changed, 3 insertions(+)
meta/classes/binconfig-disabled.bbclass +3 -0
index 27f904e..4c42ae2 100644
@@ -10,6 +10,9 @@ FILES_${PN}-dev += "${bindir}/*-config"
 do_install_append () {
 	for x in ${BINCONFIG}; do
 		echo "#!/bin/sh" > ${D}$x
+		# Make the disabled script emit invalid parameters for those configure
+		# scripts which call it without checking the return code.
+		echo "echo '--should-not-have-used-$x'" > ${D}$x
 		echo "exit 1" >> ${D}$x
 	done
 }
Signature · 1 line
1.8.4.5
#2 lore raw

PATCH 2/2 binconfig-disabled: install config scripts in sysroot

In reply to Patrick Ohly

The purpose of binconfig-disabled is to manipulate config scripts such that using them causes errors. But that only works when the modified config script really gets installed in the sysroot. That is not the case with the staging code in binconfig.bbclass.

Only patched config files get staged. For that reason it seemed more appropriate to change binconfig-disabled instead of binconfig.

The reason for the change was the observation that the swig recipe needs pcre-config installed on the host system. Staging pcre-config removes that host dependency. swig did not actually end up *using* the pcre-config from the host, because later during do_compile the patched configure.ac is used to re-generate configure.

---
 meta/classes/binconfig-disabled.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/classes/binconfig-disabled.bbclass +10 -0
index 4c42ae2..0acc964 100644
@@ -16,3 +16,13 @@ do_install_append () {
 		echo "exit 1" >> ${D}$x
 	done
 }
+
+SYSROOT_PREPROCESS_FUNCS += "binconfig_disabled_sysroot_preprocess"
+
+binconfig_disabled_sysroot_preprocess () {
+	for x in ${BINCONFIG}; do
+		configname=`basename $x`
+		install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+		install ${D}$x ${SYSROOT_DESTDIR}${bindir_crossscripts}
+	done
+}
Signature · 1 line
1.8.4.5