mount.cifs: take extra care that mountpoint isn't changed during mount
[Samba.git] / librpc / build_idl.sh
blobac0fab48014073f3264ab8b289545c129b7e416c
1 #!/bin/sh
3 if [ "$1" = "--full" ]; then
4 FULL=1
5 shift 1
6 else
7 FULL=0
8 fi
10 ARGS="--outputdir $PIDL_OUTPUTDIR --header --ndr-parser --samba3-ndr-server --samba3-ndr-client --server --client --python --dcom-proxy --com-header $PIDL_ARGS --"
11 IDL_FILES="$*"
13 oldpwd=`pwd`
14 cd ${srcdir}
16 [ -d $PIDL_OUTPUTDIR ] || mkdir -p $PIDL_OUTPUTDIR || exit 1
18 PIDL="$PIDL $ARGS"
20 if [ $FULL = 1 ]; then
21 echo "Rebuilding all idl files"
22 $PIDL $IDL_FILES || exit 1
23 exit 0
27 ## Find newer files rather than rebuild all of them
30 list=""
31 for f in ${IDL_FILES}; do
32 basename=`basename $f .idl`
33 ndr="$PIDL_OUTPUTDIR/py_$basename.c"
35 if [ -f $ndr ]; then
36 if [ "x`find $f -newer $ndr -print`" = "x$f" ]; then
37 list="$list $f"
39 else
40 list="$list $f"
42 done
45 ## generate the ndr stubs
48 if [ "x$list" != x ]; then
49 # echo "${PIDL} ${list}"
50 $PIDL $list || exit 1
53 cd ${oldpwd}
55 exit 0