From baea0946736c1fc58d2e3ed5a41a08b19ceab250 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sat, 17 Nov 2018 13:30:31 +0100 Subject: [PATCH] profile: Remove CC environment variable, use local/bin/cc instead --- .local/bin/cc | 8 ++++++++ .profile | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) create mode 100755 .local/bin/cc diff --git a/.local/bin/cc b/.local/bin/cc new file mode 100755 index 00000000..d7179f1d --- /dev/null +++ b/.local/bin/cc @@ -0,0 +1,8 @@ +#!/bin/sh + +## Setting the CC environment variable may break some Makefiles or other +## languages like Go (with cgo). + +for i in /usr/local/bin/cc /usr/bin/cc /bin/cc clang gcc; do + command -v $i >/dev/null 2>&1 && exec $i "$@" +done diff --git a/.profile b/.profile index c9ec74d3..a73c37ca 100644 --- a/.profile +++ b/.profile @@ -40,15 +40,6 @@ prependpath () { ## Use this to override system executables. prependpath "${HOME}/personal/hackpool" -## C Compiler -if ! command -v cc >/dev/null 2>&1; then - if command -v clang >/dev/null 2>&1; then - export CC=clang - else - export CC=gcc - fi -fi - ## TeXlive -- TODO: Remove once guix has packaged it all properly. TEXDIR="${TEXDIR:-/usr/local/texlive}" if [ -d "${TEXDIR}" ]; then