socket_wrapper: fix compiler warnings
[Samba/gbeck.git] / source3 / script / build_idl.sh
blob97e813ece0935ad2c63c5330b2f31a4f5c2f2c1f
1 #!/bin/sh
3 if [ "$1" = "--full" ]; then
4 FULL=1
5 shift 1
6 else
7 FULL=0
8 fi
10 ARGS="--includedir=../librpc/idl --outputdir $PIDL_OUTPUTDIR --header --ndr-parser --client --samba3-ndr-server $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 b=`basename $f .idl`
33 outfiles="$b.h ndr_$b.h srv_$b.c"
34 outfiles="$outfiles ndr_$b.c srv_$b.h"
36 for o in $outfiles; do
37 [ -f $PIDL_OUTPUTDIR/$o ] || {
38 list="$list $f"
39 break
41 test "`find $f -newer $PIDL_OUTPUTDIR/$o`" != "" && {
42 list="$list $f"
43 break
45 done
46 done
49 ## generate the ndr stubs
52 if [ "x$list" != x ]; then
53 # echo "${PIDL} ${list}"
54 $PIDL $list || exit 1
57 cd ${oldpwd}
59 exit 0