From 4e8052640e4029938111d5a1af16865c67e21bf9 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 27 May 2003 02:35:53 +0000 Subject: 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) --- source3/script/.cvsignore | 1 - source3/script/mkproto.sh | 43 ++++++++++++++++++++++++++++++++++++++++ source3/script/mkproto.sh.in | 47 -------------------------------------------- 3 files changed, 43 insertions(+), 48 deletions(-) create mode 100755 source3/script/mkproto.sh delete mode 100755 source3/script/mkproto.sh.in (limited to 'source3/script') diff --git a/source3/script/.cvsignore b/source3/script/.cvsignore index 5efd0d33db..7a8114ecd7 100644 --- a/source3/script/.cvsignore +++ b/source3/script/.cvsignore @@ -1,2 +1 @@ findsmb -mkproto.sh 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 diff --git a/source3/script/mkproto.sh.in b/source3/script/mkproto.sh.in deleted file mode 100755 index 8d7d300ff5..0000000000 --- a/source3/script/mkproto.sh.in +++ /dev/null @@ -1,47 +0,0 @@ -#! /bin/sh -x - -LANG=C; export LANG -LC_ALL=C; export LC_ALL -LC_COLLATE=C; export LC_COLLATE - -# Need reference point for "mkproto.awk", including when "srcdir != builddir". -# Use of "abs_..." is unpleasant. Is there another way? -abs_srcdir=@abs_srcdir@ - -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 $abs_srcdir/mkproto.awk $proto_src > $headertmp - -if cmp -s $header $headertmp 2>/dev/null -then - echo "$header unchanged" - rm $headertmp -else - mv $headertmp $header -fi -- cgit