Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
8bc6cf9b
Commit
8bc6cf9b
authored
28 years ago
by
Doug Evans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MPW support.
From-SVN: r12273
parent
49ddab16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
143 additions
and
2 deletions
+143
-2
gcc/pexecute.c
+143
-2
No files found.
gcc/pexecute.c
View file @
8bc6cf9b
...
...
@@ -95,6 +95,11 @@ static char *install_error_msg = "installation problem, cannot exec `%s'";
On systems that don't support waiting for a particular child, PID is
ignored. On systems like MSDOS that don't really multitask pwait
is just a mechanism to provide a consistent interface for the caller.
pfinish: finish generation of script
pfinish is necessary for systems like MPW where a script is generated that
runs the requested programs.
*/
#ifdef __MSDOS__
...
...
@@ -299,7 +304,143 @@ pwait (pid, status, flags)
#endif
/* OS2 */
#if ! defined (__MSDOS__) && ! defined (_WIN32) && ! defined (OS2)
#ifdef MPW
/* MPW pexecute doesn't actually run anything; instead, it writes out
script commands that, when run, will do the actual executing.
For example, in GCC's case, GCC will write out several script commands:
cpp ...
cc1 ...
as ...
ld ...
and then exit. None of the above programs will have run yet. The task
that called GCC will then execute the script and cause cpp,etc. to run.
The caller must invoke pfinish before calling exit. This adds
the finishing touches to the generated script. */
static
int
first_time
=
1
;
int
pexecute
(
program
,
argv
,
this_pname
,
temp_base
,
errmsg_fmt
,
errmsg_arg
,
flags
)
const
char
*
program
;
char
*
const
*
argv
;
const
char
*
this_pname
;
const
char
*
temp_base
;
char
**
errmsg_fmt
,
**
errmsg_arg
;
int
flags
;
{
char
tmpprogram
[
255
];
char
*
cp
,
*
tmpname
;
int
i
;
mpwify_filename
(
program
,
tmpprogram
);
if
(
first_time
)
{
printf
(
"Set Failed 0
\n
"
);
first_time
=
0
;
}
fputs
(
"If {Failed} == 0
\n
"
,
stdout
);
/* If being verbose, output a copy of the command. It should be
accurate enough and escaped enough to be "clickable". */
if
(
verbose_flag
)
{
fputs
(
"
\t
Echo "
,
stdout
);
fputc
(
'\''
,
stdout
);
fputs
(
tmpprogram
,
stdout
);
fputc
(
'\''
,
stdout
);
fputc
(
' '
,
stdout
);
for
(
i
=
1
;
argv
[
i
];
i
++
)
{
fputc
(
'\''
,
stdout
);
/* See if we have an argument that needs fixing. */
if
(
strchr
(
argv
[
i
],
'/'
))
{
tmpname
=
xmalloc
(
256
);
mpwify_filename
(
argv
[
i
],
tmpname
);
argv
[
i
]
=
tmpname
;
}
for
(
cp
=
argv
[
i
];
*
cp
;
cp
++
)
{
/* Write an Option-d escape char in front of special chars. */
if
(
strchr
(
"'+"
,
*
cp
))
fputc
(
'\266'
,
stdout
);
fputc
(
*
cp
,
stdout
);
}
fputc
(
'\''
,
stdout
);
fputc
(
' '
,
stdout
);
}
fputs
(
"
\n
"
,
stdout
);
}
fputs
(
"
\t
"
,
stdout
);
fputs
(
tmpprogram
,
stdout
);
fputc
(
' '
,
stdout
);
for
(
i
=
1
;
argv
[
i
];
i
++
)
{
/* See if we have an argument that needs fixing. */
if
(
strchr
(
argv
[
i
],
'/'
))
{
tmpname
=
xmalloc
(
256
);
mpwify_filename
(
argv
[
i
],
tmpname
);
argv
[
i
]
=
tmpname
;
}
if
(
strchr
(
argv
[
i
],
' '
))
fputc
(
'\''
,
stdout
);
for
(
cp
=
argv
[
i
];
*
cp
;
cp
++
)
{
/* Write an Option-d escape char in front of special chars. */
if
(
strchr
(
"'+"
,
*
cp
))
fputc
(
'\266'
,
stdout
);
fputc
(
*
cp
,
stdout
);
}
if
(
strchr
(
argv
[
i
],
' '
))
fputc
(
'\''
,
stdout
);
fputc
(
' '
,
stdout
);
}
fputs
(
"
\n
"
,
stdout
);
/* Output commands that arrange to clean up and exit if a failure occurs.
We have to be careful to collect the status from the program that was
run, rather than some other script command. Also, we don't exit
immediately, since necessary cleanups are at the end of the script. */
fputs
(
"
\t
Set TmpStatus {Status}
\n
"
,
stdout
);
fputs
(
"
\t
If {TmpStatus} != 0
\n
"
,
stdout
);
fputs
(
"
\t\t
Set Failed {TmpStatus}
\n
"
,
stdout
);
fputs
(
"
\t
End
\n
"
,
stdout
);
fputs
(
"End
\n
"
,
stdout
);
/* We're just composing a script, can't fail here. */
return
0
;
}
int
pwait
(
pid
,
status
,
flags
)
int
pid
;
int
*
status
;
int
flags
;
{
*
status
=
0
;
return
0
;
}
/* Write out commands that will exit with the correct error code
if something in the script failed. */
void
pfinish
()
{
printf
(
"
\t
Exit
\"
{Failed}
\"\n
"
);
}
#endif
/* MPW */
#if ! defined (__MSDOS__) && ! defined (_WIN32) && ! defined (OS2) \
&& ! defined (MPW)
#ifdef USG
#define vfork fork
...
...
@@ -436,4 +577,4 @@ pwait (pid, status, flags)
return
pid
;
}
#endif
/* !MSDOS && !WIN32 && !OS2 */
#endif
/* !MSDOS && !WIN32 && !OS2
&& !MPW
*/
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment