secgateway/build_env.sh

22 lines
762 B
Bash
Executable File

#!/bin/sh
UTS_LEN=64
UTS_TRUNCATE="cut -b -$UTS_LEN"
VERSION_FILE=./Common/compile.h
(
echo /\* This file is auto generated,for sGATE version info \*/
echo /\* Used readelf to get this information form driver of application \*/
echo /\* \"readelf --debug-dump=macro \<filename\>\" \*/
echo \#define sGATE_COMPILE_DATE \"`date +%F`\"
echo \#define sGATE_COMPILE_TIME \"`date +%T`\"
echo \#define sGATE_COMPILE_MAJOR \"`date +%Y%m%d`\"
echo \#define sGATE_COMPILE_SUB \"`date +%H%M%S`\"
echo \#define sGATE_COMPILE_BY \"`whoami`\"
echo \#define sGATE_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
echo \#define sGATE_GIT_TAGS \"`git describe --tags --always --dirty="-dev"`\"
echo \#define sGATE_GIT_VERS \"`git rev-parse HEAD`\"
) > $VERSION_FILE