summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-06-02 16:29:23 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-06-02 16:29:23 -0700
commit65999611d757f932856f80d7f3b7ff10601341f5 (patch)
treec3348cd046b51157dcddb399fcaa6f77274325ed
parent9d49e8f2379f7c187ff67fa5b59b5e7573c2b236 (diff)
downloadinfinitytier-65999611d757f932856f80d7f3b7ff10601341f5.tar.gz
infinitytier-65999611d757f932856f80d7f3b7ff10601341f5.zip
Eliminate "which" dependency in Linux makefile.
-rw-r--r--README.md4
-rw-r--r--make-linux.mk4
2 files changed, 4 insertions, 4 deletions
diff --git a/README.md b/README.md
index e197490d..163b6440 100644
--- a/README.md
+++ b/README.md
@@ -14,8 +14,8 @@ Visit [ZeroTier's site](https://www.zerotier.com/) for more information. You can
For Mac, Linux, and BSD, just type "make" (or "gmake" on BSD). You won't need much installed; here are the requirements for various platforms:
* Mac: Xcode command line tools, and [Packages](http://s.sudre.free.fr/Software/Packages/about.html) if you want to build an OSX .pkg installer ("make mac-dist-pkg"). It should build on OSX 10.7 or newer.
- * Linux: the 'which' command, which is used to auto-detect whether to use the clang or the gcc compiler. (Clang is preferred if it's available, since it usually yields smaller and slightly faster binaries.)
- * FreeBSD (and other BSD): C++ compiler (g++ usually) and GNU make (gmake).
+ * Linux: gcc/g++ or clang/clang++ (Makefile will use clang by default if available.)
+ * FreeBSD (and other BSD): C++ compiler (G++ usually) and GNU make (gmake).
Each supported platform has its own *make-XXX.mk* file that contains the actual make rules for the platform. The right .mk file is included by the main Makefile based on the GNU make *OSTYPE* variable. Take a look at the .mk file for your platform for other targets, debug build rules, etc.
diff --git a/make-linux.mk b/make-linux.mk
index 892b40b6..586da514 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -1,6 +1,6 @@
# Pick clang or gcc, with preference for clang
-CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)
-CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)
+CC=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi)
+CXX=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi)
INCLUDES=
DEFS=