diff options
author | 2022-09-08 04:54:03 +0100 | |
---|---|---|
committer | 2022-09-08 04:56:09 +0100 | |
commit | 2360d9ea66979cfa5aa408ea50928074ce7ab8af (patch) | |
tree | c7effbb955e40b5119453758ab36a75eb114528b /net-libs/libsmi | |
parent | net-misc/dhcp: Stabilize 4.4.3-r1 x86, #869125 (diff) | |
download | gentoo-2360d9ea66979cfa5aa408ea50928074ce7ab8af.tar.gz gentoo-2360d9ea66979cfa5aa408ea50928074ce7ab8af.tar.bz2 gentoo-2360d9ea66979cfa5aa408ea50928074ce7ab8af.zip |
net-libs/libsmi: fix build with Clang 15 (implicit function declarations)
Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-libs/libsmi')
-rw-r--r-- | net-libs/libsmi/files/libsmi-0.5.0-implicit-function-declarations.patch | 74 | ||||
-rw-r--r-- | net-libs/libsmi/libsmi-0.5.0-r2.ebuild | 38 |
2 files changed, 112 insertions, 0 deletions
diff --git a/net-libs/libsmi/files/libsmi-0.5.0-implicit-function-declarations.patch b/net-libs/libsmi/files/libsmi-0.5.0-implicit-function-declarations.patch new file mode 100644 index 000000000000..f0d52e4ae000 --- /dev/null +++ b/net-libs/libsmi/files/libsmi-0.5.0-implicit-function-declarations.patch @@ -0,0 +1,74 @@ +From: Nicholas Vinson <nvinson234@gmail.com> +To: libsmi@ibr.cs.tu-bs.de +Cc: Nicholas Vinson <nvinson234@gmail.com> +Subject: Implicit function declaration patch + +When building libsmi with clang 15.0.0, clang fails to build due to +errors similar to: + +call to undeclared function 'smiyyerror'; ISO C99 and later do not support +implicit function declarations + +This patch corrects those issues by introducing the needed +declarations defore the function call. + +Thanks, +Nicholas Vinson + +--- a/lib/yang-data.h ++++ b/lib/yang-data.h +@@ -158,10 +158,12 @@ _YangIdentifierRef *listIdentifierRef(Y + /* + * Node and Module functions + */ + _YangNode *addYangNode(const char *value, YangDecl nodeKind, _YangNode *parentPtr); + ++void createIdentifierRef(_YangNode *node, char* prefix, char* ident); ++ + int removeYangNode(_YangNode* target, _YangNode* child); + + _YangModuleInfo *createModuleInfo(_YangNode *modulePtr); + + void createTypeInfo(_YangNode *node); +--- a/lib/parser-yang.y ++++ b/lib/parser-yang.y +@@ -19,10 +19,15 @@ + #include <config.h> + + #ifdef BACKEND_YANG + + #define _ISOC99_SOURCE ++/* define _DEFAULT_SOURCE to get timegm() */ ++#define _DEFAULT_SOURCE 1 ++/* define _BSD_SOURCE & _SVID_SOURCE for backwards compatibility */ ++#define _BSD_SOURCE 1 ++#define _SVID_SOURCE 1 + #include <stdio.h> + #include <errno.h> + #include <stdlib.h> + #include <string.h> + #include <ctype.h> +@@ -44,10 +44,11 @@ + #include "parser-yang.h" + #include "scanner-yang.h" + #include "yang-complex-types.h" + #include "util.h" + #include "error.h" ++#include "yang-check.h" + + #ifdef HAVE_DMALLOC_H + #include <dmalloc.h> + #endif + +--- a/lib/error.h ++++ b/lib/error.h +@@ -40,6 +40,8 @@ extern char* smiGetErrorMsg(int id); + + extern void smiPrintError(Parser *parser, int id, ...); + + extern void smiPrintErrorAtLine(Parser *parser, int id, int line, ...); + ++#include "smi-check.h" ++ + #endif /* _ERROR_H */ + diff --git a/net-libs/libsmi/libsmi-0.5.0-r2.ebuild b/net-libs/libsmi/libsmi-0.5.0-r2.ebuild new file mode 100644 index 000000000000..1473aeacf5c6 --- /dev/null +++ b/net-libs/libsmi/libsmi-0.5.0-r2.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="A Library to Access SMI MIB Information" +HOMEPAGE="https://www.ibr.cs.tu-bs.de/projects/libsmi/" +SRC_URI="https://www.ibr.cs.tu-bs.de/projects/libsmi/download/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="static-libs" +RESTRICT="test" + +PATCHES=( + "${FILESDIR}"/${PN}-0.5.0-implicit-function-declarations.patch +) + +src_configure() { + econf $(use_enable static-libs static) +} + +src_test() { + # sming test is known to fail and some other fail if LC_ALL!=C: + # https://mail.ibr.cs.tu-bs.de/pipermail/libsmi/2008-March/001014.html + sed -i '/^[[:space:]]*smidump-sming.test \\$/d' test/Makefile + LC_ALL=C emake -j1 check +} + +src_install() { + default + + dodoc ANNOUNCE ChangeLog README THANKS TODO \ + doc/{*.txt,smi.dia,smi.dtd,smi.xsd} smi.conf-example + + find "${ED}" -name '*.la' -delete || die +} |