diff mbox

[03/14] configure stellaris device only for arm softmmu

Message ID 8321db3e7d3b04a58a07b77256f5c11fad54c1dd.1250810973.git.quintela@redhat.com
State Superseded
Headers show

Commit Message

Juan Quintela Aug. 20, 2009, 11:37 p.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 Makefile  |    3 ++-
 configure |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

Comments

Paolo Bonzini Aug. 21, 2009, 8:52 a.m. UTC | #1
>   # What drivers should we compile
>   ssi_bus=no
> +stellaris=no

What about calling these CONFIG_SSI CONFIG_STELLARIS etc. already in 
configure, and initializing them with

: ${CONFIG_SSI=n}
: ${CONFIG_STELLARIS=n}

> @@ -2236,6 +2238,10 @@ if test "$ssi_bus" = "yes" ; then
>       echo "CONFIG_SSI=y">>  $config_host_mak
>   fi
>
> +if test "$stellaris" = "yes" ; then
> +    echo "CONFIG_STELLARIS=y">>  $config_host_mak
> +fi

Then you can:

1) save duplication using

for i in CONFIG_SSI CONFIG_STELLARIS; do
   case \$$i in
   if test "$config_var" = y; then
     echo "$i=y">> $config_host_mak
   fi
done

2) allow the user to force your choice by setting environment variables 
when calling configure (not sure how useful this is).

Otherwise, looks nice!

Paolo
Juan Quintela Aug. 21, 2009, 9:11 a.m. UTC | #2
Paolo Bonzini <bonzini@gnu.org> wrote:
>>   # What drivers should we compile
>>   ssi_bus=no
>> +stellaris=no
>
> What about calling these CONFIG_SSI CONFIG_STELLARIS etc. already in
> configure, and initializing them with
>
> : ${CONFIG_SSI=n}
> : ${CONFIG_STELLARIS=n}
>
>> @@ -2236,6 +2238,10 @@ if test "$ssi_bus" = "yes" ; then
>>       echo "CONFIG_SSI=y">>  $config_host_mak
>>   fi
>>
>> +if test "$stellaris" = "yes" ; then
>> +    echo "CONFIG_STELLARIS=y">>  $config_host_mak
>> +fi
>
> Then you can:
>
> 1) save duplication using
>
> for i in CONFIG_SSI CONFIG_STELLARIS; do
>   case \$$i in
>   if test "$config_var" = y; then
>     echo "$i=y">> $config_host_mak
>   fi
> done
>
> 2) allow the user to force your choice by setting environment
> variables when calling configure (not sure how useful this is).
>
> Otherwise, looks nice!

I would do the other way around :)
I.e. always print
CONFIG_STELLARIS=y
or
CONFIG_STELLARIS=n

That will move from 3 lines to 1 line.

About the big problem, is that in configure, we have 2 kinds of
variables:
- configure variables: usually lowercase
- variables for build system: usually uppercase

Notice that current code does a mess at distinguishing them, it _mainly_
is the way I have described.  About your way, perhaps itis a better
idea, to _always_ use the configure names, that way we don't have to
"translate" from one name to the other.

Later, Juan.
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 0540d1b..b58984a 100644
--- a/Makefile
+++ b/Makefile
@@ -77,7 +77,7 @@  obj-y += readline.o console.o host-utils.o

 obj-y += irq.o ptimer.o
 obj-y += i2c.o smbus.o smbus_eeprom.o max7310.o wm8750.o
-obj-y += ssd0303.o stellaris_input.o twl92230.o
+obj-y += twl92230.o
 obj-y += tmp105.o lm832x.o eeprom93xx.o tsc2005.o
 obj-y += scsi-disk.o cdrom.o
 obj-y += scsi-generic.o
@@ -91,6 +91,7 @@  obj-y += qemu-char.o aio.o net-checksum.o savevm.o
 obj-y += msmouse.o ps2.o
 obj-y += qdev.o qdev-properties.o

+obj-$(CONFIG_STELLARIS) += stellaris_input.o ssd0303.o
 obj-$(CONFIG_SSI) += ssi.o ssi-sd.o max111x.o ssd0323.o ads7846.o
 obj-$(CONFIG_BRLAPI) += baum.o
 obj-$(CONFIG_WIN32) += tap-win32.o
diff --git a/configure b/configure
index fd02f54..f1481f3 100755
--- a/configure
+++ b/configure
@@ -1815,6 +1815,7 @@  fi

 # What drivers should we compile
 ssi_bus=no
+stellaris=no

 for target in $target_list; do
 target_dir="$target"
@@ -2041,6 +2042,7 @@  if test "$target_softmmu" = "yes" ; then
   case "$target_arch2" in
   arm*)
     ssi_bus=yes
+    stellaris=yes
   ;;
   esac
 fi
@@ -2236,6 +2238,10 @@  if test "$ssi_bus" = "yes" ; then
     echo "CONFIG_SSI=y" >> $config_host_mak
 fi

+if test "$stellaris" = "yes" ; then
+    echo "CONFIG_STELLARIS=y" >> $config_host_mak
+fi
+
 echo "/* Automatically generated by configure - do not modify */" > $config_host_h

 /bin/sh $source_path/create_config < $config_host_mak >> $config_host_h