Skip to content

Commit

Permalink
create a full cross-toolchain worth of wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
anttikantee committed Jun 19, 2015
1 parent 9ece5a6 commit 00efb33
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app-tools/Makefile.app-tools
Expand Up @@ -14,7 +14,8 @@ endif
APP_TOOL_FILES= cc c++ configure make gmake
APP_TOOL_FILES+= specs-inter specs-stub specs-final

APP_TOOL_PASSTHROUGH= ar objcopy
APP_TOOL_PASSTHROUGH= ar as cpp ld nm objcopy objdump ranlib readelf
APP_TOOL_PASSTHROUGH+= size strings strip

_APP_TOOL_TARGETS:= \
$(APP_TOOL_FILES:%=$(APP_TOOLS_DIR)/rumprun-$(APP_TOOLS_PLATFORM)-%) \
Expand Down
28 changes: 22 additions & 6 deletions build-rr.sh
Expand Up @@ -145,6 +145,8 @@ buildrump ()
MACHINE=$(${RUMPMAKE} -f /dev/null -V '${MACHINE}')
[ -z "${MACHINE}" ] && die could not figure out target machine

makeconfigmk ${PLATFORMDIR}/config.mk

cat >> ${RUMPTOOLS}/mk.conf << EOF
.if defined(LIB) && \${LIB} == "pthread"
.PATH: $(pwd)/lib/librumprun_base/pthread
Expand Down Expand Up @@ -198,6 +200,19 @@ buildpci ()
fi
}

wraponetool ()
{

configfile=$1
tool=$2

tpath=$(${RUMPMAKE} -f bsd.own.mk -V "\${${tool}}")
if ! [ -n "${tpath}" -a -x ${tpath} ]; then
die Could not locate buildrump.sh tool \"${tool}\".
fi
echo "${tool}=${tpath}" >> ${configfile}
}

makeconfigmk ()
{

Expand All @@ -208,11 +223,14 @@ makeconfigmk ()
echo "BUILDRUMP_TOOLFLAGS=$(pwd)/${RUMPTOOLS}/toolchain-conf.mk" >> ${1}
echo "MACHINE=${MACHINE}" >> ${1}

tools="AR CPP CC INSTALL NM OBJCOPY"
havecxx && tools="${tools} CXX"
for t in ${tools}; do
echo "${t}=$(${RUMPMAKE} -f bsd.own.mk -V "\${${t}}")" >> ${1}
# wrap mandatory toolchain bits
for t in AR AS CC CPP LD NM OBJCOPY OBJDUMP RANLIB READELF \
SIZE STRINGS STRIP; do
wraponetool ${1} ${t}
done

# c++ is optional, wrap it iff available
havecxx && wraponetool ${1} CXX
}


Expand All @@ -231,8 +249,6 @@ checksubmodules
buildrump "$@"
builduserspace

makeconfigmk ${PLATFORMDIR}/config.mk

# depends on config.mk
buildpci

Expand Down

0 comments on commit 00efb33

Please sign in to comment.