r15099: An attempt to fix BSD make portability issues. With these changes Samba 4...
[Samba.git] / source4 / script / build_idl.sh
blob1b38245e17cc2697b412d1637dd40a95b8f767fb
1 #!/bin/sh
3 FULLBUILD=$1
4 shift 1
5 PIDL_EXTRA_ARGS="$*"
7 [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
9 PIDL="$PERL $srcdir/pidl/pidl --outputdir librpc/gen_ndr --header --ndr-parser --server --client --dcom-proxy --com-header --swig --ejs $PIDL_EXTRA_ARGS"
11 if [ x$FULLBUILD = xFULL ]; then
12 echo Rebuilding all idl files in librpc/idl
13 $PIDL $srcdir/librpc/idl/*.idl || exit 1
14 exit 0
17 list=""
19 for f in $srcdir/librpc/idl/*.idl ; do
20 basename=`basename $f .idl`
21 ndr="librpc/gen_ndr/ndr_$basename.c"
22 # blergh - most shells don't have the -nt function
23 if [ -f $ndr ]; then
24 if [ x$srcdir/`find $f -newer $ndr -print` = x$f ]; then
25 list="$list $f"
27 else
28 list="$list $f"
30 done
32 if [ "x$list" != x ]; then
33 $PIDL $list || exit 1
36 exit 0