summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-07-22 12:26:27 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-07-22 12:26:27 +0000
commit587df17d99d160bd017cc54ee0f77abf02833c92 (patch)
tree9c665ba4364a5c7e39ca4db959bfac7874740466 /configure
parentf51fc9df9760e23ab1d98170955c33415cf66137 (diff)
downloadskalibs-587df17d99d160bd017cc54ee0f77abf02833c92.tar.xz
Tentative magic to support out-of-path CC, especially in cross-builds
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 12 insertions, 3 deletions
diff --git a/configure b/configure
index 2248242..151662f 100755
--- a/configure
+++ b/configure
@@ -360,10 +360,19 @@ else
fi
echo "Checking for C compiler..."
trycc ${CC}
-if test -n "$cross" && test -n "$CC_AUTO" ; then
+if test -n "$CC_AUTO" ; then
b=`basename "$CC"`
- if test "${b}" = "${b##$cross}" ; then
- echo "$0: warning: compiler $CC is declared as a cross-compiler for target $target but does not start with prefix $cross" 1>&2
+ adjust_cross=false
+ if test "$b" != "$CC" ; then
+ adjust_cross=true
+ echo "$0: warning: compiler $CC is declared with its own path. If it's not accessible via PATH, you will need to pass AR, RANLIB and STRIP make variables to the make invocation." 1>&2
+ fi
+ if test -n "$cross" ; then
+ if test "$b" = "${b##$cross}" ; then
+ echo "$0: warning: compiler $CC is declared as a cross-compiler for target $target but does not start with prefix ${cross}" 1>&2
+ elif $adjust_cross ; then
+ cross=`dirname "$CC"`/"$cross"
+ fi
fi
fi
trycc ${cross}gcc