8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-25 04:43:03 +01:00
firebird-mirror/src/misc/writeBuildNum.sh

68 lines
1.7 KiB
Bash
Raw Normal View History

2001-08-15 10:44:11 +02:00
#!/bin/sh
# This file is used both to rebuild the header file and to set the
# environment variables on the config call
2002-01-06 14:06:38 +01:00
BuildVersion="$Id: writeBuildNum.sh,v 1.92 2002-01-06 13:06:36 skywalker Exp $"
2001-08-15 10:44:11 +02:00
BuildType=T
MajorVer=2
MinorVer=0
RevNo=0
2002-01-06 14:06:38 +01:00
BuildNum=126
2001-08-15 10:44:11 +02:00
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