summaryrefslogtreecommitdiff
path: root/util/abuild
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-02-07 21:43:48 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2010-02-07 21:43:48 +0000
commitabf2ad716daff751d75907d47bcae4a7044fd7b4 (patch)
treef82427b43d76a4791253373affed1af8669e2e7b /util/abuild
parent389240f288b2708617a35ebe8d7f89b3bff316c5 (diff)
newconfig is no more.
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5089 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/abuild')
-rwxr-xr-xutil/abuild/abuild201
1 files changed, 15 insertions, 186 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 525740ddd9..be6ecfad0c 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -34,8 +34,6 @@ cpus=1
# Configure-only mode
configureonly=0
-# use old config method "newconfig"
-oldconfig=0
# One might want to adjust these in case of cross compiling
for i in make gmake gnumake nonexistant_make; do
@@ -122,117 +120,9 @@ function architecture
{
VENDOR=$1
MAINBOARD=$2
- if [ $oldconfig -eq 1 ]; then
- ARCH=`cat $ROOT/src/mainboard/$VENDOR/$MAINBOARD/Config.lb | \
- grep ^arch | cut -f 2 -d\ `
- echo $ARCH | sed s/ppc/powerpc/
- else
- ARCH=`cat $ROOT/src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
- grep "select ARCH_"|cut -f2- -d_`
- echo $ARCH | sed s/X86/i386/
- fi
-}
-
-function create_config_old
-{
- VENDOR=$1
- MAINBOARD=$2
- CONFIG=$3
- TARCH=$( architecture $VENDOR $MAINBOARD )
- TARGCONFIG=$ROOT/targets/$VENDOR/$MAINBOARD/Config-abuild.lb
-
- if [ "$CONFIG" != "" ]; then
- TARGCONFIG=$ROOT/targets/$VENDOR/$MAINBOARD/$CONFIG
- fi
-
- # get a working payload for the board if we have one.
- # the --payload option expects a directory containing
- # a shell script payload.sh
- # Usage: payload.sh [VENDOR] [DEVICE]
- # the script returns an absolute path to the payload binary.
-
- if [ -f $payloads/payload.sh ]; then
- PAYLOAD=`sh $payloads/payload.sh $VENDOR $MAINBOARD`
- printf "Using payload $PAYLOAD\n"
- fi
-
- mkdir -p $TARGET
-
- if [ -f $TARGCONFIG ]; then
- cp $TARGCONFIG $TARGET/Config-${VENDOR}_${MAINBOARD}.lb
- printf "Using existing test target $TARGCONFIG"
- xml " <config>$TARGCONFIG</config>"
- else
- printf " Creating config file..."
- xml " <config>autogenerated</config>"
- ( cat << EOF
-# This will make a target directory of ./VENDOR_MAINBOARD
-
-target VENDOR_MAINBOARD
-mainboard VENDOR/MAINBOARD
-
-option CC="CROSSCC"
-option CONFIG_CROSS_COMPILE="CROSS_PREFIX"
-option HOSTCC="CROSS_HOSTCC"
-
-__COMPRESSION__
-__LOGLEVEL__
-
-EOF
- if [ "$TARCH" == i386 ] ; then
- cat <<EOF
-romimage "normal"
- option CONFIG_USE_FALLBACK_IMAGE=0
- option COREBOOT_EXTRA_VERSION=".0-normal"
- payload __PAYLOAD__
-end
-
-romimage "fallback"
- option CONFIG_USE_FALLBACK_IMAGE=1
- option COREBOOT_EXTRA_VERSION=".0-fallback"
- payload __PAYLOAD__
-end
-buildrom ./coreboot.rom CONFIG_ROM_SIZE "normal" "fallback"
-EOF
- else
- cat <<EOF
-romimage "only"
- option COREBOOT_EXTRA_VERSION=".0"
- payload __PAYLOAD__
-end
-buildrom ./coreboot.rom CONFIG_ROM_SIZE "only"
-EOF
- fi
- ) > $TARGET/Config-${VENDOR}_${MAINBOARD}.lb
- fi
-
- if [ "$loglevel" != "default" ]; then
- LOGLEVEL1="option CONFIG_MAXIMUM_CONSOLE_LOGLEVEL=$loglevel"
- LOGLEVEL2="option CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$loglevel"
- else
- LOGLEVEL1="# no loglevel override"
- LOGLEVEL2=""
- fi
-
- COMPRESSION="# no compression"
- if which lzma >/dev/null 2>/dev/null; then
- if [ "$PAYLOAD" != /dev/null ]; then
- COMPRESSION="option CONFIG_COMPRESSED_PAYLOAD_LZMA=1"
- fi
- fi
-
- cp $TARGET/Config-${VENDOR}_${MAINBOARD}.lb $TARGET/Config-${VENDOR}_${MAINBOARD}.lb.pre
- sed -e s:VENDOR:$VENDOR:g \
- -e s:MAINBOARD:$MAINBOARD:g \
- -e s:payload\ __PAYLOAD__:payload\ $PAYLOAD:g \
- -e s:CROSSCC:"$CC":g \
- -e s:CROSS_PREFIX:"$CROSS_COMPILE":g \
- -e s:CROSS_HOSTCC:"$HOSTCC":g \
- -e s:__COMPRESSION__:"$COMPRESSION":g \
- -e s:__LOGLEVEL__:"$LOGLEVEL1"\
-"$LOGLEVEL2":g \
- $TARGET/Config-${VENDOR}_${MAINBOARD}.lb.pre > $TARGET/Config-${VENDOR}_${MAINBOARD}.lb
- printf " ok\n"
+ ARCH=`cat $ROOT/src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
+ grep "select ARCH_"|cut -f2- -d_`
+ echo $ARCH | sed s/X86/i386/
}
function create_config
@@ -308,66 +198,12 @@ function create_config
fi
}
-function create_builddir
-{
- VENDOR=$1
- MAINBOARD=$2
-
- printf " Creating builddir..."
-
- target_dir=$TARGET
- config_dir=$ROOT/util/newconfig
- yapps2_py=$config_dir/yapps2.py
- config_g=$config_dir/config.g
- config_lb=Config-${VENDOR}_${MAINBOARD}.lb
-
- cd $target_dir
-
- build_dir=${VENDOR}_${MAINBOARD}
- config_py=$build_dir/config.py
-
- if [ ! -d $build_dir ] ; then
- mkdir -p $build_dir
- fi
- if [ ! -f $config_py ]; then
- $PYTHON $yapps2_py $config_g $config_py &> $build_dir/py.log
- fi
-
- # make sure config.py is up-to-date
-
- export PYTHONPATH=$config_dir
- $PYTHON $config_py $config_lb $ROOT &> $build_dir/config.log
- if [ $? -eq 0 ]; then
- printf "ok\n"
- xml " <builddir>ok</builddir>"
- xml " <log>"
- xmlfile $build_dir/config.log
- xml " </log>"
- xml ""
- return 0
- else
- printf "FAILED! Log excerpt:\n"
- xml " <builddir>failed</builddir>"
- xml " <log>"
- xmlfile $build_dir/config.log
- xml " </log>"
- xml ""
- tail -n $CONTEXT $build_dir/config.log 2> /dev/null || tail -$CONTEXT $build_dir/config.log
- return 1
- fi
-}
-
function create_buildenv
{
VENDOR=$1
MAINBOARD=$2
CONFIG=$3
- if [ $oldconfig -eq 1 ]; then
- create_config_old $VENDOR $MAINBOARD $CONFIG
- create_builddir $VENDOR $MAINBOARD
- else
- create_config $VENDOR $MAINBOARD $CONFIG
- fi
+ create_config $VENDOR $MAINBOARD $CONFIG
}
function compile_target
@@ -382,20 +218,14 @@ function compile_target
CURR=$( pwd )
stime=`perl -e 'print time();'`
- if [ $oldconfig -eq 1 ]; then
- cd $TARGET/${VENDOR}_${MAINBOARD}
- eval $MAKE $silent -j $cpus &> make.log
- ret=$?
- else
- build_dir=$TARGET/${VENDOR}_${MAINBOARD}
- eval $MAKE $silent -j $cpus obj=${build_dir} \
- &> ${build_dir}/make.log
- ret=$?
- mv .config ${build_dir}/config.build
- mv .xcompile ${build_dir}/xcompile.build
- mv ..config.tmp ${build_dir}/config.deps
- cd $TARGET/${VENDOR}_${MAINBOARD}
- fi
+ build_dir=$TARGET/${VENDOR}_${MAINBOARD}
+ eval $MAKE $silent -j $cpus obj=${build_dir} \
+ &> ${build_dir}/make.log
+ ret=$?
+ mv .config ${build_dir}/config.build
+ mv .xcompile ${build_dir}/xcompile.build
+ mv ..config.tmp ${build_dir}/config.deps
+ cd $TARGET/${VENDOR}_${MAINBOARD}
etime=`perl -e 'print time();'`
duration=$(( $etime - $stime ))
if [ $ret -eq 0 ]; then
@@ -692,15 +522,15 @@ target=""
buildall=false
verbose=false
-test -f util/newconfig/config.g && ROOT=$( pwd )
-test -f ../util/newconfig/config.g && ROOT=$( cd ..; pwd )
+test -f util/sconfig/config.g && ROOT=$( pwd )
+test -f ../util/sconfig/config.g && ROOT=$( cd ..; pwd )
test "$ROOT" = "" && ROOT=$( cd ../..; pwd )
# parse parameters.. try to find out whether we're running GNU getopt
getoptbrand="`getopt -V`"
if [ "${getoptbrand:0:6}" == "getopt" ]; then
# Detected GNU getopt that supports long options.
- args=`getopt -l version,verbose,help,all,target:,broken,payloads:,test,cpus:,silent,xml,config,loglevel:,oldconfig Vvhat:bp:Tc:sxCl:o -- "$@"`
+ args=`getopt -l version,verbose,help,all,target:,broken,payloads:,test,cpus:,silent,xml,config,loglevel: Vvhat:bp:Tc:sxCl: -- "$@"`
eval set "$args"
else
# Detected non-GNU getopt
@@ -731,7 +561,6 @@ while true ; do
-sb|--scan-build) shift; scanbuild=true;;
-C|--config) shift; configureonly=1;;
-l|--loglevel) shift; loglevel="$1"; shift;;
- -o|--oldconfig) shift; oldconfig=1;;
--) shift; break;;
-*) printf "Invalid option\n\n"; myhelp; exit 1;;
*) break;;