r5087: Add --swig to pidl flags so that swig .i files are generated with
[samba.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="$PERL ./build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header --parser --server --client --swig"
8
9 if [ x$FULLBUILD = xFULL ]; then
10       echo Rebuilding all idl files in librpc/idl
11       $PIDL librpc/idl/*.idl || exit 1
12       exit 0
13 fi
14
15 list=""
16
17 for f in librpc/idl/*.idl; do
18     basename=`basename $f .idl`
19     ndr="librpc/gen_ndr/ndr_$basename.c"
20     # blergh - most shells don't have the -nt function
21     if [ -f $ndr ]; then
22         if [ x`find $f -newer $ndr -print` = x$f ]; then
23             list="$list $f"
24         fi
25     else 
26         list="$list $f"
27     fi
28 done
29
30 if [ "x$list" != x ]; then
31     $PIDL $list || exit 1
32 fi
33
34 exit 0