build: fix incorrect use of shell commands in handmade libtool file #258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The "echo" command was soft-deprecated from the shell programming language in ~1992. There is no way to use it correctly if:
In recognition of the fact that echo was historically used in many scripts, some of which avoided these issues and therefore succeeded when run, the "echo" command was NOT marked as obsolescent, out of fear that marking it as obsolescent would lead to vendors removing "echo" entirely and breaking existing scripts (or at least, the subset of scripts which managed to work correctly).
However, it is warned against, that after 1992 you should avoid writing new code that uses "echo" and instead use "printf".
printf has an actual definition of its behavior, which echo did not, and that behavior is to interpret backslash escapes in the first parameter, which is necessary by this Makefile.am in order to embed newlines into the generated libtool file. Simply replacing "echo -e" with "printf" will therefore correctly and reliably do the intended functionality. We also add one final embedded newline to avoid producing a file without an end-of-line character on the last line of the file.
Fixes: #257