Configure: Escape special chars when inserting configure invocation/defines into rev.cpp

This commit is contained in:
Jonathan G Rennison 2019-10-14 22:17:44 +01:00
parent 93dffed00a
commit a50d82775f
2 changed files with 2 additions and 2 deletions

View File

@ -280,7 +280,7 @@ endif
# Revision files # Revision files
$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(CONFIG_CACHE_INVOCATION) $(SRC_DIR)/rev.cpp.in $(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(CONFIG_CACHE_INVOCATION) $(SRC_DIR)/rev.cpp.in
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g;s@!!ISSTABLETAG!!@$(ISSTABLETAG)@g;s@\!\!CONFIGURE_INVOCATION\!\!@$(CONFIGURE_INVOCATION)@g;s@\!\!CONFIGURE_DEFINES\!\!@$(CONFIGURE_DEFINES)@g;" > $(SRC_DIR)/rev.cpp $(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!MODIFIED!!@$(MODIFIED)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g;s@!!ISSTABLETAG!!@$(ISSTABLETAG)@g;s@\!\!CONFIGURE_INVOCATION\!\!@$(subst \",\\\\\\\",$(subst @,\\@,$(CONFIGURE_INVOCATION)))@g;s@\!\!CONFIGURE_DEFINES\!\!@$(subst \",\\\\\\\",$(subst @,\\@,$(CONFIGURE_DEFINES)))@g;" > $(SRC_DIR)/rev.cpp
$(SRC_DIR)/os/windows/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/os/windows/ottdres.rc.in $(SRC_DIR)/os/windows/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/os/windows/ottdres.rc.in
$(Q)cat $(SRC_DIR)/os/windows/ottdres.rc.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g;s@!!ISSTABLETAG!!@$(ISSTABLETAG)@g" > $(SRC_DIR)/os/windows/ottdres.rc $(Q)cat $(SRC_DIR)/os/windows/ottdres.rc.in | sed "s@\!\!ISODATE\!\!@$(ISODATE)@g;s@!!VERSION!!@$(VERSION)@g;s@!!DATE!!@`date +%d.%m.%y`@g;s@!!GITHASH!!@$(GITHASH)@g;s@!!ISTAG!!@$(ISTAG)@g;s@!!ISSTABLETAG!!@$(ISSTABLETAG)@g" > $(SRC_DIR)/os/windows/ottdres.rc

View File

@ -3747,7 +3747,7 @@ make_sed() {
s@!!DISTCC!!@$distcc@g; s@!!DISTCC!!@$distcc@g;
s@!!NFORENUM!!@$nforenum@g; s@!!NFORENUM!!@$nforenum@g;
s@!!GRFCODEC!!@$grfcodec@g; s@!!GRFCODEC!!@$grfcodec@g;
s@!!CONFIGURE_INVOCATION!!@$CONFIGURE_INVOCATION@g; s@!!CONFIGURE_INVOCATION!!@`echo "$CONFIGURE_INVOCATION" | sed 's!@!\\\\@!g;s!"!\\\\\\\\"!g'`@g;
" "
if [ "$icon_theme_dir" != "" ]; then if [ "$icon_theme_dir" != "" ]; then