Add ABI version constants, based on SHA1 hash
This commit is contained in:
@@ -8,9 +8,26 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "${INFILE}" ]
|
||||||
|
then
|
||||||
|
echo "$0: ${INFILE}: not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
ABI=abi.c
|
ABI=abi.c
|
||||||
HEADER=abi.lh
|
HEADER=abi.lh
|
||||||
|
|
||||||
|
|
||||||
|
# This is pretty evil. We use sed to produce shell commands which set
|
||||||
|
# variables which contain 8-character chunks of the sha1 hash.
|
||||||
|
# eval takes care of defining them in the current shell, rather than in
|
||||||
|
# a subshell.
|
||||||
|
for VER in `sha1 -n ${INFILE} | sed 's/\(........\)\(........\)\(........\)\(........\)\(........\).*$/ABIVER1=\1 ABIVER2=\2 ABIVER3=\3 ABIVER4=\4 ABIVER5=\5/'`
|
||||||
|
do
|
||||||
|
eval ${VER}
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
FNCOUNT=0
|
FNCOUNT=0
|
||||||
|
|
||||||
do_function()
|
do_function()
|
||||||
@@ -26,6 +43,12 @@ cat <<EOF >${ABI}
|
|||||||
|
|
||||||
#include "abi.h"
|
#include "abi.h"
|
||||||
|
|
||||||
|
const long vm_abiversion1 = 0x${ABIVER1};
|
||||||
|
const long vm_abiversion2 = 0x${ABIVER2};
|
||||||
|
const long vm_abiversion3 = 0x${ABIVER3};
|
||||||
|
const long vm_abiversion4 = 0x${ABIVER4};
|
||||||
|
const long vm_abiversion5 = 0x${ABIVER5};
|
||||||
|
|
||||||
vm_intfn vm_intfn_table[] = {
|
vm_intfn vm_intfn_table[] = {
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -33,6 +56,12 @@ cat <<EOF >${HEADER}
|
|||||||
/* abi.lh */
|
/* abi.lh */
|
||||||
/* autogenerated - do not edit */
|
/* autogenerated - do not edit */
|
||||||
|
|
||||||
|
constant __abiversion1 0x${ABIVER1};
|
||||||
|
constant __abiversion2 0x${ABIVER2};
|
||||||
|
constant __abiversion3 0x${ABIVER3};
|
||||||
|
constant __abiversion4 0x${ABIVER4};
|
||||||
|
constant __abiversion5 0x${ABIVER5};
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
while read TYPE ARG1 ARG2
|
while read TYPE ARG1 ARG2
|
||||||
|
|||||||
Reference in New Issue
Block a user