8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-28 02:43:03 +01:00
firebird-mirror/src/misc/writeBuildNum.sh
2001-12-25 07:57:05 +00:00

68 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
# This file is used both to rebuild the header file and to set the
# environment variables on the config call
BuildVersion="$Id: writeBuildNum.sh,v 1.41 2001-12-25 07:57:04 tamlin Exp $"
BuildType=T
MajorVer=2
MinorVer=0
RevNo=0
BuildNum=75
BuildSuffix="Firebird2 Dev1"
FIREBIRD_VERSION="$MajorVer.$MinorVer.$RevNo"
PRODUCT_VER_STRING="$MajorVer.$MinorVer.$RevNo.$BuildNum"
FILE_VER_STRING="WI-$BuildType$MajorVer.$MinorVer.$RevNo.$BuildNum"
FILE_VER_NUMBER="$MajorVer, $MinorVer, $RevNo, $BuildNum"
headerFile=src/jrd/build_no.h
tempfile=gen/test.header.txt
#______________________________________________________________________________
# Routine to build a new jrd/build_no.h file. If required.
rebuildHeaderFile() {
cat > $tempfile <<eof
/*
FILE GENERATED BY BUILD_NO.KSH. DO NOT EDIT
TO CHANGE ANY INFORMATION IN HERE PLEASE
EDIT BUILD_NO.KSH IN THE BUILD_WIN32 COMPONENT
FORMAL BUILD NUMBER:$BuildNum
*/
#define PRODUCT_VER_STRING "$PRODUCT_VER_STRING"
#define FILE_VER_STRING "$FILE_VER_STRING"
#define LICENSE_VER_STRING "$FILE_VER_STRING"
#define FILE_VER_NUMBER $FILE_VER_NUMBER
#define FB_MAJOR_VER "$MajorVer"
#define FB_MINOR_VER "$MinorVer"
#define FB_REV_NO "$RevNo"
#define FB_BUILD_NO "$BuildNum"
#define FB_BUILD_TYPE "$BuildType"
#define FB_BUILD_SUFFIX "$BuildSuffix"
eof
cmp -s $headerFile tempfile
Result=$?
if [ $Result -lt 0 ]
then
echo "error compareing $tempfile and $headerFile"
elif [ $Result -gt 0 ]
then
echo "updating header file $headerFile"
cp $tempfile $headerFile
else
echo "files are identical"
fi
}
if [ "$1" == "rebuildHeader" ]
then
rebuildHeaderFile
fi