comments below

On 07/23/14 22:04, Jordan Justen wrote:
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
> ---
>  OvmfPkg/build.sh | 39 +++++++++++++++++++++++++++++++--------
>  1 file changed, 31 insertions(+), 8 deletions(-)
> 
> diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
> index c3cc72e..9207eae 100755
> --- a/OvmfPkg/build.sh
> +++ b/OvmfPkg/build.sh
> @@ -41,7 +41,8 @@ fi
>  # Configure defaults for various options
>  #
>  
> -PROCESSOR=X64
> +ARCH_IA32=no
> +ARCH_X64=no
>  BUILDTARGET=DEBUG
>  BUILD_OPTIONS=
>  PLATFORMFILE=
> @@ -123,7 +124,12 @@ do
>    else
>      case $LAST_ARG in
>        -a)
> -        PROCESSOR=$arg
> +        if [[ "$arg" != "IA32" && "$arg" != "X64" ]]; then

You probably want x"$arg" != x"IA32" for robustness (or even "IA32" !=
"$arg"), but it's not very important.

> +          echo Unsupported processor architecture: $PROCESSOR

Hm, PROCESSOR is unset here; I think you meant $arg.


> +          echo Only IA32 or X64 is supported
> +          exit 1
> +        fi
> +        eval ARCH_$arg=yes
>          ;;
>        -b)
>          BUILDTARGET=$arg
> @@ -146,9 +152,25 @@ do
>    shift
>  done
>  
> +if [[ "$ARCH_IA32" == "yes" && "$ARCH_X64" == "yes" ]]; then
> +  PROCESSOR=IA32X64
> +  Processor=Ia32X64
> +  BUILD_OPTIONS="$BUILD_OPTIONS -a IA32 -a X64"
> +  PLATFORM_BUILD_DIR=Ovmf3264
> +elif [[ "$ARCH_IA32" == "yes" && "$ARCH_X64" == "no" ]]; then
> +  PROCESSOR=IA32
> +  Processor=Ia32
> +  BUILD_OPTIONS="$BUILD_OPTIONS -a IA32"
> +  PLATFORM_BUILD_DIR=Ovmf$Processor
> +else
> +  PROCESSOR=X64
> +  Processor=X64
> +  BUILD_OPTIONS="$BUILD_OPTIONS -a X64"
> +  PLATFORM_BUILD_DIR=Ovmf$Processor
> +fi
> +

OK, PLATFORM_BUILD_DIR matches OvmfPkgIa32X64.dsc / OUTPUT_DIRECTORY
this way (Build/Ovmf3264).

>  case $PROCESSOR in
>    IA32)
> -    Processor=Ia32
>      if [ -n "$QEMU_COMMAND" ]; then
>        #
>        # The user set the QEMU_COMMAND variable. We'll use it to run QEMU.
> @@ -164,15 +186,16 @@ case $PROCESSOR in
>        echo Unable to find QEMU for IA32 architecture!
>        exit 1
>      fi
> +    BUILD_ROOT_ARCH=$PROCESSOR
>      ;;
> -  X64)
> -    Processor=X64
> +  X64|IA32X64)
>      if [ -z "$QEMU_COMMAND" ]; then
>        #
>        # The user didn't set the QEMU_COMMAND variable.
>        #
>        QEMU_COMMAND=qemu-system-x86_64
>      fi
> +    BUILD_ROOT_ARCH=X64
>      ;;
>    *)
>      echo Unsupported processor architecture: $PROCESSOR

Can you set BUILD_ROOT_ARCH next to setting PROCESSOR? I think that
would be clearer (but I don't insist).

> @@ -216,9 +239,9 @@ fi
>  #echo Remaining for qemu: $*
>  #exit 1
>  
> -BUILD_ROOT=$WORKSPACE/Build/Ovmf$Processor/"$BUILDTARGET"_"$TARGET_TOOLS"
> +BUILD_ROOT=$WORKSPACE/Build/$PLATFORM_BUILD_DIR/"$BUILDTARGET"_"$TARGET_TOOLS"
>  FV_DIR=$BUILD_ROOT/FV
> -BUILD_ROOT_ARCH=$BUILD_ROOT/$PROCESSOR
> +BUILD_ROOT_ARCH=$BUILD_ROOT/$BUILD_ROOT_ARCH
>  QEMU_FIRMWARE_DIR=$BUILD_ROOT/QEMU

BUILD_ROOT_ARCH appears to be passed only to qemu, with -hda. OK, I guess.

>  
>  if  [[ ! -f `which build` || ! -f `which GenFv` ]];
> @@ -259,6 +282,6 @@ fi
>  # Build the edk2 OvmfPkg
>  #
>  echo Running edk2 build for OvmfPkg$Processor
> -build -p $PLATFORMFILE $BUILD_OPTIONS -a $PROCESSOR -b $BUILDTARGET -t 
> $TARGET_TOOLS -n $THREADNUMBER
> +build -p $PLATFORMFILE $BUILD_OPTIONS -b $BUILDTARGET -t $TARGET_TOOLS -n 
> $THREADNUMBER
>  exit $?
>  
> 

Thanks
Laszlo

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to