r25736: make sure we include "config.h" as first header
authorStefan Metzmacher <metze@samba.org>
Thu, 25 Oct 2007 18:13:06 +0000 (20:13 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:43:35 +0000 (05:43 +0100)
in code generated from et_compile

metze

source/heimdal_build/et_compile_wrapper.sh
source/heimdal_build/et_deps.pl

index a1cb5b311ce4b9f287e100c8e44844abc61c27c6..d7d47ba363fee296beaf5adaed3040079b392824 100755 (executable)
@@ -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;
index 1ebe4966189faf84b85bff2d59a429566a034b94..2385dbd085483218ba287b7b2be0273c2bece602 100755 (executable)
@@ -10,7 +10,7 @@ my $header = "$dirname/$basename"; $header =~ s/\.et$/.h/;
 my $source = "$dirname/$basename"; $source =~ s/\.et$/.c/;
 print "$header $source: $file bin/compile_et\n";
 print "\t\@echo \"Compiling error table $file\"\n";
-print "\t\@\$(builddir)/heimdal_build/et_compile_wrapper.sh \$(srcdir) \$(builddir) $dirname bin/compile_et $file\n\n";
+print "\t\@\$(builddir)/heimdal_build/et_compile_wrapper.sh \$(srcdir) \$(builddir) $dirname bin/compile_et $file $source\n\n";
 
 print "clean:: \n";
 print "\t\@rm -f $header $source\n\n";