Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

gyp: support older bash versions

Older bash versions in `sh -c` mode don't parse `export FOO=42` constructs,
they bail out with a "FOO is not an identifier" error message.

This was fixed somewhere between bash 4.1.0 and 4.1.5 but let's support the
older versions anyway.
  • Loading branch information...
bnoordhuis committed Oct 26, 2011
1 parent b8847e9 commit d7dff34bad8544602d0b26414b836dbf9705f05e
Showing with 6 additions and 3 deletions.
  1. +6 −3 tools/gyp/pylib/gyp/generator/make.py
@@ -1505,8 +1505,10 @@ def WriteActions(self, actions, extra_sources, extra_outputs,
# libraries, but until everything is made cross-compile safe, also use
# target libraries.
# TODO(piman): when everything is cross-compile safe, remove lib.target
self.WriteLn('cmd_%s = export LD_LIBRARY_PATH=$(builddir)/lib.host:'
'$(builddir)/lib.target:$$LD_LIBRARY_PATH; %s%s'
self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:'
'$(builddir)/lib.target:$$LD_LIBRARY_PATH; '
'export LD_LIBRARY_PATH; '
'%s%s'
% (name, cd_action, command))
self.WriteLn()
outputs = map(self.Absolutify, outputs)
@@ -1623,8 +1625,9 @@ def WriteRules(self, rules, extra_sources, extra_outputs,
# target libraries.
# TODO(piman): when everything is cross-compile safe, remove lib.target
self.WriteLn(
"cmd_%(name)s_%(count)d = export LD_LIBRARY_PATH="
"cmd_%(name)s_%(count)d = LD_LIBRARY_PATH="
"$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; "
"export LD_LIBRARY_PATH; "
"%(cd_action)s%(mkdirs)s%(action)s" % {
'action': gyp.common.EncodePOSIXShellList(action),
'cd_action': cd_action,

0 comments on commit d7dff34

Please sign in to comment.
You can’t perform that action at this time.