2008-06-26 12:07:46 +01:00
|
|
|
addCVars () {
|
2014-10-10 13:25:23 +01:00
|
|
|
if [ -d $1/include ]; then
|
2015-05-12 16:35:23 +01:00
|
|
|
export NIX_CFLAGS_COMPILE+=" ${ccIncludeFlag:--isystem} $1/include"
|
2008-06-26 12:07:46 +01:00
|
|
|
fi
|
|
|
|
|
2014-10-10 13:25:23 +01:00
|
|
|
if [ -d $1/lib64 -a ! -L $1/lib64 ]; then
|
2014-10-10 14:23:16 +01:00
|
|
|
export NIX_LDFLAGS+=" -L$1/lib64"
|
2008-06-26 12:07:46 +01:00
|
|
|
fi
|
|
|
|
|
2014-10-10 13:25:23 +01:00
|
|
|
if [ -d $1/lib ]; then
|
2014-10-10 14:23:16 +01:00
|
|
|
export NIX_LDFLAGS+=" -L$1/lib"
|
2008-06-26 12:07:46 +01:00
|
|
|
fi
|
2015-02-08 18:36:13 +00:00
|
|
|
|
|
|
|
if test -d $1/Library/Frameworks; then
|
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -F$1/Library/Frameworks"
|
|
|
|
fi
|
2008-06-26 12:07:46 +01:00
|
|
|
}
|
|
|
|
|
2014-07-08 13:20:05 +01:00
|
|
|
envHooks+=(addCVars)
|
2008-06-26 12:07:46 +01:00
|
|
|
|
|
|
|
# Note: these come *after* $out in the PATH (see setup.sh).
|
|
|
|
|
2015-01-09 19:22:12 +00:00
|
|
|
if [ -n "@cc@" ]; then
|
2016-02-28 00:13:15 +00:00
|
|
|
addToSearchPath _PATH @cc@/bin
|
2008-06-26 12:07:46 +01:00
|
|
|
fi
|
|
|
|
|
2015-04-18 10:00:58 +01:00
|
|
|
if [ -n "@binutils_bin@" ]; then
|
2016-04-01 09:06:01 +01:00
|
|
|
addToSearchPath _PATH @binutils_bin@/bin
|
2008-06-26 12:07:46 +01:00
|
|
|
fi
|
|
|
|
|
2015-04-18 10:00:58 +01:00
|
|
|
if [ -n "@libc_bin@" ]; then
|
2016-04-01 09:06:01 +01:00
|
|
|
addToSearchPath _PATH @libc_bin@/bin
|
2008-06-26 12:07:46 +01:00
|
|
|
fi
|
2009-11-08 00:32:12 +00:00
|
|
|
|
2015-04-18 10:00:58 +01:00
|
|
|
if [ -n "@coreutils_bin@" ]; then
|
2016-04-01 09:06:01 +01:00
|
|
|
addToSearchPath _PATH @coreutils_bin@/bin
|
2009-11-08 00:32:12 +00:00
|
|
|
fi
|
2014-12-17 18:11:30 +00:00
|
|
|
|
2015-01-26 04:29:06 +00:00
|
|
|
if [ -z "$crossConfig" ]; then
|
2017-06-26 06:17:09 +01:00
|
|
|
ENV_PREFIX=""
|
2015-01-26 04:29:06 +00:00
|
|
|
else
|
2017-06-26 06:17:09 +01:00
|
|
|
ENV_PREFIX="BUILD_"
|
2015-01-26 04:29:06 +00:00
|
|
|
fi
|
2017-06-26 06:17:09 +01:00
|
|
|
|
|
|
|
export NIX_${ENV_PREFIX}CC=@out@
|
|
|
|
|
|
|
|
export ${ENV_PREFIX}CC=@named_cc@
|
|
|
|
export ${ENV_PREFIX}CXX=@named_cxx@
|
|
|
|
|
|
|
|
for CMD in \
|
|
|
|
cpp \
|
|
|
|
ar as nm objcopy ranlib strip strings size ld windres
|
|
|
|
do
|
|
|
|
if
|
|
|
|
PATH=$_PATH type -p @binPrefix@$CMD > /dev/null
|
|
|
|
then
|
|
|
|
export ${ENV_PREFIX}$(echo "$CMD" | tr "[:lower:]" "[:upper:]")=@binPrefix@${CMD};
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# No local scope available for sourced files
|
|
|
|
unset ENV_PREFIX
|