Patchwork [2/2] strace: add configure options libaio and acl

login
register
mail settings
Submitter Kang Kai
Date June 21, 2013, 8:12 a.m.
Message ID <7a0305f34aa1f986856e699b69242e353986b6dc.1371802236.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/52205/
State Accepted
Commit 302a039cda0b4dc8829844c15db846f055424f8b
Headers show

Comments

Kang Kai - June 21, 2013, 8:12 a.m.
Add strace configure options libaio and acl to enable or disable build
with them. Then PACKAGECONFIG can be used to handle dependency.

Set "libaio" as a default feature of PACKAGECONFIG.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 .../strace-4.8/strace-add-configure-options.patch  |   60 ++++++++++++++++++++
 meta/recipes-devtools/strace/strace_4.8.bb         |    9 +++-
 2 files changed, 68 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-devtools/strace/strace-4.8/strace-add-configure-options.patch
Paul Eggleton - June 28, 2013, 5:16 p.m.
On Friday 21 June 2013 16:12:21 Kai Kang wrote:
> Add strace configure options libaio and acl to enable or disable build
> with them. Then PACKAGECONFIG can be used to handle dependency.
> 
> Set "libaio" as a default feature of PACKAGECONFIG.
>...
> 
> +PACKAGECONFIG_class-target ?= "libaio"
> +PACKAGECONFIG_class-target += "${@base_contains('DISTRO_FEATURES', 'acl',
> 'acl', '', d)}"

I realise this has already been merged, but I think there are a couple of issues
with the above. Firstly, for consistency, I think the first option should be
called "aio" and not "libaio". Secondly, although this seems to work the use
of overrides, += and ?= together is a little bit confusing. Perhaps the following
would be a bit clearer:

PACKAGECONFIG_class-target ?= "aio \
                               ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"

Cheers,
Paul
Kang Kai - July 1, 2013, 1:52 a.m.
On 2013?06?29? 01:16, Paul Eggleton wrote:
> On Friday 21 June 2013 16:12:21 Kai Kang wrote:
>> Add strace configure options libaio and acl to enable or disable build
>> with them. Then PACKAGECONFIG can be used to handle dependency.
>>
>> Set "libaio" as a default feature of PACKAGECONFIG.
>> ...
>>
>> +PACKAGECONFIG_class-target ?= "libaio"
>> +PACKAGECONFIG_class-target += "${@base_contains('DISTRO_FEATURES', 'acl',
>> 'acl', '', d)}"

Hi Paul,

> I realise this has already been merged, but I think there are a couple of issues
> with the above. Firstly, for consistency, I think the first option should be
> called "aio" and not "libaio". 
OK, I'll update it.

> Secondly, although this seems to work the use
> of overrides, += and ?= together is a little bit confusing. Perhaps the following
> would be a bit clearer:
>
> PACKAGECONFIG_class-target ?= "aio \
>                                ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
I considered this way.
When 'acl' in distro feature, I want strace enable acl support. But
PACKAGECONFIG could be overwritten that even 'acl' in distro feature but
not in 'PACKAGECONFIG'.

Thanks,
Kai

>
> Cheers,
> Paul
>
Paul Eggleton - July 1, 2013, 9:45 a.m.
On Monday 01 July 2013 09:52:42 Kang Kai wrote:
> On 2013?06?29? 01:16, Paul Eggleton wrote:
> > Secondly, although this seems to work the use
> > of overrides, += and ?= together is a little bit confusing. Perhaps the
> > following would be a bit clearer:
> > 
> > PACKAGECONFIG_class-target ?= "aio \
> > 
> >                                ${@base_contains('DISTRO_FEATURES', 'acl',
> >                                'acl', '', d)}"
> 
> I considered this way.
> When 'acl' in distro feature, I want strace enable acl support. But
> PACKAGECONFIG could be overwritten that even 'acl' in distro feature but
> not in 'PACKAGECONFIG'.

I don't think this is a big issue - we have a fairly strong precedent for 
doing it this way so that PACKAGECONFIG customisation overrides 
DISTRO_FEATURES, based on usage in other recipes.

Cheers,
Paul

Patch

diff --git a/meta/recipes-devtools/strace/strace-4.8/strace-add-configure-options.patch b/meta/recipes-devtools/strace/strace-4.8/strace-add-configure-options.patch
new file mode 100644
index 0000000..27266d9
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace-4.8/strace-add-configure-options.patch
@@ -0,0 +1,60 @@ 
+Add options "aio" and "acl" to enable/disable libaio and acl support.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- strace-4.8/configure.ac.orig	2013-06-21 15:37:52.145892182 +0800
++++ strace-4.8/configure.ac	2013-06-21 15:45:49.029909004 +0800
+@@ -219,7 +219,6 @@ AC_CHECK_HEADERS(m4_normalize([
+ 	netinet/sctp.h
+ 	poll.h
+ 	stropts.h
+-	sys/acl.h
+ 	sys/asynch.h
+ 	sys/conf.h
+ 	sys/epoll.h
+@@ -231,6 +230,19 @@ AC_CHECK_HEADERS(m4_normalize([
+ 	sys/uio.h
+ 	sys/vfs.h
+ ]))
++
++AC_ARG_ENABLE([acl],
++	[AS_HELP_STRING([--enable-acl], [turn on acl support])],
++	[case $enableval in
++	yes) 
++		AC_CHECK_HEADERS([sys/acl.h])
++		;;
++	no)  ;;
++	*)   AC_MSG_ERROR([bad value $enableval for aio option]) ;;
++	esac]
++	
++)
++
+ AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
+                  [], [], [#include <stddef.h>
+ #include <sys/socket.h>
+@@ -301,10 +313,19 @@ AC_CHECK_SIZEOF([long])
+ AC_CHECK_SIZEOF([long long])
+ AC_CHECK_SIZEOF([rlim_t],,[#include <sys/resource.h>])
+ 
+-AC_CHECK_HEADERS([libaio.h], [
+-	AC_CHECK_MEMBERS([struct iocb.u.c.flags],,, [#include <libaio.h>])
+-	AC_CHECK_DECLS([IO_CMD_PWRITE, IO_CMD_PWRITEV],,, [#include <libaio.h>])
+-])
++AC_ARG_ENABLE([aio],
++	[AS_HELP_STRING([--enable-aio], [turn on libaio support])],
++	[case $enableval in
++	yes) 
++	AC_CHECK_HEADERS([libaio.h], [
++		AC_CHECK_MEMBERS([struct iocb.u.c.flags],,, [#include <libaio.h>])
++		AC_CHECK_DECLS([IO_CMD_PWRITE, IO_CMD_PWRITEV],,, [#include <libaio.h>])
++	])
++	;;
++	no)  ;;
++	*)   AC_MSG_ERROR([bad value $enableval for aio option]) ;;
++	esac]
++)
+ 
+ AC_PATH_PROG([PERL], [perl])
+ 
diff --git a/meta/recipes-devtools/strace/strace_4.8.bb b/meta/recipes-devtools/strace/strace_4.8.bb
index c1ffdd1..0f4d2f0 100644
--- a/meta/recipes-devtools/strace/strace_4.8.bb
+++ b/meta/recipes-devtools/strace/strace_4.8.bb
@@ -6,12 +6,19 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=124500c21e856f0912df29295ba104c7"
 PR = "r0"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \
-           file://git-version-gen"
+           file://git-version-gen \
+           file://strace-add-configure-options.patch"
 
 SRC_URI[md5sum] = "c575ef43829586801f514fd91bfe7575"
 SRC_URI[sha256sum] = "f492291f07a7c805c07a8395cce1ea054a6401ad414f4cc12185672215e1d7f8"
 inherit autotools
 
+PACKAGECONFIG_class-target ?= "libaio"
+PACKAGECONFIG_class-target += "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
+
+PACKAGECONFIG[libaio] = "--enable-aio,--disable-aio,libaio"
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
+
 export INCLUDES = "-I. -I./linux"
 
 do_configure_prepend() {