]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
Create RUMPRUN_SHCONF, OBJDIR -> RROBJ, DESTDIR -> RRDEST.
authorAntti Kantee <pooka@iki.fi>
Thu, 22 Oct 2015 01:06:00 +0000 (01:06 +0000)
committerAntti Kantee <pooka@iki.fi>
Thu, 22 Oct 2015 01:07:29 +0000 (01:07 +0000)
app-tools/Makefile
build-rr.sh
platform/Makefile.inc

index d656914ae512bfa3ff8b57299e28b14f43ee4bf4..962b9bed1f74fcd30f43882a80f8b78db85f19a8 100644 (file)
@@ -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;'         \
index 6ebf7670c359951c29569599683778b6d9a6a85c..c8f3644362ddc3c58f269ff52cb4aedc09011f38 100755 (executable)
@@ -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"
index 4dce4e01eb64fa7d3a8aac0d3745291f212f3f53..ff423a6f518c9d7cf510a9e92ec9273f8f0e1464 100644 (file)
@@ -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