summaryrefslogtreecommitdiff
path: root/source4/heimdal_build/et_compile_wrapper.sh
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-10-25 20:13:06 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:35 +0100
commit3f073b4c6bfcd7e44fc3dd561874790200bd4d12 (patch)
tree67febfccf959a81051f2ba3c47ad3683e0240cd6 /source4/heimdal_build/et_compile_wrapper.sh
parentb54fd3bac110ef80fcb5d7a1686768b8379506c5 (diff)
downloadsamba-3f073b4c6bfcd7e44fc3dd561874790200bd4d12.tar.gz
samba-3f073b4c6bfcd7e44fc3dd561874790200bd4d12.tar.bz2
samba-3f073b4c6bfcd7e44fc3dd561874790200bd4d12.zip
r25736: make sure we include "config.h" as first header
in code generated from et_compile metze (This used to be commit 8757b09052c5e07b23b8b50f7227f884201d9e98)
Diffstat (limited to 'source4/heimdal_build/et_compile_wrapper.sh')
-rwxr-xr-xsource4/heimdal_build/et_compile_wrapper.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/source4/heimdal_build/et_compile_wrapper.sh b/source4/heimdal_build/et_compile_wrapper.sh
index a1cb5b311c..d7d47ba363 100755
--- a/source4/heimdal_build/et_compile_wrapper.sh
+++ b/source4/heimdal_build/et_compile_wrapper.sh
@@ -10,7 +10,8 @@ DESTDIR=$3
CMD=$4
FILE=$5
-shift 5
+SOURCE=$6
+shift 6
test -z "${SRCDIR}" && {
echo "${SELF}:SRCDIR: '${SRCDIR}'" >&2;
@@ -37,6 +38,11 @@ test -z "${FILE}" && {
exit 1;
}
+test -z "${SOURCE}" && {
+ echo "${SELF}:SOURCE: '${SOURCE}'" >&2;
+ exit 1;
+}
+
CURDIR=`pwd`
cd ${SRCDIR} && {
@@ -58,6 +64,13 @@ cd ${BUILDDIR} && {
cd ${DESTDIR} && {
${ABS_BUILDDIR}/${CMD} ${ABS_SRCDIR}/${FILE} >&2 || exit 1;
cd ${CURDIR}
+ TMP="${SOURCE}.$$"
+ mv ${SOURCE} ${TMP} && {
+ echo "#include \"config.h\"" > ${SOURCE} && {
+ cat ${TMP} >> ${SOURCE}
+ }
+ }
+ rm ${TMP}
} || {
echo "${SELF}:cannot cd into '${BUILDDIR}'" >&2;
exit 1;