r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / script / build_idl.sh
blob77f37d8e75eb1aa6637e3bb263fe447537844874
1 #!/bin/sh
3 PIDL_ARGS="--outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-server --samba3-ndr-client --"
4 PIDL_EXTRA_ARGS="$*"
6 oldpwd=`pwd`
7 cd ${srcdir}
9 [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
11 if [ -z "$PIDL" ] ; then
12 PIDL=pidl
15 PIDL="$PIDL ${PIDL_ARGS} ${PIDL_EXTRA_ARGS}"
18 ## Find newer files rather than rebuild all of them
21 list=""
22 for f in ${IDL_FILES}; do
23 basename=`basename $f .idl`
24 ndr="librpc/gen_ndr/ndr_$basename.c"
26 if [ -f $ndr ] && false; then
27 if [ "x`find librpc/idl/$f -newer $ndr -print`" = "xlibrpc/idl/$f" ]; then
28 list="$list librpc/idl/$f"
30 else
31 list="$list librpc/idl/$f"
33 done
36 ## generate the ndr stubs
39 if [ "x$list" != x ]; then
40 # echo "${PIDL} ${list}"
41 $PIDL $list || exit 1
45 ## Do miscellaneous cleanup
48 for f in librpc/gen_ndr/ndr_*.c; do
49 cat $f | sed -e 's/^static //g' > $f.new
50 /bin/mv -f $f.new $f
51 done
53 touch librpc/gen_ndr/ndr_dcerpc.h
55 echo Generating librpc/gen_ndr/tables.c
56 ./librpc/tables.pl --output=librpc/gen_ndr/tables.c librpc/gen_ndr/*.h > librpc/gen_ndr/tables.c
58 cd ${oldpwd}
60 exit 0