Nameref attribute (local -n) is a Bash 4.3 feature, thus not available
on OSX with Bash 3.2.
And because we know the argument looks like a valid assignment, we can
pass it whole to export.
Two of the original checks were not testing what they were supposed to
test, because the result of eval didn't depend on correct parsing:
eval("not true or not true")
correct parse: ((not true) or (not true)) == false
incorrect parse: (not (true or (not true))) == false
eval("not false and not false")
correct parse: ((not false) and (not false)) == true
incorrect parse: (not (false and (not false))) == true
These were added with #4031, and probably not used in the end, as Mapnik
compiles and all tests pass without them. However, they might be useful,
so I'm only removing bad calls to deallocate with uninitialized values,
and doing proper member initialization.
- move template text from build.py into mapnik-config.template.sh,
so that the resulting script is simply that template file after
substitutions, instead of concatenation of two parts
- substitute using re.sub matching particular variables, instead of
format % dict; this allows putting default values in the template
Both forms can be seen in various other libraries. However, I think that
macro names with common prefix serving as substitute for namespace are
the better convention. MAPNIK_MAKE_VERSION hasn't appeared in any Mapnik
release yet, so this shouldn't break anything.
I'm not renaming other MAPNIK_*_VERSION defines that don't have the same
prefix simply because they've been there for ages, so renaming those now
might break stuff outside of Mapnik.
With the help of SCons.Environment.ParseFlags, split user-supplied
CUSTOM_LDFLAGS into appropriate option lists: LIBPATH, LIBS, etc.
Known non-linker options (like -Dx -I.) will be reported and ignored,
unrecognized options will be appended to LINKFLAGS.
Passing CUSTOM_LDFLAGS='-Wl,-rpath=$ORIGIN' to ./configure is
unnecessarily difficult and error-prone. The option needs to be
protected from SCons variable substitution by doubling the '$',
and also from shell parameter expansion with a backslash.
Such fortified value then cannot be used directly in contexts
where either expansion does not happen.
This commit makes that protection optional by injecting variable
named ORIGIN, that resolves to '$ORIGIN', into both the SCons
construction Environment and the process environment, so whenever
'$ORIGIN' undergoes variable substitution, it is replaced by the
original string.