Clean up libpayload lpgcc and lpas scripts.

lpgcc and lpas are called by payload Makefiles to properly
build and link with libpayload.

Made lpas use the proper crosscompile AS, as lpgcc does with CC.
Added V=1 support to help users debug the build.
Fix basename $CC and $AS expansion.

Change-Id: Ia4dc8ba53ba7565521a79f1520155f3307b09f85
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1993
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Marc Jones 2012-11-30 16:22:51 -07:00 committed by Ronald G. Minnich
parent da1ef02e90
commit bb9490a4b0
2 changed files with 35 additions and 9 deletions

View File

@ -27,17 +27,34 @@
## SUCH DAMAGE. ## SUCH DAMAGE.
# AS wrapper for libpayload # AS wrapper for libpayload
if [ -z "${V}" ] && [ "${V}" = 1 ]; then
DEBUGME=1
else
DEBUGME=0
fi
DEFAULT_PREFIX=/opt if [ $DEBUGME -eq 1 ]; then
echo "AS = $AS"
fi
if [ -n "$AS" ]; then
b=`basename "$AS"`
if [ "$b" = "lpas" ]; then
AS=""
fi
fi
if [ "$AS" != "" ]; then
DEFAULT_AS=$AS
else
DEFAULT_AS=as DEFAULT_AS=as
fi
BASE=`dirname $0` BASE=`dirname $0`
# This will set the _LIBDIR and _INCDIR variables used below # This will set the _LIBDIR and _INCDIR variables used below
. $BASE/lp.functions . $BASE/lp.functions
DEBUGME=0
# This variable will contain the command line that the user wants to # This variable will contain the command line that the user wants to
# pass to gas # pass to gas
@ -69,4 +86,8 @@ done
_ASFLAGS="--32 -I$_INCDIR" _ASFLAGS="--32 -I$_INCDIR"
if [ $DEBUGME -eq 1 ]; then
echo "$DEFAULT_AS $_ASFLAGS $CMDLINE"
fi
$DEFAULT_AS $_ASFLAGS $CMDLINE $DEFAULT_AS $_ASFLAGS $CMDLINE

View File

@ -27,20 +27,26 @@
## SUCH DAMAGE. ## SUCH DAMAGE.
# GCC wrapper for libpayload # GCC wrapper for libpayload
if [ -z "${V}" ] && [ "${V}" = 1 ]; then
DEBUGME=1
else
DEBUGME=0
fi
if [ $DEBUGME -eq 1 ]; then
echo "CC = $CC"
fi
# let's not recurse. # let's not recurse.
# This is a hack, I know, but it makes sure that really simple user errors # This is a hack, I know, but it makes sure that really simple user errors
# don't fork-bomb your machine. # don't fork-bomb your machine.
# echo "CC = $CC"
if [ -n "$CC" ]; then if [ -n "$CC" ]; then
b=`basename $CC` b=`basename "$CC"`
if [ "$b" = "lpgcc" ]; then if [ "$b" = "lpgcc" ]; then
CC="" CC=""
fi fi
fi fi
if [ "$CC" != "" ]; then if [ "$CC" != "" ]; then
DEFAULT_CC=$CC DEFAULT_CC=$CC
else else
@ -62,7 +68,6 @@ trygccoption() {
return $? return $?
} }
DEBUGME=0
DOLINK=1 DOLINK=1
# This variable will contain the command line that the user wants to # This variable will contain the command line that the user wants to