1 # Copyright (C) 2022 Sergey V. Lobanov <sergey@lobanov.in>
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 include $(TOPDIR
)/rules.mk
9 PKG_LICENSE
:=GPL-2.0
-or-later
11 PKG_MAINTAINER
:=Sergey V. Lobanov
<sergey@lobanov.in
>
15 define Package
/fakeuname
18 TITLE
:=Fake uname host tool for cross-compile purposes
22 define Package
/fakeuname
/description
23 Fakeuname is a host tool for cross-compile cross-platform builds
24 if configure or
/and build scripts
check uname output for target
25 build and use invalid build flags. This tool should not be used
26 in normal case if configure
/build scripts allow to redefine
27 required values instead of using uname output
30 include $(INCLUDE_DIR
)/kernel.mk
31 include $(INCLUDE_DIR
)/package.mk
32 include $(INCLUDE_DIR
)/host-build.mk
39 cat src
/header.py.inc
; \
40 echo machine
= \"$(ARCH
)\"; \
41 echo kernel_release
= \"$(LINUX_UNAME_VERSION
)\"; \
42 echo kernel_version
= \"#0 $(shell date --date=@$(SOURCE_DATE_EPOCH))\"; \
43 cat src
/footer.py.inc
; \
44 } > $(HOST_BUILD_DIR
)/$(PKG_NAME
)
48 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/lib
/$(PKG_NAME
)
49 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/$(PKG_NAME
) $(STAGING_DIR_HOSTPKG
)/lib
/$(PKG_NAME
)/uname
53 rm -rf
"$(STAGING_DIR_HOSTPKG)/lib/$(PKG_NAME)"
56 $(eval
$(call HostBuild
))
57 $(eval
$(call BuildPackage
,fakeuname
))