added -T<path> option: create temporary file(s) in directory <path>
This commit is contained in:
parent
cf8e8a5b96
commit
7f74cabf12
3 changed files with 24 additions and 2 deletions
|
@ -123,13 +123,18 @@ char *nmlist = 0;
|
||||||
|
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
extern char *mktemp(); /* library routine */
|
extern char *mktemp(); /* library routine */
|
||||||
static char tmpname[] = "/tmp/Cem.XXXXXX";
|
char *tmpfdir = "/tmp"; /* where to keep the temporary file */
|
||||||
|
static char *tmpfname = "/Cem.XXXXXX";
|
||||||
char *tmpfile = 0;
|
char *tmpfile = 0;
|
||||||
#endif USE_TMP
|
#endif USE_TMP
|
||||||
|
|
||||||
compile(argc, argv)
|
compile(argc, argv)
|
||||||
char *argv[];
|
char *argv[];
|
||||||
{
|
{
|
||||||
|
#ifdef USE_TMP
|
||||||
|
char tmpf[256];
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
int pp_only = options['E'] || options['P'];
|
int pp_only = options['E'] || options['P'];
|
||||||
#endif NOPP
|
#endif NOPP
|
||||||
|
@ -155,8 +160,11 @@ compile(argc, argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
tmpfile = mktemp(tmpname);
|
strcpy(tmpf, tmpfdir);
|
||||||
|
strcat(tmpf, tmpfname);
|
||||||
|
tmpfile = mktemp(tmpf);
|
||||||
#endif USE_TMP
|
#endif USE_TMP
|
||||||
|
|
||||||
if (strcmp(destination, "-") == 0)
|
if (strcmp(destination, "-") == 0)
|
||||||
destination = 0;
|
destination = 0;
|
||||||
if (!InsertFile(source, (char **) 0)) /* read the source file */
|
if (!InsertFile(source, (char **) 0)) /* read the source file */
|
||||||
|
|
|
@ -9,6 +9,7 @@ p generate linenumbers and filename indications
|
||||||
while generating compact EM code
|
while generating compact EM code
|
||||||
P in running the preprocessor do not output '# line' lines
|
P in running the preprocessor do not output '# line' lines
|
||||||
R restricted C
|
R restricted C
|
||||||
|
T take path following as directory for storing temporary file(s)
|
||||||
U undefine predefined name
|
U undefine predefined name
|
||||||
V set objectsize and alignment requirements
|
V set objectsize and alignment requirements
|
||||||
w suppress warning diagnostics
|
w suppress warning diagnostics
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "sizes.h"
|
#include "sizes.h"
|
||||||
#include "align.h"
|
#include "align.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
|
#include "use_tmp.h"
|
||||||
|
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
extern char *inctable[MAXINCL];
|
extern char *inctable[MAXINCL];
|
||||||
|
@ -20,6 +21,7 @@ extern int inc_pos;
|
||||||
|
|
||||||
extern char options[];
|
extern char options[];
|
||||||
extern int idfsize;
|
extern int idfsize;
|
||||||
|
extern char *tmpfdir; /* main.c */
|
||||||
|
|
||||||
int txt2int();
|
int txt2int();
|
||||||
|
|
||||||
|
@ -130,6 +132,17 @@ do_option(text)
|
||||||
#endif NOPP
|
#endif NOPP
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef USE_TMP
|
||||||
|
case 'T' :
|
||||||
|
if (*text)
|
||||||
|
tmpfdir = text;
|
||||||
|
else
|
||||||
|
tmpfdir = ".";
|
||||||
|
#else USE_TMP
|
||||||
|
warning("-T option ignored");
|
||||||
|
#endif USE_TMP
|
||||||
|
break;
|
||||||
|
|
||||||
case 'U' : { /* -Uname : undefine predefined */
|
case 'U' : { /* -Uname : undefine predefined */
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
struct idf *idef;
|
struct idf *idef;
|
||||||
|
|
Loading…
Reference in a new issue