r586: removed --clientfns from build_idl.sh (tim removed that code from pidl)
[sfrench/samba-autobuild/.git] / source / script / build_idl.sh
1 #!/bin/sh
2
3 FULLBUILD=$1
4
5 [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
6
7 PIDL="./build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header --parser --server"
8 TABLES="./build/pidl/tables.pl --output librpc/gen_ndr/tables"
9
10 if [ x$FULLBUILD = xFULL ]; then
11       echo Rebuilding all idl files in librpc/idl
12       $PIDL librpc/idl/*.idl || exit 1
13
14       echo Rebuilding IDL tables
15       $TABLES librpc/gen_ndr/ndr_*.h || exit 1
16       exit 0
17 fi
18
19 list=""
20
21 for f in librpc/idl/*.idl; do
22     basename=`basename $f .idl`
23     ndr="librpc/gen_ndr/ndr_$basename.c"
24     # blergh - most shells don't have the -nt function
25     if [ -f $ndr ]; then
26         if [ x`find $f -newer $ndr -print` = x$f ]; then
27             list="$list $f"
28         fi
29     else 
30         list="$list $f"
31     fi
32 done
33
34 if [ "x$list" != x ]; then
35     $PIDL $list || exit 1
36     $TABLES librpc/gen_ndr/ndr_*.h || exit 1
37 fi
38
39 exit 0