[oe-commits] Qian Lei : libutempter: Fix compile error

git at git.openembedded.org git at git.openembedded.org
Mon Jan 12 14:36:12 UTC 2015


Module: meta-openembedded.git
Branch: master-next
Commit: da4dab68d601b9bd2903f761f043f0d438033bd5
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=da4dab68d601b9bd2903f761f043f0d438033bd5

Author: Qian Lei <qianl.fnst at cn.fujitsu.com>
Date:   Fri Jan  9 11:01:08 2015 +0800

libutempter: Fix compile error

| iface.c: In function 'utempter_add_record':
| <command-line>:0:12: error: expected expression before '/' token
| iface.c:46:35: note: in expansion of macro 'LIBEXECDIR'
|  #define UTEMPTER_DEFAULT_PATHNAME LIBEXECDIR "/utempter/utempter"

Signed-off-by: Qian Lei <qianl.fnst at cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>

---

 .../libutempter/0001-Fix-macro-error.patch         | 36 ++++++++++++++++++++++
 .../libutempter/libutempter_1.1.6.bb               | 10 +++---
 2 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/meta-oe/recipes-support/libutempter/libutempter/0001-Fix-macro-error.patch b/meta-oe/recipes-support/libutempter/libutempter/0001-Fix-macro-error.patch
new file mode 100644
index 0000000..8140ea3
--- /dev/null
+++ b/meta-oe/recipes-support/libutempter/libutempter/0001-Fix-macro-error.patch
@@ -0,0 +1,36 @@
+From fc2bd592ad17d1c2a2a989750e69dfaedc28c633 Mon Sep 17 00:00:00 2001
+From: Qian Lei <qianl.fnst at cn.fujitsu.com>
+Date: Fri, 9 Jan 2015 10:40:29 +0800
+Subject: [PATCH] Fix macro error
+
+compile error when build on almost all architectures.
+
+Upstream-Status: Pending
+Signed-off-by: Qian Lei <qianl.fnst at cn.fujitsu.com>
+---
+ iface.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/iface.c b/iface.c
+index 5951d81..27793f0 100644
+--- a/iface.c
++++ b/iface.c
+@@ -43,7 +43,14 @@
+        __result; }))
+ #endif
+ 
+-#define	UTEMPTER_DEFAULT_PATHNAME	LIBEXECDIR "/utempter/utempter"
++#ifdef  LIBEXECDIR
++#  define CAT_PATH(DIR1,DIR2)           DIR1##DIR2
++#  define RAW_UTEMPTER_PATH             CAT_PATH(LIBEXECDIR,/utempter/utempter)
++#else
++#  define RAW_UTEMPTER_PATH             /usr/lib/libtempter/utempter/utempter
++#endif
++#define STR_PATH(RAW_STR)               #RAW_STR
++#define UTEMPTER_DEFAULT_PATHNAME       STR_PATH(RAW_UTEMPTER_PATH)
+ 
+ static const char *utempter_pathname;
+ static int saved_fd = -1;
+-- 
+1.8.3.1
+
diff --git a/meta-oe/recipes-support/libutempter/libutempter_1.1.6.bb b/meta-oe/recipes-support/libutempter/libutempter_1.1.6.bb
index 30a6896..f84e649 100644
--- a/meta-oe/recipes-support/libutempter/libutempter_1.1.6.bb
+++ b/meta-oe/recipes-support/libutempter/libutempter_1.1.6.bb
@@ -7,16 +7,17 @@ SECTION = "System Environment/Libraries"
 LICENSE = "GPLv2 & GPLv2+ & LGPLv2 & MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
-SRC_URI = "ftp://ftp.altlinux.org/pub/people/ldv/utempter/${BP}.tar.bz2"
+SRC_URI = "ftp://ftp.altlinux.org/pub/people/ldv/utempter/${BP}.tar.bz2 \
+           file://0001-Fix-macro-error.patch"
 SRC_URI[md5sum] = "b43827806923903aba2bc7cd3a2d45b7"
 SRC_URI[sha256sum] = "b898565f31ced7e5c1fa0a2eaa0f6ff0ed862b5fe375d26375b64bfbdfeac397"
 
-CFLAGS += "-DLIBEXECDIR=$(libexecdir)"
+CFLAGS += "-DLIBEXECDIR=${libexecdir}"
 
 do_compile() {
     oe_runmake                      \
         libdir=${libdir}            \
-        libexecdir=${libexecdir}    \
+        libexecdir=${libexecdir}
 }
 
 do_install() {
@@ -27,10 +28,9 @@ do_install() {
         includedir=${includedir}    \
         mandir=${mandir}
 
-        rm -f ${D}${libdir}/*.a
+    rm -f ${D}${libdir}/*.a
 }
 
 FILES_${PN} = "${libdir}/*.so.*"
 FILES_${PN} += "${libexecdir}/utempter/utempter"
-
 FILES_${PN}-dbg += "${libexecdir}/utempter/.debug/utempter"



More information about the Openembedded-commits mailing list