chapel-lang/chapel — pull request #416 by bradcray (2014-09-14 02:52:49+00:00)
Title: Attempt to build re2/gmp by default and use CHPL_TARGET_COMPILER for re2

This commit makes two main changes:

1) When	building with CHPL_RE2 and CHPL_GMP unset, by default,
the make environment will attempt to build those packages,
ignoring errors if they fail. If they succeed,	this will result
in these packages being	enabled	by default (since their	presence
causes the util/chplenv/ scripts to default them to being on).
If they fail, they fail.

2) It changes the re2 package to build using the
CHPL_TARGET_COMPILER whereas before it always built with gnu.
This aligns it more with what you would	expect (use the	compiler
you're using for target	code) and avoids cases where the target
compiler may not be compatible with gnu. On the other hand, it
also reduces the number	of configurations that will support re2
because	aspects	of their Makefiles are specific	to gnu compilers
and those that are compatible with them. Future work
could/should port these	Makefiles to be	more generic (and
contribute it back to the re2 project) if they don't get to this
before we do.

The main approach taken	for step 1 is as follows:

* if CHPL_RE2/GMP is unset, then the user hasn't expressed an
opinion, so let's try to	build them.	If they	are set, it will
either suppress the attempt to build them or build them at the
normal point (when the runtime is being built), so nothing
special needs	to be done.

* the rules to attempt to build	them are third-party-try-*:
- third-party-try-opt	says to	try building the optional packages
- third-party-try-re2	says to	try building re2
- third-party-try-gmp	says to	try building gmp

* the other change required to the Makefile was	to remove its
inclusion of Makefile.base. This makes it the one Makefile
that does not	include	Makefile.base, and it cannot, for doing
so would set CHPL_REGEXP and CHPL_GMP	for all	subsequent
Makefiles before we know whether or not the attempts to build
were successful.

For step 2, the	only work was to pass CC and CXX on to the make
step for re2.