summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal_build/et_compile_wrapper.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:20:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:20:00 +0000
commit8daa83a594a2e98f39d764422bfbdbc62c9efd44 (patch)
tree4099e8021376c7d8c05bdf8503093d80e9c7bad0 /third_party/heimdal_build/et_compile_wrapper.sh
parentInitial commit. (diff)
downloadsamba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.tar.xz
samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.zip
Adding upstream version 2:4.20.0+dfsg.upstream/2%4.20.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/heimdal_build/et_compile_wrapper.sh')
-rwxr-xr-xthird_party/heimdal_build/et_compile_wrapper.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/third_party/heimdal_build/et_compile_wrapper.sh b/third_party/heimdal_build/et_compile_wrapper.sh
new file mode 100755
index 0000000..939b434
--- /dev/null
+++ b/third_party/heimdal_build/et_compile_wrapper.sh
@@ -0,0 +1,54 @@
+#!/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;