summaryrefslogtreecommitdiff
path: root/source3/script/mkproto.sh
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-05-27 02:35:53 +0000
committerTim Potter <tpot@samba.org>2003-05-27 02:35:53 +0000
commit4e8052640e4029938111d5a1af16865c67e21bf9 (patch)
tree8b00e6e2d2c8bcb4062eede5773b2abaf12a4558 /source3/script/mkproto.sh
parentab222b3700313348b2a1b673be82a58cb03c7c79 (diff)
downloadsamba-4e8052640e4029938111d5a1af16865c67e21bf9.tar.gz
samba-4e8052640e4029938111d5a1af16865c67e21bf9.tar.bz2
samba-4e8052640e4029938111d5a1af16865c67e21bf9.zip
More fixes for builddir != srcdir.
- Use absolute directories for $builddir and $srcdir in the Makefile - Don't try and combine source files in $builddir and $srcdir to build proto.h. It's just too hard to get it right across all targets we wish to compile on. Use a hand created prototype for the single function in smbd/build_options.c that we need. This allows us to ditch all the extra sed work that was causing problems: \t not portable - hah! - Fix bogus delheaders target to remove the correct files This appears to work quite nicely now. Let's see how it goes on the buildfarm machines. (This used to be commit 456184463d35c18840c39cb3483b7136247ea764)
Diffstat (limited to 'source3/script/mkproto.sh')
-rwxr-xr-xsource3/script/mkproto.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/source3/script/mkproto.sh b/source3/script/mkproto.sh
new file mode 100755
index 0000000000..2bf96c9b41
--- /dev/null
+++ b/source3/script/mkproto.sh
@@ -0,0 +1,43 @@
+#! /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
+
+mkdir -p `dirname $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