mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] kconfig: Fix build on Darwin
@ 2013-02-16 11:33 Bernhard Walle
  2013-02-20 18:06 ` Michael Olbrich
  0 siblings, 1 reply; 5+ messages in thread
From: Bernhard Walle @ 2013-02-16 11:33 UTC (permalink / raw)
  To: ptxdist

Darwin 12.2.0 (Mac OS 10.8) defines CIRCLEQ_HEAD but doesn't define
CIRCLEQ_HEAD_INITIALIZER. Since mconf.c uses CIRCLEQ_HEAD_INITIALIZER,
the build fails.

A simple and safe fix is to always use our own copy of the CIRCLEQ_
macros on every platform. Include "missing.h" and don't include
<sys/queue.h". That works also on Linux, verified on current Arch Linux
with glibc 2.17.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
 scripts/kconfig/expr.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index 59402a3..041b08e 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -12,7 +12,6 @@ extern "C" {
 
 #include <assert.h>
 #include <stdio.h>
-#include <sys/queue.h>
 #ifndef __cplusplus
 #include <stdbool.h>
 #endif
-- 
1.8.1.3


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] kconfig: Fix build on Darwin
  2013-02-16 11:33 [ptxdist] [PATCH] kconfig: Fix build on Darwin Bernhard Walle
@ 2013-02-20 18:06 ` Michael Olbrich
  2013-05-11  7:19   ` Andreas Bießmann
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Olbrich @ 2013-02-20 18:06 UTC (permalink / raw)
  To: ptxdist

On Sat, Feb 16, 2013 at 12:33:28PM +0100, Bernhard Walle wrote:
> Darwin 12.2.0 (Mac OS 10.8) defines CIRCLEQ_HEAD but doesn't define
> CIRCLEQ_HEAD_INITIALIZER. Since mconf.c uses CIRCLEQ_HEAD_INITIALIZER,
> the build fails.
> 
> A simple and safe fix is to always use our own copy of the CIRCLEQ_
> macros on every platform. Include "missing.h" and don't include
> <sys/queue.h". That works also on Linux, verified on current Arch Linux
> with glibc 2.17.

I prefer a AC_CHECK_HEADER in configure.ac and the use
"#ifdef SYS_QUEUE_H", I think.
Also, you need to add a patch to scripts/ptx-modifications/ so this is not
lost, when we update to a newer kconfig version.

Michael

> Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
> ---
>  scripts/kconfig/expr.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
> index 59402a3..041b08e 100644
> --- a/scripts/kconfig/expr.h
> +++ b/scripts/kconfig/expr.h
> @@ -12,7 +12,6 @@ extern "C" {
>  
>  #include <assert.h>
>  #include <stdio.h>
> -#include <sys/queue.h>
>  #ifndef __cplusplus
>  #include <stdbool.h>
>  #endif
> -- 
> 1.8.1.3
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCH] kconfig: Fix build on Darwin
  2013-02-20 18:06 ` Michael Olbrich
@ 2013-05-11  7:19   ` Andreas Bießmann
  2013-05-13  7:37     ` Michael Olbrich
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Bießmann @ 2013-05-11  7:19 UTC (permalink / raw)
  To: PTXdist ML; +Cc: Bernhard Walle

From: Bernhard Walle <bernhard@bwalle.de>

Darwin 12.2.0 (Mac OS 10.8) defines CIRCLEQ_HEAD but doesn't define
CIRCLEQ_HEAD_INITIALIZER. Since mconf.c uses CIRCLEQ_HEAD_INITIALIZER,
the build fails.

A simple and safe fix is to always use our own copy of the CIRCLEQ_
macros on every platform. Include "missing.h" and don't include
<sys/queue.h>. That works also on Linux, verified on current Arch Linux
with glibc 2.17.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
[add patch to scripts/ptx-modifications]
Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
---
Even darwin 11.4.2 with latest toolchain does not define
CIRCLEQ_HEAD_INITIALIZER. Therefore +1 for this patch, it should also be
applied to 2012.12.x stable branch.

Michael, your proposed solution does not work. Darwin provides a sys/queue.h,
defines CIRCLEQ_HEAD but misses to define CIRCLEQ_HEAD_INITIALIZER. I think it
is too much effort to address all the possible cases in autotools.
Another solution could be to check for availability of
CIRCLEQ_HEAD_INITIALIZER and do not remove sys/queue.h, however, this change
fixes another warning for me.

 scripts/kconfig/expr.h                             |  1 -
 .../0008-kconfig-Fix-build-on-Darwin.patch         | 34 ++++++++++++++++++++++
 scripts/ptx-modifications/series                   |  1 +
 3 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch

diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index 59402a3..041b08e 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -12,7 +12,6 @@ extern "C" {
 
 #include <assert.h>
 #include <stdio.h>
-#include <sys/queue.h>
 #ifndef __cplusplus
 #include <stdbool.h>
 #endif
diff --git a/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch b/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch
new file mode 100644
index 0000000..3ebcdee
--- /dev/null
+++ b/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch
@@ -0,0 +1,34 @@
+From b55da7043756f75fa53519630d4f783cd6501fda Mon Sep 17 00:00:00 2001
+From: Bernhard Walle <bernhard@bwalle.de>
+Date: Sat, 16 Feb 2013 12:33:28 +0100
+Subject: [PATCH] kconfig: Fix build on Darwin
+
+Darwin 12.2.0 (Mac OS 10.8) defines CIRCLEQ_HEAD but doesn't define
+CIRCLEQ_HEAD_INITIALIZER. Since mconf.c uses CIRCLEQ_HEAD_INITIALIZER,
+the build fails.
+
+A simple and safe fix is to always use our own copy of the CIRCLEQ_
+macros on every platform. Include "missing.h" and don't include
+<sys/queue.h". That works also on Linux, verified on current Arch Linux
+with glibc 2.17.
+
+Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
+---
+ scripts/kconfig/expr.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
+index 59402a3..041b08e 100644
+--- a/scripts/kconfig/expr.h
++++ b/scripts/kconfig/expr.h
+@@ -12,7 +12,6 @@ extern "C" {
+ 
+ #include <assert.h>
+ #include <stdio.h>
+-#include <sys/queue.h>
+ #ifndef __cplusplus
+ #include <stdbool.h>
+ #endif
+-- 
+1.8.2.2
+
diff --git a/scripts/ptx-modifications/series b/scripts/ptx-modifications/series
index 621ad86..f89a629 100644
--- a/scripts/ptx-modifications/series
+++ b/scripts/ptx-modifications/series
@@ -9,3 +9,4 @@
 0005-nconf-remove-special-P_COMMENT-output.patch
 0006-mconf-fix-comment-on-exit.patch
 0007-kconfig-define-CIRCLEQ_-macros-when-needed.patch
+0008-kconfig-Fix-build-on-Darwin.patch
-- 
1.8.2.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] kconfig: Fix build on Darwin
  2013-05-11  7:19   ` Andreas Bießmann
@ 2013-05-13  7:37     ` Michael Olbrich
  2013-05-13  8:00       ` Andreas Bießmann
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Olbrich @ 2013-05-13  7:37 UTC (permalink / raw)
  To: ptxdist

On Sat, May 11, 2013 at 09:19:46AM +0200, Andreas Bießmann wrote:
> From: Bernhard Walle <bernhard@bwalle.de>
> 
> Darwin 12.2.0 (Mac OS 10.8) defines CIRCLEQ_HEAD but doesn't define
> CIRCLEQ_HEAD_INITIALIZER. Since mconf.c uses CIRCLEQ_HEAD_INITIALIZER,
> the build fails.
> 
> A simple and safe fix is to always use our own copy of the CIRCLEQ_
> macros on every platform. Include "missing.h" and don't include
> <sys/queue.h>. That works also on Linux, verified on current Arch Linux
> with glibc 2.17.
> 
> Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
> [add patch to scripts/ptx-modifications]
> Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
> ---
> Even darwin 11.4.2 with latest toolchain does not define
> CIRCLEQ_HEAD_INITIALIZER. Therefore +1 for this patch, it should also be
> applied to 2012.12.x stable branch.
> 
> Michael, your proposed solution does not work. Darwin provides a sys/queue.h,
> defines CIRCLEQ_HEAD but misses to define CIRCLEQ_HEAD_INITIALIZER. I think it
> is too much effort to address all the possible cases in autotools.
> Another solution could be to check for availability of
> CIRCLEQ_HEAD_INITIALIZER and do not remove sys/queue.h, however, this change
> fixes another warning for me.

I've applied this to master for now. I'd like to see if it causes any
problems on Linux before I apply this to the 2012.12.x stable branch.
Please remind me later to do that. Maybe when the next monthly release is
due.

Michael

> 
>  scripts/kconfig/expr.h                             |  1 -
>  .../0008-kconfig-Fix-build-on-Darwin.patch         | 34 ++++++++++++++++++++++
>  scripts/ptx-modifications/series                   |  1 +
>  3 files changed, 35 insertions(+), 1 deletion(-)
>  create mode 100644 scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch
> 
> diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
> index 59402a3..041b08e 100644
> --- a/scripts/kconfig/expr.h
> +++ b/scripts/kconfig/expr.h
> @@ -12,7 +12,6 @@ extern "C" {
>  
>  #include <assert.h>
>  #include <stdio.h>
> -#include <sys/queue.h>
>  #ifndef __cplusplus
>  #include <stdbool.h>
>  #endif
> diff --git a/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch b/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch
> new file mode 100644
> index 0000000..3ebcdee
> --- /dev/null
> +++ b/scripts/ptx-modifications/0008-kconfig-Fix-build-on-Darwin.patch
> @@ -0,0 +1,34 @@
> +From b55da7043756f75fa53519630d4f783cd6501fda Mon Sep 17 00:00:00 2001
> +From: Bernhard Walle <bernhard@bwalle.de>
> +Date: Sat, 16 Feb 2013 12:33:28 +0100
> +Subject: [PATCH] kconfig: Fix build on Darwin
> +
> +Darwin 12.2.0 (Mac OS 10.8) defines CIRCLEQ_HEAD but doesn't define
> +CIRCLEQ_HEAD_INITIALIZER. Since mconf.c uses CIRCLEQ_HEAD_INITIALIZER,
> +the build fails.
> +
> +A simple and safe fix is to always use our own copy of the CIRCLEQ_
> +macros on every platform. Include "missing.h" and don't include
> +<sys/queue.h". That works also on Linux, verified on current Arch Linux
> +with glibc 2.17.
> +
> +Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
> +---
> + scripts/kconfig/expr.h | 1 -
> + 1 file changed, 1 deletion(-)
> +
> +diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
> +index 59402a3..041b08e 100644
> +--- a/scripts/kconfig/expr.h
> ++++ b/scripts/kconfig/expr.h
> +@@ -12,7 +12,6 @@ extern "C" {
> + 
> + #include <assert.h>
> + #include <stdio.h>
> +-#include <sys/queue.h>
> + #ifndef __cplusplus
> + #include <stdbool.h>
> + #endif
> +-- 
> +1.8.2.2
> +
> diff --git a/scripts/ptx-modifications/series b/scripts/ptx-modifications/series
> index 621ad86..f89a629 100644
> --- a/scripts/ptx-modifications/series
> +++ b/scripts/ptx-modifications/series
> @@ -9,3 +9,4 @@
>  0005-nconf-remove-special-P_COMMENT-output.patch
>  0006-mconf-fix-comment-on-exit.patch
>  0007-kconfig-define-CIRCLEQ_-macros-when-needed.patch
> +0008-kconfig-Fix-build-on-Darwin.patch
> -- 
> 1.8.2.2
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] kconfig: Fix build on Darwin
  2013-05-13  7:37     ` Michael Olbrich
@ 2013-05-13  8:00       ` Andreas Bießmann
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Bießmann @ 2013-05-13  8:00 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 860 bytes --]

On 05/13/2013 09:37 AM, Michael Olbrich wrote:
> On Sat, May 11, 2013 at 09:19:46AM +0200, Andreas Bießmann wrote:
>> From: Bernhard Walle <bernhard@bwalle.de>

>> Michael, your proposed solution does not work. Darwin provides a sys/queue.h,
>> defines CIRCLEQ_HEAD but misses to define CIRCLEQ_HEAD_INITIALIZER. I think it
>> is too much effort to address all the possible cases in autotools.
>> Another solution could be to check for availability of
>> CIRCLEQ_HEAD_INITIALIZER and do not remove sys/queue.h, however, this change
>> fixes another warning for me.
> 
> I've applied this to master for now. I'd like to see if it causes any
> problems on Linux before I apply this to the 2012.12.x stable branch.
> Please remind me later to do that. Maybe when the next monthly release is
> due.

will do.

Best regards

Andreas Bießmann


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-13  7:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-16 11:33 [ptxdist] [PATCH] kconfig: Fix build on Darwin Bernhard Walle
2013-02-20 18:06 ` Michael Olbrich
2013-05-11  7:19   ` Andreas Bießmann
2013-05-13  7:37     ` Michael Olbrich
2013-05-13  8:00       ` Andreas Bießmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox