示例#1
0
文件: ipa_process.c 项目: qiyao/xcc
	/*******************************************************
		Function: do_compile

		Actually perform compilation

	 *******************************************************/
int
do_compile (string *argv)
{
    int pid;
    
    if (toolroot == 0) {
	if ((toolroot = getenv ("TOOLROOT")) == 0)
	    toolroot = "/usr/bin/";
	else
	    toolroot = concat_names (toolroot, "/usr/bin/");
    }

    argv[0] = concat_names (toolroot, basename (argv[0]));

#ifdef  TARG_MIPS
    if (option[OPT_VERBOSE].flag || option[OPT_SHOW].flag)
	dump_argv (argv);
#else
#endif

    pid = pcreateve (argv[0], argv, environ_vars);

    if (pid < 0) {
    	perror(argv[0]);
	exit(1);
    }

    active_pid = pid;
    
    FREE (argv[0]);

    return pid;

} /* do_compile */
示例#2
0
	/*******************************************************
		Function: do_compile

		Actually perform compilation

	 *******************************************************/
int
do_compile (string *argv)
{
    int pid;
    
    if (toolroot) {
	    toolroot = concat_names (toolroot, DEFAULT_TOOLROOT);
    }

    argv[0] = concat_names (toolroot, basename (argv[0]));

    if (ld_ipa_opt[LD_IPA_VERBOSE].flag || ld_ipa_opt[LD_IPA_SHOW].flag)
	dump_argv (argv);

    pid = fork();
    pid = execve(argv[0], argv, environ_vars);

    if (pid < 0) {
    	perror(argv[0]);
	exit(1);
    }

    active_pid = pid;
    
    FREE (argv[0]);
    argv[0] = NULL;

    if (toolroot) {
    	FREE (toolroot);
	toolroot = NULL;
    }

    return pid;

} /* do_compile */