Add support for stripping non-native object files by using an
environment variable that specifies the name of the strip(1) program to use. The envvar is "STRIPBIN". The more natural choice would be "STRIP", but that one is taken already.
This commit is contained in:
parent
3bf8b9cee3
commit
441b1ec776
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96416
@ -701,6 +701,7 @@ void
|
||||
strip(to_name)
|
||||
const char *to_name;
|
||||
{
|
||||
const char *stripbin;
|
||||
int serrno, status;
|
||||
|
||||
switch (fork()) {
|
||||
@ -710,7 +711,10 @@ strip(to_name)
|
||||
errno = serrno;
|
||||
err(EX_TEMPFAIL, "fork");
|
||||
case 0:
|
||||
execlp("strip", "strip", to_name, (char *)NULL);
|
||||
stripbin = getenv("STRIPBIN");
|
||||
if (stripbin == NULL)
|
||||
stripbin = "strip";
|
||||
execlp(stripbin, stripbin, to_name, (char *)NULL);
|
||||
err(EX_OSERR, "exec(strip)");
|
||||
default:
|
||||
if (wait(&status) == -1 || status) {
|
||||
|
Loading…
Reference in New Issue
Block a user