Skip to content

Commit

Permalink
Fix and improve configuring code in makefile and script.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucc committed Apr 24, 2016
1 parent e2ee83f commit c98c122
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ install: docs vimpager.configured vimcat.configured
sed -e '1{ s|.*|#!'"$$POSIX_SHELL"'|; }' \
-e 's|\$${POSIX_SHELL}|'"$$POSIX_SHELL|" \
-e '/^[ ]*\.[ ]*.*inc\/prologue.sh.*$$/d' \
-e 's/^[ ]*\.[ ]*.*inc\/platform.sh.*$$/'"`scripts/find_platform`"/ \
-e 's|^[ ]*\.[ ]*.*inc/platform.sh.*$$|'"`scripts/find_platform`|" \
-e 's|^version=.*|version="'"`git describe`"' (configured, shell='"$$POSIX_SHELL"')"|' \
-e 's|^runtime=.*$$|runtime="${PREFIX}/share/vimpager"|' \
-e 's|^vimcat=.*$$|vimcat="${PREFIX}/bin/vimcat"|' \
Expand Down
39 changes: 24 additions & 15 deletions scripts/find_platform
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@

. inc/platform.sh

# The backslash has to be put here 8 times: foctor two to get past the initial
# shell quoting, another factor two because it is used in the replacement
# string for sed, another factor two because the output of belows echo will be
# used in the replacement text in the sed call in the makefile. This yields
# one backslash that can escape the single quote in the configured vimpager
# script.
AWK=$(echo "$AWK" | sed "s/'/'\\\\\\\\''/g")
SED=$(echo "$SED" | sed "s/'/'\\\\\\\\''/g")

echo \
bsd=$bsd \
cygwin=$cygwin \
freebsd=$freebsd \
linux=$linux \
msys=$msys \
netbsd=$netbsd \
openbsd=$openbsd \
osx=$osx \
solaris=$solaris \
win32=$win32 \
AWK=$AWK \
SED=$SED \
HEAD_SYNTAX=$HEAD_SYNTAX \
TAIL_SYNTAX=$TAIL_SYNTAX \
TAIL_NO_DOUBLE_DASH=$TAIL_NO_DOUBLE_DASH \
${bsd:+bsd=$bsd} \
${cygwin:+cygwin=$cygwin} \
${freebsd:+freebsd=$freebsd} \
${linux:+linux=$linux} \
${msys:+msys=$msys} \
${netbsd:+netbsd=$netbsd} \
${openbsd:+openbsd=$openbsd} \
${osx:+osx=$osx} \
${solaris:+solaris=$solaris} \
${win32:+win32=$win32} \
"AWK='$AWK'" \
"SED='$SED'" \
${HEAD_SYNTAX:+HEAD_SYNTAX=$HEAD_SYNTAX} \
${TAIL_SYNTAX:+TAIL_SYNTAX=$TAIL_SYNTAX} \
${TAIL_NO_DOUBLE_DASH:+TAIL_NO_DOUBLE_DASH=$TAIL_NO_DOUBLE_DASH} \

0 comments on commit c98c122

Please sign in to comment.