Skip to contentSkip to conversation

Fix recipes to build with uclibc

PATCH Superseded Khem Raj 2 participants 5 messages May 19, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

cover Fix recipes to build with uclibc

Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: kraj/uclibc
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/uclibc

Thanks,
Khem Raj <[email protected]>
---

Khem Raj (3):
uclibc/site_config/funcs: getloadavg is unimplemented distcc_2.18.3.bb: Fix compilation on uclibc nfs-utils_1.2.3.bb: Fix compile failure on uclibc

 .../nfs-utils/nfs-utils-1.0.6-uclibc.patch         |   16 +++++++-----
 .../nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch |   26 ++++++++++++++++++++
 .../nfs-utils/nfs-utils_1.2.3.bb                   |    1 +
 meta/recipes-core/uclibc/site_config/funcs         |    1 -
 meta/recipes-devtools/distcc/distcc_2.18.3.bb      |   18 ++++++++++----
 5 files changed, 49 insertions(+), 13 deletions(-)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH 1/3 uclibc/site_config/funcs: getloadavg is unimplemented

---
 meta/recipes-core/uclibc/site_config/funcs |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
meta/recipes-core/uclibc/site_config/funcs +0 -1
index ccc8539..79a3c19 100644
@@ -121,7 +121,6 @@ gethostid
 gethostname
 getifaddrs
 getline
-getloadavg
 getmntent
 getmsg
 getnameinfo
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH 2/3 distcc_2.18.3.bb: Fix compilation on uclibc

In reply to Khem Raj

We enable gtk/gnome in distcc that code uses loadavg() a function unimplemented in uclibc. Therefore for uclibc we disable gnome and gtk+ features in distcc

---
 meta/recipes-devtools/distcc/distcc_2.18.3.bb |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
meta/recipes-devtools/distcc/distcc_2.18.3.bb +13 -5
index 1f5c2af..d6e51d9 100644
@@ -6,7 +6,8 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 PR = "r6"
 
-DEPENDS = "avahi gtk+"
+DEPENDS = "avahi"
+DEPENDS_append-libc-glibc = " gtk+ "
 RRECOMMENDS_${PN} = "avahi-daemon"
 
 # Upstream change this patch periodically so store locally
@@ -24,17 +25,24 @@ inherit autotools pkgconfig update-rc.d
 
 INITSCRIPT_NAME = "distcc"
 
-EXTRA_OECONF = " --with-gtk "
-
-do_install_append() {
+EXTRA_OECONF_libc-glibc = " --with-gtk "
+EXTRA_OECONF_libc-uclibc = " --without-gtk --without-gnome "
+do_install_append_libc-glibc() {
     install -d ${D}${sysconfdir}/init.d/
     install -d ${D}${sysconfdir}/default
+    install -d ${D}${datadir}/distcc/
     install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
     install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
     install -m 0644 ${WORKDIR}/distccmon-gnome.desktop ${D}${datadir}/distcc/
 }
+do_install_append_libc-uclibc() {
+    install -d ${D}${sysconfdir}/init.d/
+    install -d ${D}${sysconfdir}/default
+    install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
+    install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+}
 
-PACKAGES += "distcc-distmon-gnome"
+PACKAGES_append_libc-glibc = " distcc-distmon-gnome"
 
 FILES_${PN} = " ${sysconfdir} \
 		${bindir}/distcc \
Signature · 1 line
1.7.4.1
#3 lore raw

Re: [PATCH 2/3] distcc_2.18.3.bb: Fix compilation on uclibc

Quoted 37 lines · Khem Raj

We enable gtk/gnome in distcc that code uses loadavg() a function unimplemented in uclibc. Therefore for uclibc we disable gnome and gtk+ features in distcc

---
 meta/recipes-devtools/distcc/distcc_2.18.3.bb |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
meta/recipes-devtools/distcc/distcc_2.18.3.bb +6 -4
index 1f5c2af..d6e51d9 100644
@@ -6,7 +6,8 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 PR = "r6"
 
-DEPENDS = "avahi gtk+"
+DEPENDS = "avahi"
+DEPENDS_append-libc-glibc = " gtk+ "
 RRECOMMENDS_${PN} = "avahi-daemon"
 
 # Upstream change this patch periodically so store locally
@@ -24,17 +25,24 @@ inherit autotools pkgconfig update-rc.d
 
 INITSCRIPT_NAME = "distcc"
 
-EXTRA_OECONF = " --with-gtk "
-
-do_install_append() {
+EXTRA_OECONF_libc-glibc = " --with-gtk "
+EXTRA_OECONF_libc-uclibc = " --without-gtk --without-gnome "
+do_install_append_libc-glibc() {
     install -d ${D}${sysconfdir}/init.d/
     install -d ${D}${sysconfdir}/default
+    install -d ${D}${datadir}/distcc/
     install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/

meta/recipes-devtools/distcc/distcc_2.18.3.bb inherit autotools pkgconfig update-rc.d · line 44

Quoted 10 lines
meta/recipes-devtools/distcc/distcc_2.18.3.bb +6 -0
     install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
     install -m 0644 ${WORKDIR}/distccmon-gnome.desktop ${D}${datadir}/distcc/
 }
+do_install_append_libc-uclibc() {
+    install -d ${D}${sysconfdir}/init.d/
+    install -d ${D}${sysconfdir}/default
+    install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
+    install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+}
 

You can surely come up with a patch without that code duplication in? ;-)

Even something like:

do_install_append() {
<common_code>
${DESKTOPINSTALL}
}
DESKTOPINSTALL = ""
DESKTOPINSTALL_libc-glibc () {
<desktopinstall>
}

Cheers,

Richard

author
#4 lore raw

PATCH 3/3 nfs-utils_1.2.3.bb: Fix compile failure on uclibc

In reply to Khem Raj

libio.h is not needed even in case of eglibc but
still the patch is uclibc specific

Refreshed nfs-utils-1.0.6-uclibc.patch against
nfs-utils_1.2.3 no code change

---
 .../nfs-utils/nfs-utils-1.0.6-uclibc.patch         |   16 +++++++-----
 .../nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch |   26 ++++++++++++++++++++
 .../nfs-utils/nfs-utils_1.2.3.bb                   |    1 +
 3 files changed, 36 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.0.6-uclibc.patch +9 -7
index e82480a..6d46d3a 100644
@@ -1,20 +1,22 @@
 Upstream-Status: Inappropriate [embedded specific]
 
---- ./support/nfs/svc_socket.c.orig	2004-12-12 06:43:52.000000000 +0000
-+++ ./support/nfs/svc_socket.c	2004-12-12 06:50:04.000000000 +0000
-@@ -66,6 +66,7 @@
-   memset ((char *) &addr, sizeof (addr));
+Index: nfs-utils-1.2.3/support/nfs/svc_socket.c
+===================================================================
+--- nfs-utils-1.2.3.orig/support/nfs/svc_socket.c
++++ nfs-utils-1.2.3/support/nfs/svc_socket.c
+@@ -67,6 +67,7 @@ svc_socket (u_long number, int type, int
+   memset (&addr, 0, sizeof (addr));
    addr.sin_family = AF_INET;
  
 +#ifndef __UCLIBC__	/* neither getrpcbynumber() nor getrpcbynumber_r() is SuSv3 */
    ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata,
  			  &rpcp);
    if (ret == 0 && rpcp != NULL)
-@@ -99,6 +100,7 @@
+@@ -100,6 +101,7 @@ svc_socket (u_long number, int type, int
  	}
      }
    else
 +#endif
      {
-       if (bindresvport (sock, &addr))
- 	{
+ 	  addr.sin_port = 0;
+ 	  if (bind (sock, (struct sockaddr *) &addr, len) < 0)
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-uclibc-libio.h.patch new file +26 -0
new file mode 100644
index 0000000..465144a
@@ -0,0 +1,26 @@
+[PATCH] fix build with uClibc
+
+uClibc doesn't have/need libio.h, so don't include it from sockaddr.h
+
+Signed-off-by: Peter Korsgaard <[email protected]>
+---
+ support/include/sockaddr.h |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+Upstream-Status: Pending
+
+Index: nfs-utils-1.2.3/support/include/sockaddr.h
+===================================================================
+--- nfs-utils-1.2.3.orig/support/include/sockaddr.h
++++ nfs-utils-1.2.3/support/include/sockaddr.h
+@@ -20,7 +20,10 @@
+ #ifndef NFS_UTILS_SOCKADDR_H
+ #define NFS_UTILS_SOCKADDR_H
+ 
++/* uClibc doesn't have/need libio.h */
++#ifndef __UCLIBC__
+ #include <libio.h>
++#endif
+ #include <stdbool.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
meta/recipes-connectivity/nfs-utils/nfs-utils_1.2.3.bb +1 -0
index b456474..d344f3d 100644
@@ -17,6 +17,7 @@ PR = "r2"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.bz2 \
            file://nfs-utils-1.0.6-uclibc.patch \
+           file://nfs-utils-1.2.3-uclibc-libio.h.patch \
            file://nfsserver"
 
 SRC_URI[md5sum] = "1131dc5f27c4f3905a6e7ee0d594fd4d"
Signature · 1 line
1.7.4.1