summaryrefslogtreecommitdiff
path: root/cross/COMMON/buwrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'cross/COMMON/buwrapper.c')
-rw-r--r--cross/COMMON/buwrapper.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/cross/COMMON/buwrapper.c b/cross/COMMON/buwrapper.c
deleted file mode 100644
index a5e0a7e0ad7..00000000000
--- a/cross/COMMON/buwrapper.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* $NetBSD: buwrapper.c,v 1.2 1999/01/04 22:51:53 tv Exp $ */
-
-#include <err.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysexits.h>
-#include <unistd.h>
-
-/*
- * Wrapper for binutils programs.
- *
- * This frontend sets the appropriate environment variables that tell
- * binutils programs which target will be used.
- */
-
-static const char binsubdir[] = "libexec/binutils";
-
-#define PATHLEN sizeof(PREFIX) + sizeof(binsubdir) + 20
-
-int main(int argc, char **argv) {
- char path[PATHLEN], *p, *prog;
-
- /* quickly find last part of path component */
- if (p = strrchr(argv[0], '/'))
- p++;
- else
- p = argv[0];
- if (prog = strrchr(p, '-'))
- prog++;
- else
- prog = p;
-
- /* make program pathname */
- snprintf(path, PATHLEN, "%s/%s/%s", PREFIX, binsubdir, prog);
-
- /* set up environment */
- setenv("GNUTARGET", GNUTARGET, 0);
-#ifdef LDEMULATION
- setenv("LDEMULATION", LDEMULATION, 0);
-#endif
-#ifdef LD_RPATH_LINK
- setenv("LD_RPATH_LINK", LD_RPATH_LINK, 1);
-#endif
-
- /* run it! */
- execv(path, argv);
-
- /* we shouldn't get here. */
- err(EX_OSERR, "(buwrapper): exec %s", path);
-}