util/kconfig: Remove utsname for mingw
Mingw doesn't have that this function. Change-Id: I640ea61ff24fba812e3f10771dd7e468dcfc63dd Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/11724 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
30ff36249c
commit
d38b22f8ec
|
@ -7,7 +7,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
|
#ifndef __MINGW32__
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "lkc.h"
|
#include "lkc.h"
|
||||||
|
|
||||||
|
@ -45,19 +47,27 @@ static void sym_add_default(struct symbol *sym, const char *def)
|
||||||
void sym_init(void)
|
void sym_init(void)
|
||||||
{
|
{
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
|
#ifndef __MINGW32__
|
||||||
struct utsname uts;
|
struct utsname uts;
|
||||||
|
#endif
|
||||||
static bool inited = false;
|
static bool inited = false;
|
||||||
|
|
||||||
if (inited)
|
if (inited)
|
||||||
return;
|
return;
|
||||||
inited = true;
|
inited = true;
|
||||||
|
|
||||||
|
#ifndef __MINGW32__
|
||||||
uname(&uts);
|
uname(&uts);
|
||||||
|
#endif
|
||||||
|
|
||||||
sym = sym_lookup("UNAME_RELEASE", 0);
|
sym = sym_lookup("UNAME_RELEASE", 0);
|
||||||
sym->type = S_STRING;
|
sym->type = S_STRING;
|
||||||
sym->flags |= SYMBOL_AUTO;
|
sym->flags |= SYMBOL_AUTO;
|
||||||
|
#ifndef __MINGW32__
|
||||||
sym_add_default(sym, uts.release);
|
sym_add_default(sym, uts.release);
|
||||||
|
#else
|
||||||
|
sym_add_default(sym, "mingw-unknown");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
enum symbol_type sym_get_type(struct symbol *sym)
|
enum symbol_type sym_get_type(struct symbol *sym)
|
||||||
|
|
Loading…
Reference in New Issue