create pidfile after forking
[Samba.git] / source / script / mkproto.sh
blob4dbe4c204e7b134a4a4fda1f210ce3f0d597b621
1 #! /bin/sh
3 LANG=C; export LANG
4 LC_ALL=C; export LC_ALL
5 LC_COLLATE=C; export LC_COLLATE
7 if [ $# -lt 3 ]
8 then
9 echo "Usage: $0 awk [-h headerdefine] outputheader proto_obj"
10 exit 1
13 awk="$1"
14 shift
16 if [ x"$1" = x-h ]
17 then
18 headeropt="-v headername=$2"
19 shift; shift;
20 else
21 headeropt=""
24 header="$1"
25 shift
26 headertmp="$header.$$.tmp~"
28 proto_src="`echo $@ | tr ' ' '\n' | sed -e 's/\.o/\.c/g' | sort | uniq | egrep -v 'ubiqx/|wrapped'`"
30 echo creating $header
32 ${awk} $headeropt \
33 -f script/mkproto.awk $proto_src > $headertmp
35 if cmp -s $header $headertmp 2>/dev/null
36 then
37 echo "$header unchanged"
38 rm $headertmp
39 else
40 mv $headertmp $header