Example #1
0
void convert_S_to_s(char *path)
{
	build_arglist(CMD_CPP);
	redirect_in(path);
	redirect_out(pathmod(path, ".S", ".s", 1));
	run_command();
}
Example #2
0
void convert_s_to_o(char *path)
{
	build_arglist(CMD_AS);
	add_argument(path);
	run_command();
	pathmod(path, ".s", ".o", 5);
}
Example #3
0
int __FrCDECL FrExecProgramAndWait(ostream &err, const char *progname, ...)
{
   va_list progargs ;
   va_start(progargs,progname) ;
   char **arglist = build_arglist((char*)0,(char*)0,-1,(char*)0,
				  progname,progargs) ;
   va_end(progargs) ;
   if (!arglist)
      return -1 ;
   int pipe_in, pipe_out ;
   istream *stream_in ;
   ostream *stream_out ;
   int status = -1 ;
   FrCRITSECT_ENTER(exec_mutex) ;
   bool started = _FrExecProgram((char*)0,-1,pipe_in,pipe_out,
				 stream_in,stream_out,err,progname,arglist) ;
   int pid = FrChildProgramID() ;
   FrCRITSECT_LEAVE(exec_mutex) ;
   if (started)
      {
      waitpid(pid,&status,0) ;
      FrShutdownPipe(stream_in,stream_out,pipe_in,pipe_out) ;
      }
   delete_arglist(arglist) ;
   return status ;
}
Example #4
0
void convert_c_to_s(char *path)
{
	char *tmp;
	build_arglist(CMD_CC);
	redirect_in(path);
	tmp = strdup(pathmod(path, ".%", ".@", 0));
	if (tmp == NULL)
		memory();
	redirect_out(tmp);
	run_command();
	build_arglist(CMD_COPT);
	add_argument(COPT_FILE);
	redirect_in(tmp);
	redirect_out(pathmod(path, ".%", ".s", 2));
	run_command();
	free(tmp);
}
Example #5
0
void preprocess_c(char *path)
{
	build_arglist(CMD_CPP);

	add_argument_list("-I", &inclist);
	add_argument_list("-D", &deflist);
	add_argument(path);
	/* Weird one .. -E goes to stdout */
	if (last_phase != 1)
		redirect_out(pathmod(path, ".c", ".%", 0));
	run_command();
}
Example #6
0
bool FrExecProgram(const char *remote, const char *hostname,
		   int portnum, const char *network_flag,
		   int &pipe_in, int &pipe_out,
		   istream *&stream_in, ostream *&stream_out,
		   ostream &err, const char *progname, va_list progargs)
{
   char **arglist = build_arglist(remote,hostname,portnum,network_flag,
				  progname,progargs) ;
   if (!arglist)
      return false ;
   bool result = _FrExecProgram(hostname,portnum,pipe_in,pipe_out,
				stream_in,stream_out,err,progname,arglist) ;
   delete_arglist(arglist) ;
   return result ;
}
Example #7
0
void link_phase(void)
{
	build_arglist(CMD_LD);
	add_argument("-b");
	add_argument("-c");
	add_argument("256");
	if (strip)
		add_argument("-s");
	add_argument("-o");
	add_argument(target);
	if (!standalone)
		add_argument(CRT0);
	add_argument_list(NULL, &objlist);
	add_argument_list(NULL, &liblist);
	run_command();
}