Patchwork [meta-initramfs,1/3] klibc_2.0.2: refactor recipe to respect exec_prefix

login
register
mail settings
Submitter Andrea Adami
Date Aug. 29, 2013, 11:11 p.m.
Message ID <713c1595c331edd780a13d832612a1d8e6add25b.1377817383.git.andrea.adami@gmail.com>
Download mbox | patch
Permalink /patch/57085/
State Accepted, archived
Commit 123c38942d708a383b3e0d308d2dd771cedcd0f8
Headers show

Comments

Andrea Adami - Aug. 29, 2013, 11:11 p.m.
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
---
 .../klibc/klibc-2.0.2/klibc-linux-libc-dev.patch   |  2 +-
 .../klibc/klibc-2.0.2/prefix.patch                 | 14 --------------
 .../klibc/klibc-2.0.2/staging.patch                |  2 +-
 meta-initramfs/recipes-devtools/klibc/klibc.inc    |  4 +++-
 .../recipes-devtools/klibc/klibc_2.0.2.bb          | 22 ++++++++++------------
 5 files changed, 15 insertions(+), 29 deletions(-)
 delete mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/prefix.patch

Patch

diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/klibc-linux-libc-dev.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/klibc-linux-libc-dev.patch
index 28efcfd..2043064 100644
--- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/klibc-linux-libc-dev.patch
+++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/klibc-linux-libc-dev.patch
@@ -14,7 +14,7 @@  Index: klibc-2.0~rc2/scripts/Kbuild.install
  	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
  	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
 -	$(Q)$(MAKE) -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install
-+	$(Q)for x in $(KLIBCKERNELSRC)/include/asm $(KLIBCKERNELSRC)/include/asm* $(KLIBCKERNELSRC)/include/linux $(KLIBCKERNELSRC)/include/mtd; do \
++	$(Q)for x in ../../../include/asm ../../../include/asm-generic ../../../include/linux ../../../include/mtd; do \
 +		ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \
 +	done
  	$(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/prefix.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/prefix.patch
deleted file mode 100644
index 6f5ff0d..0000000
--- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/prefix.patch
+++ /dev/null
@@ -1,14 +0,0 @@ 
-Index: klibc-1.5.24/Makefile
-===================================================================
---- a/Makefile	2011-07-27 15:50:53.000000000 +0200
-+++ b/Makefile	2011-08-01 00:47:56.000000000 +0200
-@@ -39,7 +39,7 @@
- export PERL       := perl
- 
- # Location for installation
--export prefix      = /usr
-+export prefix      = $(INST)
- export bindir      = $(prefix)/bin
- export libdir      = $(prefix)/lib
- export mandir      = $(prefix)/man
-
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/staging.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/staging.patch
index 03955f2..400864b 100644
--- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/staging.patch
+++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.2/staging.patch
@@ -21,7 +21,7 @@  Index: klibc-1.5.24/scripts/Kbuild.install
  	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
  	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
 -	$(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
- 	$(Q)for x in $(KLIBCKERNELSRC)/include/asm $(KLIBCKERNELSRC)/include/asm* $(KLIBCKERNELSRC)/include/linux $(KLIBCKERNELSRC)/include/mtd; do \
+ 	$(Q)for x in ../../../include/asm ../../../include/asm-generic ../../../include/linux ../../../include/mtd; do \
  		ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \
  	done
 @@ -103,7 +100,6 @@
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc
index 4d5f6c4..5f05c9f 100644
--- a/meta-initramfs/recipes-devtools/klibc/klibc.inc
+++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc
@@ -37,7 +37,6 @@  SRC_URI_append_linux-uclibceabi = " file://klibc-config-eabi.patch \
 "
 
 SRC_URI += "file://klibc-linux-libc-dev.patch \
-            file://prefix.patch \
             file://staging.patch \
 "
 
@@ -46,6 +45,9 @@  S = "${WORKDIR}/git"
 EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \
                 'CROSS_COMPILE=${TARGET_PREFIX}' \
                 'KLIBCKERNELSRC=${STAGING_DIR_TARGET}${exec_prefix}' \
+                'prefix=${exec_prefix}' \
+                'INSTALLROOT=${D}' \
+                'SHLIBDIR=${libdir}' \
 "
 
 do_configure () {
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.2.bb b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.2.bb
index 9c2590e..4244cf2 100644
--- a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.2.bb
+++ b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.2.bb
@@ -1,27 +1,25 @@ 
 PR = "${INC_PR}.0"
 
-export INST = "${D}"
-
 do_install() {
     oe_runmake install
 
     # the crosscompiler is packaged by klcc-cross
     # remove klcc
-    rm ${D}${base_bindir}/klcc
+    rm ${D}${bindir}/klcc
     # remove now empty dir
-    rmdir ${D}${base_bindir}
+    rmdir ${D}${bindir}
 
-    install -d ${D}${base_libdir}
-    install -m 755 usr/klibc/klibc-*.so ${D}${base_libdir}
-    (cd  ${D}${base_libdir}; ln -s klibc-*.so klibc.so)
+    install -d ${D}${libdir}
+    install -m 755 usr/klibc/klibc-*.so ${D}${libdir}
+    (cd  ${D}${libdir}; ln -s klibc-*.so klibc.so)
 }
 
 PACKAGES = "libklibc libklibc-staticdev libklibc-dev"
-FILES_libklibc = "${base_libdir}/klibc-*.so"
-FILES_libklibc-staticdev = "${base_libdir}/klibc/lib/libc.a"
-FILES_libklibc-dev = "${base_libdir}/klibc.so \
-                      ${base_libdir}/klibc/lib/* \
-                      ${base_libdir}/klibc/include/* \
+FILES_libklibc = "${libdir}/klibc-*.so"
+FILES_libklibc-staticdev = "${libdir}/klibc/lib/libc.a"
+FILES_libklibc-dev = "${libdir}/klibc.so \
+                      ${libdir}/klibc/lib/* \
+                      ${libdir}/klibc/include/* \
 "
 require klibc.inc
 SUMMARY = "klibc, a small C library for use with initramfs"