[oe] [meta-oe][PATCH] linuxptp: Use environment compiler settings

Otavio Salvador otavio at ossystems.com.br
Tue Jul 1 20:48:33 UTC 2014


If the machine uses hard floating point, the build fails as below:

arm-oel-linux-gnueabi-gcc -Wall ...
In file included from .../build/tmp/sysroots/imx6qsabresd/usr/include/features.h:402:0,
                 from .../build/tmp/sysroots/imx6qsabresd/usr/include/errno.h:28,
                 from clock.c:19:
.../build/tmp/sysroots/imx6qsabresd/usr/include/gnu/stubs.h:7:29:
    fatal error: gnu/stubs-soft.h: No such file or directory
 # include <gnu/stubs-soft.h>

This patch fixes the build system to reuse the CC variable and also
passes over the defined CFLAGS so the choosen optimization and build
options are respected.

Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---
 ...build-Allow-CC-and-prefix-to-be-overriden.patch |   37 ++++++++++++++++++++
 .../recipes-connectivity/linuxptp/linuxptp_1.4.bb  |    7 ++--
 2 files changed, 41 insertions(+), 3 deletions(-)
 create mode 100644 meta-oe/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch

diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch b/meta-oe/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch
new file mode 100644
index 0000000..b1d96ae
--- /dev/null
+++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch
@@ -0,0 +1,37 @@
+From af485c638c61fa883212ea424e676fbf90bee594 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio at ossystems.com.br>
+Date: Tue, 1 Jul 2014 17:37:31 -0300
+Subject: [PATCH] build: Allow CC and prefix to be overriden
+
+Upstream-Status: Pending
+
+Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
+---
+ makefile |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/makefile b/makefile
+index 22e7d0d..809cc8f 100644
+--- a/makefile
++++ b/makefile
+@@ -18,7 +18,7 @@
+ KBUILD_OUTPUT =
+ 
+ DEBUG	=
+-CC	= $(CROSS_COMPILE)gcc
++CC	?= $(CROSS_COMPILE)gcc
+ VER     = -DVER=$(version)
+ CFLAGS	= -Wall $(VER) $(incdefs) $(DEBUG) $(EXTRA_CFLAGS)
+ LDLIBS	= -lm -lrt $(EXTRA_LDFLAGS)
+@@ -35,7 +35,7 @@ incdefs := $(shell $(srcdir)/incdefs.sh)
+ version := $(shell $(srcdir)/version.sh $(srcdir))
+ VPATH	= $(srcdir)
+ 
+-prefix	= /usr/local
++prefix	?= /usr/local
+ sbindir	= $(prefix)/sbin
+ mandir	= $(prefix)/man
+ man8dir	= $(mandir)/man8
+-- 
+1.7.10.4
+
diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp_1.4.bb b/meta-oe/recipes-connectivity/linuxptp/linuxptp_1.4.bb
index 10d6744..4ee0c88 100644
--- a/meta-oe/recipes-connectivity/linuxptp/linuxptp_1.4.bb
+++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp_1.4.bb
@@ -2,13 +2,14 @@ DESCRIPTION = "Precision Time Protocol (PTP) according to IEEE standard 1588 for
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-SRC_URI = "http://sourceforge.net/projects/linuxptp/files/v${PV}/linuxptp-${PV}.tgz"
+SRC_URI = "http://sourceforge.net/projects/linuxptp/files/v${PV}/linuxptp-${PV}.tgz \
+           file://build-Allow-CC-and-prefix-to-be-overriden.patch"
 
 SRC_URI[md5sum] = "a37ad2b2ef7d1ebc4d64a66d3fe55cdf"
 SRC_URI[sha256sum] = "6cfd5291fb7394cc9f25458927874a203971b66b76d1c9d6568e007d0cbd81f2"
 
-EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} ARCH=${TARGET_ARCH} \
-		EXTRA_CFLAGS='-D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_ONESTEP_SYNC'"
+EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} \
+		EXTRA_CFLAGS='-D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_ONESTEP_SYNC ${CFLAGS}'"
 
 do_install () {
     install -d ${D}/${bindir}
-- 
1.7.10.4




More information about the Openembedded-devel mailing list