]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don't depend on how echo interprets backslash escapes (#588)
authorOlle Liljenzin <olle@liljenzin.se>
Sun, 3 May 2020 12:11:29 +0000 (14:11 +0200)
committerGitHub <noreply@github.com>
Sun, 3 May 2020 12:11:29 +0000 (14:11 +0200)
The escape sequence '\n' should be translated to a new line character
when printed to version.cpp. Default mode might be implementation
dependent. At least in Fedora /usr/bin/echo defaults to -E. On the
other hand older versions might not support the -e option that enables
backslash escapes where it is not default.

Split the command into two, one for each output line, which should
produce same output on all platforms.

dev.mk.in

index 250587c377d3bf9d2b8b213e8a1ed495a0e5f256..b94b2c4d1057a906aebc99c2cd083e8c095eac0c 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -109,7 +109,8 @@ dist_files = \
     $(built_dist_files)
 
 ifneq ($(shell sed 's/.*"\(.*\)".*/\1/' src/version.cpp 2>/dev/null),$(version))
-  $(shell echo 'extern const char CCACHE_VERSION[];\nconst char CCACHE_VERSION[] = "$(version)";' >src/version.cpp)
+  $(shell echo 'extern const char CCACHE_VERSION[];' >src/version.cpp)
+  $(shell echo 'const char CCACHE_VERSION[] = "$(version)";' >>src/version.cpp)
 endif
 src/version.o: src/version.cpp