mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-01 23:20:55 +00:00
parent
b80939cc0a
commit
ca4f956f21
@ -33,11 +33,6 @@ SRC_C += strcoll.c strxfrm.c wcscoll.c wcsxfrm.c
|
|||||||
|
|
||||||
include $(REP_DIR)/lib/mk/libc-common.inc
|
include $(REP_DIR)/lib/mk/libc-common.inc
|
||||||
|
|
||||||
#
|
|
||||||
# Version information for sysctl
|
|
||||||
#
|
|
||||||
include $(REP_DIR)/src/lib/libc/version.inc
|
|
||||||
|
|
||||||
vpath % $(REP_DIR)/src/lib/libc
|
vpath % $(REP_DIR)/src/lib/libc
|
||||||
vpath % $(LIBC_DIR)/lib/libc/string
|
vpath % $(LIBC_DIR)/lib/libc/string
|
||||||
|
|
||||||
|
@ -222,18 +222,9 @@ extern "C" int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case KERN_OSRELEASE:
|
case KERN_OSRELEASE:
|
||||||
Genode::strncpy(buf, GENODE_OSRELEASE, *oldlenp);
|
|
||||||
*oldlenp = Genode::strlen(buf);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case KERN_OSREV:
|
case KERN_OSREV:
|
||||||
*(int*)oldp = int(GENODE_OSREV);
|
|
||||||
*oldlenp = sizeof(int);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case KERN_VERSION:
|
case KERN_VERSION:
|
||||||
Genode::strncpy(buf, GENODE_VERSION, *oldlenp);
|
*oldlenp = 0;
|
||||||
*oldlenp = Genode::strlen(buf);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case KERN_HOSTNAME:
|
case KERN_HOSTNAME:
|
||||||
@ -246,8 +237,7 @@ extern "C" int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
|
|||||||
case CTL_HW: switch(index_b) {
|
case CTL_HW: switch(index_b) {
|
||||||
|
|
||||||
case HW_MACHINE:
|
case HW_MACHINE:
|
||||||
Genode::strncpy(buf, GENODE_MACHINE, *oldlenp);
|
*oldlenp = 0;
|
||||||
*oldlenp = Genode::strlen(buf);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case HW_NCPU:
|
case HW_NCPU:
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
#
|
|
||||||
# Provide version information to sysctl
|
|
||||||
#
|
|
||||||
GENODE_ROOT_DIR = $(REP_DIR)/../..
|
|
||||||
|
|
||||||
GENODE_OSRELEASE := $(shell cat $(GENODE_ROOT_DIR)/VERSION)
|
|
||||||
|
|
||||||
GENODE_OSREV := $(shell which git > /dev/null && git rev-list --count HEAD)
|
|
||||||
|
|
||||||
GENODE_VERSION := $(shell \
|
|
||||||
which git > /dev/null \
|
|
||||||
&& git -C $(GENODE_ROOT_DIR) describe 2> /dev/null \
|
|
||||||
&& exit 0 \
|
|
||||||
|| \
|
|
||||||
test -r $(GENODE_ROOT_DIR)/VERSION \
|
|
||||||
&& cat $(GENODE_ROOT_DIR)/VERSION \
|
|
||||||
&& exit 0 \
|
|
||||||
|| \
|
|
||||||
echo "<unknown version>")
|
|
||||||
|
|
||||||
CC_OPT += -DGENODE_OSRELEASE="\"$(GENODE_OSRELEASE)\""
|
|
||||||
CC_OPT += -DGENODE_OSREV="$(GENODE_OSREV)"
|
|
||||||
CC_OPT += -DGENODE_VERSION="\"$(GENODE_VERSION)\""
|
|
||||||
|
|
||||||
ifeq ($(findstring arm, $(SPECS)), arm)
|
|
||||||
CC_OPT += -DGENODE_MACHINE="\"arm\""
|
|
||||||
else
|
|
||||||
ifeq ($(findstring riscv, $(SPECS)), riscv)
|
|
||||||
CC_OPT += -DGENODE_MACHINE="\"riscv\""
|
|
||||||
else
|
|
||||||
ifeq ($(findstring x86_32, $(SPECS)), x86_32)
|
|
||||||
CC_OPT += -DGENODE_MACHINE="\"i686\""
|
|
||||||
else
|
|
||||||
ifeq ($(findstring x86_64, $(SPECS)), x86_64)
|
|
||||||
CC_OPT += -DGENODE_MACHINE="\"x86_64\""
|
|
||||||
else
|
|
||||||
CC_OPT += -DGENODE_MACHINE="\"unknown\""
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
Loading…
x
Reference in New Issue
Block a user