summaryrefslogtreecommitdiffstats
path: root/usr.bin/xinstall
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-05-11 19:15:15 +0000
committermarcel <marcel@FreeBSD.org>2002-05-11 19:15:15 +0000
commite4f919be682bfcba2cf1e2c4068abbb87cb3b973 (patch)
tree4ef115fc469c0c0fa5dacffe71e0e844808aab11 /usr.bin/xinstall
parent4da1be0803196ec82f74fc519c68443db6e84146 (diff)
downloadFreeBSD-src-e4f919be682bfcba2cf1e2c4068abbb87cb3b973.zip
FreeBSD-src-e4f919be682bfcba2cf1e2c4068abbb87cb3b973.tar.gz
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.
Diffstat (limited to 'usr.bin/xinstall')
-rw-r--r--usr.bin/xinstall/xinstall.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index 21f19d3..75f4549 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -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) {
OpenPOWER on IntegriCloud