Skip to content

Commit 81bf0a9

Browse files
authored
Merge pull request #125 from embexus/fix/strip-cross-compile
Fix strip in case of cross compilation
2 parents 5abf4e1 + c331951 commit 81bf0a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/shc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ static const char * help[] = {
9494
" Environment variables used:",
9595
" Name Default Usage",
9696
" CC cc C compiler command",
97+
" STRIP strip Strip command",
9798
" CFLAGS <none> C compiler flags",
9899
" LDFLAGS <none> Linker flags",
99100
"",
@@ -1309,7 +1310,10 @@ file2=strcat(file2,".x");
13091310
if (verbose) fprintf(stderr, "%s: %s\n", my_name, cmd);
13101311
if (system(cmd))
13111312
return -1;
1312-
sprintf(cmd, "strip %s", file2);
1313+
char* strip = getenv("STRIP");
1314+
if (!strip)
1315+
strip = "strip";
1316+
sprintf(cmd, "%s %s", strip, file2);
13131317
if (verbose) fprintf(stderr, "%s: %s\n", my_name, cmd);
13141318
if (system(cmd))
13151319
fprintf(stderr, "%s: never mind\n", my_name);

0 commit comments

Comments
 (0)