Patchwork [PATCHv2] systemd: use AC_CHECK_TOOL instead of AC_PATH_TOOL when checking objcopy, strings, gperf

login
register
mail settings
Submitter Martin Jansa
Date April 16, 2013, 10:01 p.m.
Message ID <1366149704-12490-1-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/48387/
State Accepted
Commit 6ae99136f1c1c59f4e55331c43cf0c0bac5abcdd
Headers show

Comments

Martin Jansa - April 16, 2013, 10:01 p.m.
* with external toolchain I have different HOST_PREFIX and HOST_SYS
  AC_PATH_TOOL is using HOST_SYS as prefix and fails to find objcopy
  then it tries objcopy without prefix which is found on host, but
  that objcopy does not work for arm libs
* with internal toolchain gperf is not prefixed with HOST_PREFIX, but
  fallback to "gperf" only finds the one in native sysroot first
* based on http://lists.linuxtogo.org/pipermail/openembedded-core/2013-April/037985.html

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 ...se-AC_CHECK_TOOL-for-objcopy-strings-and-.patch | 41 ++++++++++++++++++++++
 meta/recipes-core/systemd/systemd_199.bb           |  6 +++-
 2 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch
Martin Jansa - April 16, 2013, 10:10 p.m.
On Wed, Apr 17, 2013 at 12:01:44AM +0200, Martin Jansa wrote:
> * with external toolchain I have different HOST_PREFIX and HOST_SYS
>   AC_PATH_TOOL is using HOST_SYS as prefix and fails to find objcopy
>   then it tries objcopy without prefix which is found on host, but
>   that objcopy does not work for arm libs
> * with internal toolchain gperf is not prefixed with HOST_PREFIX, but
>   fallback to "gperf" only finds the one in native sysroot first
> * based on http://lists.linuxtogo.org/pipermail/openembedded-core/2013-April/037985.html
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  ...se-AC_CHECK_TOOL-for-objcopy-strings-and-.patch | 41 ++++++++++++++++++++++
>  meta/recipes-core/systemd/systemd_199.bb           |  6 +++-
>  2 files changed, 46 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-core/systemd/systemd/0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch
> 
> diff --git a/meta/recipes-core/systemd/systemd/0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch b/meta/recipes-core/systemd/systemd/0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch
> new file mode 100644
> index 0000000..d847bbc
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd/0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch
> @@ -0,0 +1,41 @@
> +From d6f92bcbbae9a577adb9588c7b2783a5d0bf343d Mon Sep 17 00:00:00 2001
> +From: Martin Jansa <Martin.Jansa@gmail.com>
> +Date: Tue, 16 Apr 2013 14:20:41 +0200
> +Subject: [PATCH] configure: use AC_CHECK_TOOL for objcopy, strings and gperf
> +
> +* using AC_PATH_TOOL does not allow to override it from shell environment
> +  which is useful when cross-compiling
> +* with external toolchain I have different HOST_PREFIX and HOST_SYS
> +  AC_PATH_TOOL is using HOST_SYS as prefix and fails to find objcopy
> +  which is available only as ${TARGET_PREFIX}objcopy then it tries
> +  objcopy without prefix which is found on host, but that objcopy
> +  does not work for !host (e.g. arm when building on x86) libs
> +
> +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> +Upstream-Status: Submitted
> +http://lists.freedesktop.org/archives/systemd-devel/2013-April/010468.html
> +
> +---
> + configure.ac | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 33b0ca9..519f1a9 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -86,9 +86,9 @@ GOBJECT_INTROSPECTION_CHECK([1.31.1])
> +    AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
> +    enable_introspection=no])
> + 
> +-AC_PATH_TOOL(OBJCOPY, objcopy)
> +-AC_PATH_TOOL(STRINGS, strings)
> +-AC_PATH_TOOL(GPERF, gperf)
> ++AC_CHECK_TOOL(OBJCOPY, objcopy)
> ++AC_CHECK_TOOL(STRINGS, strings)
> ++AC_CHECK_TOOL(GPERF, gperf)
> + if test -z "$GPERF" ; then
> +         AC_MSG_ERROR([*** gperf not found])
> + fi
> +-- 
> +1.8.1.5
> +
> diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
> index d22df12..bbe19ea 100644
> --- a/meta/recipes-core/systemd/systemd_199.bb
> +++ b/meta/recipes-core/systemd/systemd_199.bb
> @@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
>  PROVIDES = "udev"
>  
>  PE = "1"
> -PR = "r2"
> +PR = "r3"
>  
>  DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0"
>  DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
> @@ -27,6 +27,7 @@ SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
>             file://0002-readahead-chunk-on-spinning-media.patch \
>             file://0003-readahead-cleanups.patch \
>             file://0013-systemd-sysctl-Handle-missing-etc-sysctl.conf-proper.patch \
> +           file://0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch \
>             file://199-firmware.patch \
>             file://init \
>            "
> @@ -77,6 +78,9 @@ EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
>  do_configure_prepend() {
>  	export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
>  
> +	export STRINGS = "${HOST_PREFIX}strings"
> +	export GPERF = "${HOST_PREFIX}gperf"

Ignore this one, extra spaces are ok for bitbake.conf but I should
remove them again here.

> +
>  	sed -i -e 's:=/root:=${ROOT_HOME}:g' units/*.service*
>  }
>  
> -- 
> 1.8.1.5
>

Patch

diff --git a/meta/recipes-core/systemd/systemd/0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch b/meta/recipes-core/systemd/systemd/0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch
new file mode 100644
index 0000000..d847bbc
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch
@@ -0,0 +1,41 @@ 
+From d6f92bcbbae9a577adb9588c7b2783a5d0bf343d Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Tue, 16 Apr 2013 14:20:41 +0200
+Subject: [PATCH] configure: use AC_CHECK_TOOL for objcopy, strings and gperf
+
+* using AC_PATH_TOOL does not allow to override it from shell environment
+  which is useful when cross-compiling
+* with external toolchain I have different HOST_PREFIX and HOST_SYS
+  AC_PATH_TOOL is using HOST_SYS as prefix and fails to find objcopy
+  which is available only as ${TARGET_PREFIX}objcopy then it tries
+  objcopy without prefix which is found on host, but that objcopy
+  does not work for !host (e.g. arm when building on x86) libs
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Upstream-Status: Submitted
+http://lists.freedesktop.org/archives/systemd-devel/2013-April/010468.html
+
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 33b0ca9..519f1a9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -86,9 +86,9 @@ GOBJECT_INTROSPECTION_CHECK([1.31.1])
+    AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
+    enable_introspection=no])
+ 
+-AC_PATH_TOOL(OBJCOPY, objcopy)
+-AC_PATH_TOOL(STRINGS, strings)
+-AC_PATH_TOOL(GPERF, gperf)
++AC_CHECK_TOOL(OBJCOPY, objcopy)
++AC_CHECK_TOOL(STRINGS, strings)
++AC_CHECK_TOOL(GPERF, gperf)
+ if test -z "$GPERF" ; then
+         AC_MSG_ERROR([*** gperf not found])
+ fi
+-- 
+1.8.1.5
+
diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
index d22df12..bbe19ea 100644
--- a/meta/recipes-core/systemd/systemd_199.bb
+++ b/meta/recipes-core/systemd/systemd_199.bb
@@ -9,7 +9,7 @@  LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
 PROVIDES = "udev"
 
 PE = "1"
-PR = "r2"
+PR = "r3"
 
 DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0"
 DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
@@ -27,6 +27,7 @@  SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
            file://0002-readahead-chunk-on-spinning-media.patch \
            file://0003-readahead-cleanups.patch \
            file://0013-systemd-sysctl-Handle-missing-etc-sysctl.conf-proper.patch \
+           file://0001-configure-use-AC_CHECK_TOOL-for-objcopy-strings-and-.patch \
            file://199-firmware.patch \
            file://init \
           "
@@ -77,6 +78,9 @@  EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
 do_configure_prepend() {
 	export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
 
+	export STRINGS = "${HOST_PREFIX}strings"
+	export GPERF = "${HOST_PREFIX}gperf"
+
 	sed -i -e 's:=/root:=${ROOT_HOME}:g' units/*.service*
 }