1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/third_party/heimdal_build/et_compile_wrapper.sh
Stefan Metzmacher 7055827b8f HEIMDAL: move code from source4/heimdal* to third_party/heimdal*
This makes it clearer that we always want to do heimdal changes
via the lorikeet-heimdal repository.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>

Autobuild-User(master): Joseph Sutton <jsutton@samba.org>
Autobuild-Date(master): Wed Jan 19 21:41:59 UTC 2022 on sn-devel-184
2022-01-19 21:41:59 +00:00

55 lines
958 B
Bash
Executable File

#!/bin/sh
#
SELF="$0"
SELFDIR=`dirname "${SELF}"`
DESTDIR="$1"
CMD="$2"
FILE="$3"
SOURCE="$4"
shift 4
test -z "${DESTDIR}" && {
echo "${SELF}:DESTDIR: '${DESTDIR}'" >&2;
exit 1;
}
test -z "${CMD}" && {
echo "${SELF}:CMD: '${CMD}'" >&2;
exit 1;
}
test -z "${FILE}" && {
echo "${SELF}:FILE: '${FILE}'" >&2;
exit 1;
}
test -z "${SOURCE}" && {
echo "${SELF}:SOURCE: '${SOURCE}'" >&2;
exit 1;
}
CURDIR="`pwd`"
cd "${DESTDIR}" && {
# Remove older copies beforehand - MIT's compile_et uses odd permissions for these
# files, which makes Heimdal's compile_et fail mysteriously when writing to them.
rm -f `basename "${FILE}" .et`.c
rm -f `basename "${FILE}" .et`.h
"${CMD}" "${FILE}" >&2 || exit 1;
cd "${CURDIR}"
TMP="${SOURCE}.$$"
mv "${SOURCE}" "${TMP}" && {
echo "#include \"config.h\"" > "${SOURCE}" && {
cat "${TMP}" >> "${SOURCE}"
}
}
rm -f "${TMP}"
} || {
echo "${SELF}:cannot cd into '${DESTDIR}'" >&2;
exit 1;
}
exit 0;