zypper: Fix build on uclibc

uclibc does not have rpmatch() so we define
it if zypper is being compiled for uclibc

(From OE-Core rev: 1ea9b31f304e54ce4b7c2d38582d1775a46cd8c6)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj 2012-06-06 18:28:02 -07:00 committed by Richard Purdie
parent 13136e4c20
commit c383a30aee
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,23 @@
rpmatch() is missing in uclibc so we provide a local definition
in form of a macro
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
Index: git/src/utils/prompt.h
===================================================================
--- git.orig/src/utils/prompt.h 2012-06-06 15:51:00.899112775 -0700
+++ git/src/utils/prompt.h 2012-06-06 15:52:17.003116762 -0700
@@ -172,4 +172,12 @@
return errstr;
}
+#ifdef __UCLIBC__
+#define rpmatch(line) \
+ ( (line == NULL)? -1 : \
+ (*line == 'y' || *line == 'Y')? 1 : \
+ (*line == 'n' || *line == 'N')? 0 : \
+ -1 )
+#endif /* __UCLIBC__ */
+
#endif /*ZYPPERPROMPT_H_*/

View File

@ -16,6 +16,7 @@ SRC_URI = "git://github.com/openSUSE/zypper.git;protocol=git \
file://dso_linking_change_build_fix.patch \
file://rpm5-flag.patch \
file://gcc-scope.patch \
file://rpmatch.patch \
"
S = "${WORKDIR}/git"
@ -25,3 +26,4 @@ RDEPENDS_${PN} = "rpm-libs"
RRECOMMENDS_${PN} = "procps util-linux-uuidgen"
PACKAGE_ARCH = "${MACHINE_ARCH}"
OECMAKE_CXX_LINK_FLAGS_libc-uclibc += "-lintl"