- char buf[4096]; /* one page should be enough */
- memset (buf,0,sizeof(buf));
- snprintf(buf, sizeof(buf), "%s %s/%s %s -o %s",
- task_bins[TASK_COMPILE],
- curdir,
- template->sourcefile,
- template->compileflags,
- template->tempfilename
- );
-
+ if (strcmp(tmpl->proceduretype, "-pp")) {
+ if (qcflags) {
+ if (tmpl->testflags && !strcmp(tmpl->testflags, "-no-defs")) {
+ util_snprintf(buf, sizeof(buf), "%s %s/%s %s %s -o %s",
+ task_bins[TASK_COMPILE],
+ curdir,
+ tmpl->sourcefile,
+ qcflags,
+ tmpl->compileflags,
+ tmpl->tempfilename
+ );
+ } else {
+ util_snprintf(buf, sizeof(buf), "%s %s/%s %s/%s %s %s -o %s",
+ task_bins[TASK_COMPILE],
+ curdir,
+ defs,
+ curdir,
+ tmpl->sourcefile,
+ qcflags,
+ tmpl->compileflags,
+ tmpl->tempfilename
+ );
+ }
+ } else {
+ if (tmpl->testflags && !strcmp(tmpl->testflags, "-no-defs")) {
+ util_snprintf(buf, sizeof(buf), "%s %s/%s %s -o %s",
+ task_bins[TASK_COMPILE],
+ curdir,
+ tmpl->sourcefile,
+ tmpl->compileflags,
+ tmpl->tempfilename
+ );
+ } else {
+ util_snprintf(buf, sizeof(buf), "%s %s/%s %s/%s %s -o %s",
+ task_bins[TASK_COMPILE],
+ curdir,
+ defs,
+ curdir,
+ tmpl->sourcefile,
+ tmpl->compileflags,
+ tmpl->tempfilename
+ );
+ }
+ }
+ } else {
+ /* Preprocessing (qcflags mean shit all here we don't allow them) */
+ if (tmpl->testflags && !strcmp(tmpl->testflags, "-no-defs")) {
+ util_snprintf(buf, sizeof(buf), "%s -E %s/%s -o %s",
+ task_bins[TASK_COMPILE],
+ curdir,
+ tmpl->sourcefile,
+ tmpl->tempfilename
+ );
+ } else {
+ util_snprintf(buf, sizeof(buf), "%s -E %s/%s %s/%s -o %s",
+ task_bins[TASK_COMPILE],
+ curdir,
+ defs,
+ curdir,
+ tmpl->sourcefile,
+ tmpl->tempfilename
+ );
+ }
+ }
+