3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-01-30 14:52:17 +00:00
Brooklyn/scripts/mkcompile_h

28 lines
642 B
Plaintext
Raw Permalink Normal View History

2022-04-02 13:24:21 +00:00
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
2022-12-14 06:30:32 +00:00
UTS_MACHINE=$1
CC_VERSION="$2"
LD=$3
2022-04-02 13:24:21 +00:00
if test -z "$KBUILD_BUILD_USER"; then
LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
else
LINUX_COMPILE_BY=$KBUILD_BUILD_USER
fi
if test -z "$KBUILD_BUILD_HOST"; then
LINUX_COMPILE_HOST=`uname -n`
else
LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
fi
2022-12-14 06:30:32 +00:00
LD_VERSION=$(LC_ALL=C $LD -v | head -n1 |
sed -e 's/(compatible with [^)]*)//' -e 's/[[:space:]]*$//')
2022-04-02 13:24:21 +00:00
2022-12-14 06:30:32 +00:00
cat <<EOF
#define UTS_MACHINE "${UTS_MACHINE}"
#define LINUX_COMPILE_BY "${LINUX_COMPILE_BY}"
#define LINUX_COMPILE_HOST "${LINUX_COMPILE_HOST}"
#define LINUX_COMPILER "${CC_VERSION}, ${LD_VERSION}"
EOF