Skip to content

Conversation

@tpikonen
Copy link
Contributor

At least on my system the 'CXX' environment variable is not set by default. This makes the gdal-2.1.3 mason build fail. This PR adds a reasonable default value.

@springmeyer
Copy link
Contributor

Nice catch. This is defined for some platforms, but not all, I realize. This was my mistake. I'm thinking it would be better to properly set a default in mason.sh for this instead of per package.

Here are all the packages that would need fixed, per package:

$ grep 'export CXX=' scripts/*/*/script.sh -r
scripts/gdal/2.1.3/script.sh:    export CXX="${MASON_CCACHE} ${CXX}"
scripts/gdal/2.1.3/script.sh:        export CXX="${CXX} -stdlib=libc++ -std=c++11"
scripts/gdal/2.2.1/script.sh:    export CXX="${MASON_CCACHE} ${CXX}"
scripts/gdal/2.2.1/script.sh:        export CXX="${CXX} -stdlib=libc++ -std=c++11"
scripts/node/4.7.3/script.sh:    export CXX="${MASON_CCACHE}/bin/ccache ${MASON_CLANG}/bin/clang++"
scripts/node/6.9.5/script.sh:    export CXX="${MASON_CCACHE}/bin/ccache ${MASON_CLANG}/bin/clang++"
scripts/or-tools/5.1/script.sh:    export CXX="${MASON_CCACHE} ${CXX}"
scripts/or-tools/6.0-cmake-alt/script.sh:    export CXX="${MASON_CCACHE:-} ${CXX}"
scripts/or-tools/6.0/script.sh:    export CXX="${CXX:-${MASON_CLANG}/bin/clang++}"
scripts/rocksdb/5.4.6/script.sh:    export CXX="${MASON_CCACHE}/bin/ccache ${CXX}"
scripts/v8/5.1.281.47/script.sh:    export CXX="${MASON_CCACHE}/bin/ccache ${CXX}"

@tpikonen
Copy link
Contributor Author

There are actually many more scripts which assume CXX to be set without exporting it (e.g. mapnik, gdal). It's indeed best to make sure reasonable defaults are set in mason.sh, as they are for at least osx and android.

@tpikonen
Copy link
Contributor Author

tpikonen commented Oct 27, 2017

I changed this PR to set the CC and CXX vars for Linux in mason.sh.

@springmeyer
Copy link
Contributor

How about something like:

+    export CXX="${CXX:-c++}"
+    export CC="${CC:-cc}"

That will allow them to be customized (which is important since we build with clang++ on travis by setting CXX). And it will use the more generic symlinks to the compilers (which I presume will work on more linux systems and bsd systems).

@tpikonen
Copy link
Contributor Author

Good idea, I've updated the PR.

@tpikonen
Copy link
Contributor Author

On second thought, setting CC=cc etc. obviously breaks boost build scripts as they are now. Using readlink and some heuristics in boost scripts probably can fix this.

@tpikonen
Copy link
Contributor Author

I added a commit to this PR, which determines the BOOST_TOOLSET* vars in boost build scripts from the CC variable. It supports only gcc and clang though.

@springmeyer
Copy link
Contributor

Going to close this since #692 landed. Please re-open new issues for anything no yet fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants