diff mbox

[1/2] configure: add CONFIG_IASL to config-host.h

Message ID 1387968616-3629-2-git-send-email-marcel.a@redhat.com
State New
Headers show

Commit Message

Marcel Apfelbaum Dec. 25, 2013, 10:50 a.m. UTC
Acpi unit-tests will extract the iasl executable
from CONFIG_IASL define.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
---
 scripts/create_config | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Marcel Apfelbaum Dec. 25, 2013, 10:56 a.m. UTC | #1
On Wed, 2013-12-25 at 12:50 +0200, Marcel Apfelbaum wrote:
> Acpi unit-tests will extract the iasl executable
> from CONFIG_IASL define.
> 
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>

Added the maintainers of scripts/create_config,
sorry for not doing it in the first place.

Thanks,
Marcel

> ---
>  scripts/create_config | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/create_config b/scripts/create_config
> index b1adbf5..0478315 100755
> --- a/scripts/create_config
> +++ b/scripts/create_config
> @@ -26,6 +26,10 @@ case $line in
>      # save for the next definitions
>      prefix=${line#*=}
>      ;;
> + IASL=*) # iasl executable
> +    value=${line#*=}
> +    echo "#define CONFIG_IASL \"$value\""
> +    ;;
>   CONFIG_AUDIO_DRIVERS=*)
>      drivers=${line#*=}
>      echo "#define CONFIG_AUDIO_DRIVERS \\"
Michael S. Tsirkin Dec. 25, 2013, 2:22 p.m. UTC | #2
On Wed, Dec 25, 2013 at 12:50:15PM +0200, Marcel Apfelbaum wrote:
> Acpi unit-tests will extract the iasl executable
> from CONFIG_IASL define.
> 
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
> ---
>  scripts/create_config | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/create_config b/scripts/create_config
> index b1adbf5..0478315 100755
> --- a/scripts/create_config
> +++ b/scripts/create_config
> @@ -26,6 +26,10 @@ case $line in
>      # save for the next definitions
>      prefix=${line#*=}
>      ;;
> + IASL=*) # iasl executable
> +    value=${line#*=}
> +    echo "#define CONFIG_IASL \"$value\""
> +    ;;

This won't work correctly if IASL includes any
special characters like \ or '.
It's a good idea to use preprocessor's # operator,
that escapes them properly.
We have a bunch of macros like this all over the place, short term
you can introduce
#define CONFIG_STRINGIFY(x) #x
longer term we really want QEMU_STRINGIFY.

>   CONFIG_AUDIO_DRIVERS=*)
>      drivers=${line#*=}
>      echo "#define CONFIG_AUDIO_DRIVERS \\"
> -- 
> 1.8.3.1
diff mbox

Patch

diff --git a/scripts/create_config b/scripts/create_config
index b1adbf5..0478315 100755
--- a/scripts/create_config
+++ b/scripts/create_config
@@ -26,6 +26,10 @@  case $line in
     # save for the next definitions
     prefix=${line#*=}
     ;;
+ IASL=*) # iasl executable
+    value=${line#*=}
+    echo "#define CONFIG_IASL \"$value\""
+    ;;
  CONFIG_AUDIO_DRIVERS=*)
     drivers=${line#*=}
     echo "#define CONFIG_AUDIO_DRIVERS \\"