Skip to content

Commit

Permalink
Fix strip in case of cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
embetrix committed Jan 27, 2021
1 parent 5abf4e1 commit c331951
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/shc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static const char * help[] = {
" Environment variables used:",
" Name Default Usage",
" CC cc C compiler command",
" STRIP strip Strip command",
" CFLAGS <none> C compiler flags",
" LDFLAGS <none> Linker flags",
"",
Expand Down Expand Up @@ -1309,7 +1310,10 @@ file2=strcat(file2,".x");
if (verbose) fprintf(stderr, "%s: %s\n", my_name, cmd);
if (system(cmd))
return -1;
sprintf(cmd, "strip %s", file2);
char* strip = getenv("STRIP");
if (!strip)
strip = "strip";
sprintf(cmd, "%s %s", strip, file2);
if (verbose) fprintf(stderr, "%s: %s\n", my_name, cmd);
if (system(cmd))
fprintf(stderr, "%s: never mind\n", my_name);
Expand Down

0 comments on commit c331951

Please sign in to comment.