From 3779716acf4167b5871538ec1021ecbdd15bf35d Mon Sep 17 00:00:00 2001 From: Antti Kantee Date: Thu, 22 Oct 2015 01:06:00 +0000 Subject: [PATCH] Create RUMPRUN_SHCONF, OBJDIR -> RROBJ, DESTDIR -> RRDEST. --- app-tools/Makefile | 2 +- build-rr.sh | 53 +++++++++++++++++++++++-------------------- platform/Makefile.inc | 10 ++++---- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/app-tools/Makefile b/app-tools/Makefile index d656914..962b9be 100644 --- a/app-tools/Makefile +++ b/app-tools/Makefile @@ -48,7 +48,7 @@ $(APP_TOOLS_DIR)/${2}: \ -e 's#!APPTOOLS_CXX!#$(APP_TOOLS_CXX)#g;' \ -e 's#!MACHINE_ARCH!#$(MACHINE_ARCH)#g;' \ -e 's#!GNUPLATFORM!#$(TOOLTUPLE)#g;' \ - -e 's#!DESTDIR!#$(DESTDIR)#g;' \ + -e 's#!DESTDIR!#$(RRDEST)#g;' \ -e 's#!APPTOOLS_DIR!#$(APP_TOOLS_DIR)#g;' \ -e 's#!APPTOOLS_PLATFORM!#$(PLATFORM)#g;' \ -e 's#!CPPFLAGS!#$(BUILDRUMP_TOOL_CPPFLAGS)#g;' \ diff --git a/build-rr.sh b/build-rr.sh index 6ebf767..c8f3644 100755 --- a/build-rr.sh +++ b/build-rr.sh @@ -91,7 +91,7 @@ abspath () parseargs () { - DESTDIR=./rumprun + RRDEST=./rumprun KERNONLY=false RROBJ= RUMPSRC=src-netbsd @@ -109,7 +109,7 @@ parseargs () STDJ=-j${OPTARG} ;; 'd') - DESTDIR="${OPTARG}" + RRDEST="${OPTARG}" ;; 'k') KERNONLY=true @@ -244,7 +244,7 @@ setvars () STAGING="${RROBJ}/dest.stage" BROBJ="${RROBJ}/buildrump.sh" - abspath DESTDIR + abspath RRDEST abspath RROBJ abspath RUMPSRC } @@ -289,7 +289,9 @@ buildrump () [ $(${RUMPMAKE} -f bsd.own.mk -V '${_BUILDRUMP_CXX}') != 'yes' ] \ || HAVECXX=true - makeconfigmk ${RROBJ}/config.mk + makeconfig ${RROBJ}/config.mk '' + makeconfig ${RROBJ}/config.sh \" + export RUMPRUN_MKCONF="${RROBJ}/config.mk" cat >> ${RUMPTOOLS}/mk.conf << EOF .if defined(LIB) && \${LIB} == "pthread" @@ -366,45 +368,46 @@ wraponetool () configfile=$1 tool=$2 + quote=$3 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} + echo "${tool}=${quote}${tpath}${quote}" >> ${configfile} } -makeconfigmk () +makeconfig () { - echo "BUILDRUMP=${BUILDRUMP}" > ${1} - echo "RUMPSRC=${RUMPSRC}" >> ${1} - echo "RUMPMAKE=${RUMPMAKE}" >> ${1} - echo "BUILDRUMP_TOOLFLAGS=$(pwd)/${RUMPTOOLS}/toolchain-conf.mk" >> ${1} - echo "MACHINE=${MACHINE}" >> ${1} - echo "MACHINE_ARCH=${MACHINE_ARCH}" >> ${1} - echo "TOOLTUPLE=${TOOLTUPLE}" >> ${1} - echo "KERNONLY=${KERNONLY}" >> ${1} - echo "PLATFORM=${PLATFORM}" >> ${1} + quote="${2}" - echo "DESTDIR=${DESTDIR}" >> ${1} - echo "OBJDIR=${RROBJ}" >> ${1} + echo "BUILDRUMP=${quote}${BUILDRUMP}${quote}" > ${1} + echo "RUMPSRC=${quote}${RUMPSRC}${quote}" >> ${1} + echo "RUMPMAKE=${quote}${RUMPMAKE}${quote}" >> ${1} + echo "BUILDRUMP_TOOLFLAGS=${quote}$(pwd)/${RUMPTOOLS}/toolchain-conf.mk${quote}" >> ${1} + echo "MACHINE=${quote}${MACHINE}${quote}" >> ${1} + echo "MACHINE_ARCH=${quote}${MACHINE_ARCH}${quote}" >> ${1} + echo "TOOLTUPLE=${quote}${TOOLTUPLE}${quote}" >> ${1} + echo "KERNONLY=${quote}${KERNONLY}${quote}" >> ${1} + echo "PLATFORM=${quote}${PLATFORM}${quote}" >> ${1} + + echo "RRDEST=${quote}${RRDEST}${quote}" >> ${1} + echo "RROBJ=${quote}${RROBJ}${quote}" >> ${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} + wraponetool ${1} ${t} "${quote}" done # c++ is optional, wrap it iff available if ${HAVECXX}; then echo "CONFIG_CXX=yes" >> ${1} - wraponetool ${1} CXX + wraponetool ${1} CXX "${quote}" else echo "CONFIG_CXX=no" >> ${1} fi - - export RUMPRUN_MKCONF=${1} } dobuild () @@ -443,10 +446,10 @@ doinstall () # default used to be a symlink, so this is for "compat". # remove in a few months. - rm -f ${DESTDIR} > /dev/null 2>&1 || true + rm -f ${RRDEST} > /dev/null 2>&1 || true - mkdir -p ${DESTDIR} || die cannot create ${DESTDIR} - ( cd ${STAGING} ; tar -cf - .) | (cd ${DESTDIR} ; tar -xf -) + mkdir -p ${RRDEST} || die cannot create ${RRDEST} + ( cd ${STAGING} ; tar -cf - .) | (cd ${RRDEST} ; tar -xf -) } # @@ -473,7 +476,7 @@ if ${DObuild}; then ${TOOLTUPLE} "$(${RUMPMAKE} -f bsd.own.mk -V '${ACTIVE_CC}')" fi if ${DOinstall}; then - printf ">> installed to \"%s\"\n" ${DESTDIR} + printf ">> installed to \"%s\"\n" ${RRDEST} fi echo '>>' echo ">> $0 ran successfully" diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 4dce4e0..ff423a6 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -9,9 +9,9 @@ TARGETS:= compiler_rt endif ifeq (${BUILDRR},true) -CPPFLAGS+= -I${OBJDIR}/dest.stage/include +CPPFLAGS+= -I${RROBJ}/dest.stage/include else -CPPFLAGS+= -I${DESTDIR}/include +CPPFLAGS+= -I${RRDEST}/include endif MAINOBJ:= rumprun-${PLATFORM}-${MACHINE_ARCH}.o @@ -36,7 +36,7 @@ $(eval $(call BUILDLIB_target,${COMPILERRTDIR},libcompiler_rt.a,RUMPSRC=${RUMPSR PSEUDOSTUBS=${COMMONDIR}/rumprun-pseudolinkstubs -${PSEUDOSTUBS}.c: ${OBJDIR}/dest.stage/lib/librumprun_base.a +${PSEUDOSTUBS}.c: ${RROBJ}/dest.stage/lib/librumprun_base.a sh ../makepseudolinkstubs.sh ${NM} ${RUMPSRC} $< $@ bmk.ldscript: ${LDSCRIPT} @@ -75,9 +75,9 @@ tests: ${MAINOBJ} commonlibs ../../tests/runtests.sh ${PLATFORM_DEFAULT_TESTER} ifeq (${BUILDRR},true) -INSTALLDIR= ${OBJDIR}/dest.stage +INSTALLDIR= ${RROBJ}/dest.stage else -INSTALLDIR= ${DESTDIR} +INSTALLDIR= ${RRDEST} endif .PHONY: installkern -- 2.39.5