diff options
| author | Roy Marples <roy@marples.name> | 2014-03-13 00:42:16 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-03-13 00:42:16 +0000 |
| commit | 8820c5c9f76fbe0b7eea820d332c7239de73b97b (patch) | |
| tree | 4910cae00168f6d22593ef625d4d4fe8dae9826f /configure | |
| parent | cc43133914bde9c93ef92a6a01545992cfd471b7 (diff) | |
| download | dhcpcd-8820c5c9f76fbe0b7eea820d332c7239de73b97b.tar.xz | |
If we can't use cc then try and find a working compiler.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -246,7 +246,23 @@ echo "LIBDIR= $LIBDIR" >>$CONFIG_MK echo "MANDIR= $MANDIR" >>$CONFIG_MK : ${CC:=cc} -echo "Using compiler .. $(which $CC)" +if ! type "$CC" >/dev/null 2>&1; then + for _CC in clang gcc pcc icc; do + _CC=$(_which "$_CC") + if [ -x "$_CC" ]; then + CC=$_CC + break + fi + done + +fi + +echo "Using compiler .. $CC" +if ! type "$CC" >/dev/null 2>&1; then + echo "$CC is not an executable" + exit 1 +fi +[ "$CC" != cc ] && echo "CC= $CC" >>$CONFIG_MK $CC --version | $SED -e '1!d' # Set to blank, then append user config |
