summaryrefslogtreecommitdiffstats
path: root/source/script
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2000-07-03 04:28:29 +0000
committerGerald Carter <jerry@samba.org>2000-07-03 04:28:29 +0000
commit269051aa0c52728278a1d290148564f11cf7f189 (patch)
treeb7fe39d604955e0dd2808a6bdaa222902742ef99 /source/script
parentcd7f0b0b91afd3331c0607ba2fcb3ccdd41ecebf (diff)
downloadsamba-269051aa0c52728278a1d290148564f11cf7f189.tar.gz
samba-269051aa0c52728278a1d290148564f11cf7f189.tar.xz
samba-269051aa0c52728278a1d290148564f11cf7f189.zip
first pass at merging rpcclient from TNG to HEAD. You can get a
semi-connection and a rpcclient prompt, but no functionality there yet. Will be a few more days on that. --jerry
Diffstat (limited to 'source/script')
-rw-r--r--source/script/mkproto.awk8
-rwxr-xr-xsource/script/mkproto.sh41
2 files changed, 47 insertions, 2 deletions
diff --git a/source/script/mkproto.awk b/source/script/mkproto.awk
index 7ae89b74675..6e74b0d85fe 100644
--- a/source/script/mkproto.awk
+++ b/source/script/mkproto.awk
@@ -2,8 +2,12 @@ BEGIN {
inheader=0;
# use_ldap_define = 0;
current_file="";
- print "#ifndef _PROTO_H_"
- print "#define _PROTO_H_"
+ if (headername=="") {
+ headername="_PROTO_H_";
+ }
+
+ print "#ifndef",headername
+ print "#define",headername
print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
print ""
}
diff --git a/source/script/mkproto.sh b/source/script/mkproto.sh
new file mode 100755
index 00000000000..4dbe4c204e7
--- /dev/null
+++ b/source/script/mkproto.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+LANG=C; export LANG
+LC_ALL=C; export LC_ALL
+LC_COLLATE=C; export LC_COLLATE
+
+if [ $# -lt 3 ]
+then
+ echo "Usage: $0 awk [-h headerdefine] outputheader proto_obj"
+ exit 1
+fi
+
+awk="$1"
+shift
+
+if [ x"$1" = x-h ]
+then
+ headeropt="-v headername=$2"
+ shift; shift;
+else
+ headeropt=""
+fi
+
+header="$1"
+shift
+headertmp="$header.$$.tmp~"
+
+proto_src="`echo $@ | tr ' ' '\n' | sed -e 's/\.o/\.c/g' | sort | uniq | egrep -v 'ubiqx/|wrapped'`"
+
+echo creating $header
+
+${awk} $headeropt \
+ -f script/mkproto.awk $proto_src > $headertmp
+
+if cmp -s $header $headertmp 2>/dev/null
+then
+ echo "$header unchanged"
+ rm $headertmp
+else
+ mv $headertmp $header
+fi