r8806: Move data representation-independent data into seperate header
[sfrench/samba-autobuild/.git] / source4 / script / build_idl.sh
index 9ad9391ee050f6a709f584e15a92df9381d6d564..2f899aef45868523f9f904c031643597f4feaa82 100755 (executable)
@@ -1,13 +1,12 @@
 #!/bin/sh
 
 FULLBUILD=$1
+shift 1
+PIDL_EXTRA_ARGS="$*"
 
 [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
-[ -d librpc/gen_rpc ] || mkdir -p librpc/gen_rpc || exit 1
 
-( cd build/pidl && make ) || exit 1
-
-PIDL="build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header --parser --client librpc/gen_rpc/rpc_"
+PIDL="$PERL -Ibuild/pidl ./build/pidl/pidl --outputdir librpc/gen_ndr --parse --ndr-header --header --ndr-parser --server --client --dcom-proxy --com-header --swig --odl --ejs $PIDL_EXTRA_ARGS"
 
 if [ x$FULLBUILD = xFULL ]; then
       echo Rebuilding all idl files in librpc/idl
@@ -17,10 +16,16 @@ fi
 
 list=""
 
-for f in librpc/idl/*.idl; do
+for f in librpc/idl/*.idl ; do
     basename=`basename $f .idl`
-    if [ "$f" -nt librpc/gen_ndr/ndr_$basename.c ]; then
-       list="$list $f"
+    ndr="librpc/gen_ndr/ndr_$basename.c"
+    # blergh - most shells don't have the -nt function
+    if [ -f $ndr ]; then
+       if [ x`find $f -newer $ndr -print` = x$f ]; then
+           list="$list $f"
+       fi
+    else 
+        list="$list $f"
     fi
 done