r7711: update callers of ldb_connect() for new syntax
[Samba/ekacnet.git] / source4 / script / mkproto.sh
blob6cd9cd60186be29cf143f9d6dd893604abc74974
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 perl [-h headerdefine] outputheader proto_obj"
10 exit 1
13 perl="$1"
14 shift
16 if [ x"$1" = x-h ]
17 then
18 headeropt="-h $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 mkdir -p `dirname $header`
34 ${perl} script/mkproto.pl $headeropt $proto_src > $headertmp
36 RET=$?
38 if test x"$RET" != x"0";then
39 exit $RET
42 if cmp -s $header $headertmp 2>/dev/null
43 then
44 echo "$header unchanged"
45 rm $headertmp
46 else
47 mv $headertmp $header