diff options
author | adrian <adrian@FreeBSD.org> | 2015-06-13 22:01:21 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2015-06-13 22:01:21 +0000 |
commit | 27b5804e6cfc545bc21a967849f82e0328b16992 (patch) | |
tree | df03e9bd4a4216fcc9f55be05071f224d4d210cb /usr.sbin/crunch | |
parent | 970120bd68630de526fdff04204ee79e1ba126ba (diff) | |
download | FreeBSD-src-27b5804e6cfc545bc21a967849f82e0328b16992.zip FreeBSD-src-27b5804e6cfc545bc21a967849f82e0328b16992.tar.gz |
Fix up crunchgen binary generation to work with external cross-build
tools.
* Allow STRIP to be overridden by the environment
* Use CC to tie things together, not LD
Tested:
* i386, mips32
Submitted by: kan
Diffstat (limited to 'usr.sbin/crunch')
-rw-r--r-- | usr.sbin/crunch/crunchgen/crunchgen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index e25c1ac..2cd5319 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -980,6 +980,7 @@ top_makefile_rules(FILE *outmk) prog_t *p; fprintf(outmk, "LD?= ld\n"); + fprintf(outmk, "STRIP?= strip\n"); if ( subtract_strlst(&libs, &libs_so) ) fprintf(outmk, "# NOTE: Some LIBS declarations below overridden by LIBS_SO\n"); @@ -1027,7 +1028,7 @@ top_makefile_rules(FILE *outmk) fprintf(outmk, "\t$(CC) -static -o %s %s.o $(CRUNCHED_OBJS) $(LIBS)\n", execfname, execfname); fprintf(outmk, ".endif\n"); - fprintf(outmk, "\tstrip %s\n", execfname); + fprintf(outmk, "\t$(STRIP) %s\n", execfname); fprintf(outmk, "realclean: clean subclean\n"); fprintf(outmk, "clean:\n\trm -f %s *.lo *.o *_stub.c\n", execfname); fprintf(outmk, "subclean: $(SUBCLEAN_TARGETS)\n"); @@ -1109,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, " $(%s_LIBS)", p->ident); fprintf(outmk, "\n"); - fprintf(outmk, "\t$(LD) -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", + fprintf(outmk, "\t$(CC) -nostdlibs -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) fprintf(outmk, " $(%s_LIBS)", p->ident); |