1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/source3/script/mkproto.sh
Michael Adam 32dd341119 Fix build on some systems : don't pass libraries to mkproto.awk
Currently, some static libraries have gone into object lists
that are also passed to make proto. (This should probably be
changed...) Then some awk versions fail when passed an non-
existing lib/libtdb.a e.g.. This patch changes mkproto.sh to
exclude \.a files from the list of files to process.

Michael
(This used to be commit 826b9ab07b)
2008-02-25 17:24:52 +01:00

44 lines
720 B
Bash
Executable File

#! /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 'tdb/|wrapped|modules/getdate' | egrep -v '\.a$'`"
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