Squashed 'yocto-poky/' content from commit ea562de

git-subtree-dir: yocto-poky
git-subtree-split: ea562de57590c966cd5a75fda8defecd397e6436
diff --git a/meta/recipes-bsp/libacpi/files/ldflags.patch b/meta/recipes-bsp/libacpi/files/ldflags.patch
new file mode 100644
index 0000000..a7424c3
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/files/ldflags.patch
@@ -0,0 +1,41 @@
+libacpi: Remove QA warning: No GNU_HASH in the elf binary
+
+Upstream-Status: Inappropriate [other]
+  Useful within bitbake environment only.
+
+Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+---
+ Makefile  |    3 ++-
+ config.mk |    1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -19,6 +19,7 @@ options:
+ 	@echo "CFLAGS   = ${CFLAGS}"
+ 	@echo "CC       = ${CC}"
+ 	@echo "SOFLAGS  = ${SOFLAGS}"
++	@echo "LDFLAGS  = ${LDFLAGS}"
+ 	@echo "LD       = ${LD}"
+ 
+ .c.o:
+@@ -34,7 +35,7 @@ libacpi.a: ${OBJ}
+ 
+ libacpi.so: ${OBJ}
+ 	@echo LD $@
+-	@${CC} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
++	@${CC} ${SOFLAGS} ${LDFLAGS} -o $@.${SOVERSION} ${OBJ}
+ 
+ test-libacpi: ${OBJ_test}
+ 	@echo LD $@
+--- libacpi-0.2.orig/config.mk
++++ libacpi-0.2/config.mk
+@@ -10,6 +10,7 @@ MANPREFIX = ${PREFIX}/share/man
+ SOFLAGS = -shared -Wl,-soname,${SONAME}
+ CFLAGS += -fPIC -g --pedantic -Wall -Wextra
+ ARFLAGS = cr
++LDFLAGS =
+ 
+ # Compiler and linker
+ CC = cc
diff --git a/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch b/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
new file mode 100644
index 0000000..2fed344
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Pending
+
+Fix libacpi for x32
+    
+    libacpi doesn't use base_libdir for install.  This patch adds
+    base_libdir support so that x32 libraries are installed properly.
+
+Patch Received from:  H.J. Lu <hjl.tools@gmail.com>
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/05
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -8,6 +8,10 @@ SRC_test = test-libacpi.c libacpi.c list
+ OBJ = ${SRC:.c=.o}
+ OBJ_test = ${SRC_test:.c=.o}
+ 
++ifndef base_libdir
++base_libdir=/lib
++endif
++
+ all: options libacpi.a libacpi.so test-libacpi
+ 
+ options:
+@@ -42,13 +46,13 @@ install: all
+ 	@mkdir -p ${DESTDIR}${PREFIX}/include
+ 	@cp -f libacpi.h ${DESTDIR}${PREFIX}/include
+ 	@chmod 644 ${DESTDIR}${PREFIX}/include/libacpi.h
+-	@echo installing library to ${DESTDIR}${PREFIX}/lib
+-	@mkdir -p ${DESTDIR}${PREFIX}/lib
+-	@cp -f libacpi.a ${DESTDIR}${PREFIX}/lib
+-	@chmod 644 ${DESTDIR}${PREFIX}/lib/libacpi.a
+-	@cp -f ${SONAME} ${DESTDIR}${PREFIX}/lib/
+-	@chmod 644 ${DESTDIR}${PREFIX}/lib/${SONAME}
+-	@ln -s ${SONAME} ${DESTDIR}${PREFIX}/lib/libacpi.so
++	@echo installing library to ${DESTDIR}${PREFIX}${base_libdir}
++	@mkdir -p ${DESTDIR}${PREFIX}${base_libdir}
++	@cp -f libacpi.a ${DESTDIR}${PREFIX}${base_libdir}
++	@chmod 644 ${DESTDIR}${PREFIX}${base_libdir}/libacpi.a
++	@cp -f ${SONAME} ${DESTDIR}${PREFIX}${base_libdir}/
++	@chmod 644 ${DESTDIR}${PREFIX}${base_libdir}/${SONAME}
++	@ln -s ${SONAME} ${DESTDIR}${PREFIX}${base_libdir}/libacpi.so
+ 	@echo installing test-libacpi to ${DESTDIR}${PREFIX}/bin
+ 	@mkdir -p ${DESTDIR}${PREFIX}/bin
+ 	@cp -f test-libacpi ${DESTDIR}${PREFIX}/bin
diff --git a/meta/recipes-bsp/libacpi/files/makefile-fix.patch b/meta/recipes-bsp/libacpi/files/makefile-fix.patch
new file mode 100644
index 0000000..c34ef34
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/files/makefile-fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Pending
+
+---
+ Makefile  |    6 +++---
+ config.mk |    3 ++-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile	2007-07-29 14:09:34.000000000 +0200
++++ libacpi-0.2/Makefile	2008-09-26 10:34:53.000000000 +0200
+@@ -25,16 +25,16 @@ ${OBJ}: config.mk libacpi.h
+ 
+ libacpi.a: ${OBJ}
+ 	@echo AR $@
+-	@${AR} $@ ${OBJ}
++	${AR} ${ARFLAGS} $@ ${OBJ}
+ 	@${RANLIB} $@
+ 
+ libacpi.so: ${OBJ}
+ 	@echo LD $@
+-	@${LD} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
++	@${CC} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
+ 
+ test-libacpi: ${OBJ_test}
+ 	@echo LD $@
+-	@${LD} -o $@ ${OBJ_test} ${LDFLAGS}
++	@${CC} -o $@ ${OBJ_test} ${LDFLAGS}
+ 	@strip $@
+ 
+ install: all
+Index: libacpi-0.2/config.mk
+===================================================================
+--- libacpi-0.2.orig/config.mk	2007-07-29 14:09:34.000000000 +0200
++++ libacpi-0.2/config.mk	2008-09-26 10:34:33.000000000 +0200
+@@ -9,9 +9,10 @@ MANPREFIX = ${PREFIX}/share/man
+ # flags
+ SOFLAGS = -shared -Wl,-soname,${SONAME}
+ CFLAGS += -fPIC -g --pedantic -Wall -Wextra
++ARFLAGS = cr
+ 
+ # Compiler and linker
+ CC = cc
+ LD = ${CC}
+-AR = ar cr
++AR = ar
+ RANLIB = ranlib
diff --git a/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch b/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
new file mode 100644
index 0000000..bca75fb
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Used the cross strip instead of host strip to avoid this build error:
+
+| strip: Unable to recognise the format of the input file `test-libacpi'
+| make: *** [test-libacpi] Error 1
+| ERROR: oe_runmake failed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/07
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -39,7 +39,7 @@ libacpi.so: ${OBJ}
+ test-libacpi: ${OBJ_test}
+ 	@echo LD $@
+ 	@${CC} -o $@ ${OBJ_test} ${LDFLAGS}
+-	@strip $@
++	@${STRIP} $@
+ 
+ install: all
+ 	@echo installing header to ${DESTDIR}${PREFIX}/include
diff --git a/meta/recipes-bsp/libacpi/libacpi_0.2.bb b/meta/recipes-bsp/libacpi/libacpi_0.2.bb
new file mode 100644
index 0000000..bf302f3
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/libacpi_0.2.bb
@@ -0,0 +1,30 @@
+SUMMARY = "ACPI data gathering library"
+DESCRIPTION = "General purpose shared library for programs gathering ACPI data on Linux. \
+Thermal zones, battery infomration, fan information and AC states are implemented."
+SECTION = "base"
+HOMEPAGE = "http://www.ngolde.de/libacpi.html"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fec17f82f16630adf2dfb7d2a46f21c5"
+PR = "r6"
+
+SRC_URI = "http://www.ngolde.de/download/libacpi-${PV}.tar.gz \
+	   file://makefile-fix.patch \
+	   file://libacpi_fix_for_x32.patch \
+	   file://use_correct_strip_in_cross_environment.patch \
+	   file://ldflags.patch "
+
+SRC_URI[md5sum] = "05b53dd7bead66dda35fec502b91066c"
+SRC_URI[sha256sum] = "13086e31d428b9c125954d48ac497b754bbbce2ef34ea29ecd903e82e25bad29"
+
+inherit lib_package
+
+COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+
+CFLAGS += "-fPIC"
+EXTRA_OEMAKE += 'STRIP="echo"'
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install() {
+	oe_runmake install DESTDIR=${D} PREFIX=${exec_prefix}
+}