Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / scripts / genver
blob0ce192213b483466bf056ea60f7681b6631e84f9
1 #! /bin/sh
3 # possible usage: $0 [-f] [version.m4] [version.def]
5 # -f would be 'force the update'
7 force=0
8 outputs=
9 for i in $*
11 case "$i" in
12 -f) force=1 ;;
13 version.m4)
14 outputs="version.m4 $outputs"
16 *version.def)
17 outputs="include/version.def $outputs"
19 *) echo "Unrecognized option: $i"
20 exit 1
22 esac
23 done
25 case "$outputs" in
26 '') outputs="version.m4 include/version.def" ;;
27 esac
29 set -e
31 . ./packageinfo.sh
33 dversion=`scripts/VersionName`
35 set +e
37 case "$outputs" in
38 *version.m4*)
39 echo "m4_define([VERSION_NUMBER],[${dversion}])" > /tmp/version.m4+
40 cmp -s /tmp/version.m4+ version.m4
41 rc=$?
42 case "$force$rc" in
43 00)
44 rm -f /tmp/version.m4+
47 mv /tmp/version.m4+ version.m4
49 esac
51 esac
53 case "$outputs" in
54 *version.def*)
55 echo "version = '${dversion}';" > /tmp/version.def+
56 cmp -s /tmp/version.def+ include/version.def
57 rc=$?
58 case "$force$rc" in
59 00)
60 rm -f /tmp/version.def+
63 mv /tmp/version.def+ include/version.def
65 esac
67 esac