Skip to contentSkip to conversation

configure and build errors on Solaris 10 due to /bin/sh usage

Qemu-devel Andreas Färber 4 participants 16 messages Sep 12, 2010 – Oct 21, 2016

lore
Share & tools
lore
#0 lore raw

Public bug reported:

Running LANG=C LC_ALL=C ./configure --prefix=... --install=/usr/ucb/install on Solaris 10 amd64 results in the following errors:

./configure: bad substitution
./configure: !: not found
./configure: curl-config: not found
./configure: curl-config: not found

Error: invalid trace backend
Please choose a supported trace backend.

Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for install.

The first few can be resolved by running bash ./configure ... instead.

The "check if trace backend exists" hardcodes sh "$source_path/tracetool" ... in configure. Replacing sh with bash makes it work.

gmake complains "Makefile:331: no file name for -include", which is a filter for *.d files. create_config gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works. etc.

To sum it up,
a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and
b) hardcoding 'sh' in configure or Makefiles seems like a bad idea.

QEMU Git 73d7434279e3905164afd02360eebe4b43c7fa (ESP: fix ESP DMA access...)

$ uname -a
SunOS sonnengoettin 5.10 Generic_142901-03 i86pc i386 i86pc

# No banner output for /bin/sh

$ bash --version
GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.

** Affects: qemu
Importance: Undecided
Status: New

** Tags: solaris

Signature · 43 lines
configure and build errors on Solaris 10 due to /bin/sh usage
https://bugs.launchpad.net/bugs/636315
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
Running `LANG=C LC_ALL=C ./configure --prefix=... --install=/usr/ucb/install` on Solaris 10 amd64 results in the following errors:

./configure: bad substitution
./configure: !: not found
./configure: curl-config: not found
./configure: curl-config: not found

Error: invalid trace backend
Please choose a supported trace backend.


Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for `install`.

The first few can be resolved by running `bash ./configure ...` instead. 

The "check if trace backend exists" hardcodes `sh "$source_path/tracetool" ...` in configure. Replacing sh with bash makes it work.

`gmake` complains "Makefile:331: no file name for -include", which is a filter for *.d files.
`create_config` gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works.
etc.

To sum it up,
a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and
b) hardcoding 'sh' in configure or Makefiles seems like a bad idea.

QEMU Git 73d7434279e3905164afd02360eebe4b43c7fa (ESP: fix ESP DMA access...)

$ uname -a
SunOS sonnengoettin 5.10 Generic_142901-03 i86pc i386 i86pc

# No banner output for /bin/sh

$ bash --version
GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.
#1 lore raw
Quoted 6 lines · Andreas Färber

Public bug reported:

Running LANG=C LC_ALL=C ./configure --prefix=... --install=/usr/ucb/install on Solaris 10 amd64 results in the following errors:

Quoted 7 lines

./configure: bad substitution
./configure: !: not found
./configure: curl-config: not found
./configure: curl-config: not found

Error: invalid trace backend
Please choose a supported trace backend.

What is the output of "sh ./tracetool --nop --check-backend"?

Quoted 10 lines

Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for install.

The first few can be resolved by running bash ./configure ... instead.

The "check if trace backend exists" hardcodes sh "$source_path/tracetool" ... in configure. Replacing sh with bash makes it work.

Quoted 6 lines

gmake complains "Makefile:331: no file name for -include", which is a filter for *.d files. create_config gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works. etc.

To sum it up,
a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and

I fixed one in 2184d75b4a6a253e8b1e002b3dbcc85c20ba6041 and now Milax's /bin/sh is happy.

#2 lore raw

Am 12.09.2010 um 19:22 schrieb Blue Swirl:

Quoted 6 lines
Quoted 2 lines · Andreas Färber

Error: invalid trace backend
Please choose a supported trace backend.

What is the output of "sh ./tracetool --nop --check-backend"?

./tracetool: syntax error at line 51: `$' unexpected

#3 lore raw
Quoted 11 lines · Andreas Färber

Am 12.09.2010 um 19:22 schrieb Blue Swirl:

Quoted 7 lines
Quoted 3 lines · Andreas Färber

Error: invalid trace backend
Please choose a supported trace backend.

What is the output of "sh ./tracetool --nop --check-backend"?

./tracetool: syntax error at line 51: `$' unexpected

Does this patch fix the problem?

tracetool +2 -1
index 534cc70..c7582bf 100755
@@ -48,7 +48,8 @@ get_argnames()
 {
     local nfields field name
     nfields=0
-    for field in $(get_args "$1"); do
+    args=get_args "$1"
+    for field in "$args"; do
         nfields=$((nfields + 1))
 
         # Drop pointer star
#4 lore raw

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

Quoted 15 lines

On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <[email protected]

Quoted 6 lines

wrote:
Am 12.09.2010 um 19:22 schrieb Blue Swirl:

Quoted 1 line

What is the output of "sh ./tracetool --nop --check-backend"?

./tracetool: syntax error at line 51: `$' unexpected

Does this patch fix the problem?

tracetool +0 -0
index 534cc70..c7582bf 100755

tracetool get_argnames() · line 52

Quoted 6 lines
tracetool +2 -1
@@ -48,7 +48,8 @@ get_argnames()
 {
    local nfields field name
    nfields=0
-    for field in $(get_args "$1"); do
+    args=get_args "$1"
+    for field in "$args"; do

This part yes. (I took the liberty of adding args to the local line above)

tracetool get_argnames() · line 53

Quoted 1 line
tracetool +0 -0
        nfields=$((nfields + 1))

Next error is here:
./tracetool: syntax error at line 53: `nfields=$' unexpected

#5 lore raw
Quoted 27 lines · Andreas Färber

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

Quoted 17 lines
Quoted 6 lines · Andreas Färber

Am 12.09.2010 um 19:22 schrieb Blue Swirl:

Quoted 1 line

What is the output of "sh ./tracetool --nop --check-backend"?

./tracetool: syntax error at line 51: `$' unexpected

Does this patch fix the problem?

tracetool +0 -0
index 534cc70..c7582bf 100755
@@ -48,7 +48,8 @@ get_argnames()
 {
Quoted 5 lines

   local nfields field name
   nfields=0
-    for field in $(get_args "$1"); do
+    args=get_args "$1"
+    for field in "$args"; do

This part yes. (I took the liberty of adding args to the local line above)

Quoted 4 lines
Quoted 1 line

       nfields=$((nfields + 1))

Next error is here:
./tracetool: syntax error at line 53: `nfields=$' unexpected

That looks like fully standards compliant, so Solaris' /bin/sh is not. Can you try what happens with /usr/xpg4/bin/sh?

#6 lore raw

Am 12.09.2010 um 23:05 schrieb Blue Swirl:

Quoted 9 lines

On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <[email protected]

Quoted 5 lines

wrote:
Am 12.09.2010 um 19:47 schrieb Blue Swirl:

Quoted 1 line
       nfields=$((nfields + 1))

./tracetool: syntax error at line 53: `nfields=$' unexpected

That looks like fully standards compliant, so Solaris' /bin/sh is not. Can you try what happens with /usr/xpg4/bin/sh?

Works fine! Must've done something wrong when testing that earlier today.

configure, create_config and tracetool with your fix are silent when /usr/xpg4/bin is in the $PATH. If you commit it, we can close this ticket. Thanks for your help, Blue.

Build still fails, in qemu-nbd.c due to err.h, but that's unrelated to /bin/sh. After disabling the tools in configure, sparc-softmmu builds fine again.

author
#7 lore raw
Quoted 11 lines · Andreas Färber

Am 12.09.2010 um 23:05 schrieb Blue Swirl:

Quoted 9 lines
Quoted 6 lines · Andreas Färber

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

Quoted 2 lines

      nfields=$((nfields + 1))

./tracetool: syntax error at line 53: `nfields=$' unexpected

Quoted 8 lines
Quoted 2 lines

That looks like fully standards compliant, so Solaris' /bin/sh is not. Can you try what happens with /usr/xpg4/bin/sh?

Works fine! Must've done something wrong when testing that earlier today.

configure, create_config and tracetool with your fix are silent when /usr/xpg4/bin is in the $PATH.
If you commit it, we can close this ticket. Thanks for your help, Blue.

Does /usr/xpg4/bin/sh work without the patch?

Signature · 43 lines
configure and build errors on Solaris 10 due to /bin/sh usage
https://bugs.launchpad.net/bugs/636315
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
Running `LANG=C LC_ALL=C ./configure --prefix=... --install=/usr/ucb/install` on Solaris 10 amd64 results in the following errors:

./configure: bad substitution
./configure: !: not found
./configure: curl-config: not found
./configure: curl-config: not found

Error: invalid trace backend
Please choose a supported trace backend.


Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for `install`.

The first few can be resolved by running `bash ./configure ...` instead. 

The "check if trace backend exists" hardcodes `sh "$source_path/tracetool" ...` in configure. Replacing sh with bash makes it work.

`gmake` complains "Makefile:331: no file name for -include", which is a filter for *.d files.
`create_config` gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works.
etc.

To sum it up,
a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and
b) hardcoding 'sh' in configure or Makefiles seems like a bad idea.

QEMU Git 73d7434279e3905164afd02360eebe4b43c7fa (ESP: fix ESP DMA access...)

$ uname -a
SunOS sonnengoettin 5.10 Generic_142901-03 i86pc i386 i86pc

# No banner output for /bin/sh

$ bash --version
GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.
#8 lore raw

Am 14.09.2010 um 18:34 schrieb Blue Swirl:

Quoted 17 lines

On Sun, Sep 12, 2010 at 10:02 PM, Andreas Färber <[email protected]

Quoted 16 lines

wrote:
Am 12.09.2010 um 23:05 schrieb Blue Swirl:

Quoted 12 lines

On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <[email protected]

Quoted 1 line
Quoted 6 lines · wrote:

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

Quoted 2 lines
      nfields=$((nfields + 1))

./tracetool: syntax error at line 53: `nfields=$' unexpected

That looks like fully standards compliant, so Solaris' /bin/sh is not. Can you try what happens with /usr/xpg4/bin/sh?

Quoted 7 lines
Quoted 5 lines

Works fine! Must've done something wrong when testing that earlier today.

configure, create_config and tracetool with your fix are silent when /usr/xpg4/bin is in the $PATH.
If you commit it, we can close this ticket. Thanks for your help, Blue.

Does /usr/xpg4/bin/sh work without the patch?

No.

#9 lore raw
Quoted 21 lines · Andreas Färber

Am 14.09.2010 um 18:34 schrieb Blue Swirl:

Quoted 19 lines
Quoted 17 lines · Andreas Färber

Am 12.09.2010 um 23:05 schrieb Blue Swirl:

Quoted 11 lines
Quoted 6 lines · Andreas Färber

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

Quoted 2 lines

     nfields=$((nfields + 1))

./tracetool: syntax error at line 53: `nfields=$' unexpected

That looks like fully standards compliant, so Solaris' /bin/sh is not. Can you try what happens with /usr/xpg4/bin/sh?

Works fine! Must've done something wrong when testing that earlier today.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

configure, create_config and tracetool with your fix are silent when /usr/xpg4/bin is in the $PATH.
If you commit it, we can close this ticket. Thanks for your help, Blue.

Does /usr/xpg4/bin/sh work without the patch?

No.

How about with the attached patch? If yes, does it work even with /bin/sh?

From ee69f0b1d14e1dde0559a6dfe598f652a42a75e7 Mon Sep 17 00:00:00 2001
From: Blue Swirl <[email protected]>
Date: Tue, 14 Sep 2010 20:50:34 +0000
Subject: [PATCH] trace: use older function call and expression syntax

Solaris' sh does not understand newer (while standards compliant) constructs like $() or $(()).

Use `` in place of $() and expr x in place of $((x)).

---
 tracetool |   50 +++++++++++++++++++++++++-------------------------
 1 files changed, 25 insertions(+), 25 deletions(-)
tracetool +25 -25
index 534cc70..1eedb9b 100755
@@ -48,8 +48,8 @@ get_argnames()
 {
     local nfields field name
     nfields=0
-    for field in $(get_args "$1"); do
-        nfields=$((nfields + 1))
+    for field in `get_args "$1"`; do
+        nfields=`expr nfields + 1`
 
         # Drop pointer star
         field=${field#\*}
@@ -73,8 +73,8 @@ get_argc()
 {
     local name argc
     argc=0
-    for name in $(get_argnames "$1"); do
-        argc=$((argc + 1))
+    for name in `get_argnames "$1"`; do
+        argc=`expr argc + 1`
     done
     echo $argc
 }
@@ -92,7 +92,7 @@ get_fmt()
 get_state()
 {
     local str disable state
-    str=$(get_name "$1")
+    str=`get_name "$1"`
     disable=${str##disable }
     if [ "$disable" = "$str" ] ; then
         state=1
@@ -110,8 +110,8 @@ linetoh_begin_nop()
 linetoh_nop()
 {
     local name args
-    name=$(get_name "$1")
-    args=$(get_args "$1")
+    name=`get_name "$1"`
+    args=`get_args "$1"`
 
     # Define an empty function for the trace event
     cat <<EOF
@@ -154,7 +154,7 @@ EOF
 cast_args_to_uint64_t()
 {
     local arg
-    for arg in $(get_argnames "$1"); do
+    for arg in `get_argnames "$1"`; do
         printf "%s" "(uint64_t)(uintptr_t)$arg"
     done
 }
@@ -162,10 +162,10 @@ cast_args_to_uint64_t()
 linetoh_simple()
 {
     local name args argc trace_args state
-    name=$(get_name "$1")
-    args=$(get_args "$1")
-    argc=$(get_argc "$1")
-    state=$(get_state "$1")
+    name=`get_name "$1"`
+    args=`get_args "$1"`
+    argc=`get_argc "$1"`
+    state=`get_state "$1"`
     if [ "$state" = "0" ]; then
         name=${name##disable }
     fi
@@ -173,7 +173,7 @@ linetoh_simple()
     trace_args="$simple_event_num"
     if [ "$argc" -gt 0 ]
     then
-        trace_args="$trace_args, $(cast_args_to_uint64_t "$1")"
+        trace_args="$trace_args, `cast_args_to_uint64_t "$1"`"
     fi
 
     cat <<EOF
@@ -183,7 +183,7 @@ static inline void trace_$name($args)
 }
 EOF
 
-    simple_event_num=$((simple_event_num + 1))
+    simple_event_num=`expr simple_event_num + 1`
 }
 
 linetoh_end_simple()
@@ -208,15 +208,15 @@ EOF
 linetoc_simple()
 {
     local name state
-    name=$(get_name "$1")
-    state=$(get_state "$1")
+    name=`get_name "$1"`
+    state=`get_state "$1"`
     if [ "$state" = "0" ] ; then
         name=${name##disable }
     fi
     cat <<EOF
 {.tp_name = "$name", .state=$state},
 EOF
-    simple_event_num=$((simple_event_num + 1))
+    simple_event_num=`expr simple_event_num + 1`
 }
 
 linetoc_end_simple()
@@ -245,9 +245,9 @@ linetoh_begin_ust()
 linetoh_ust()
 {
     local name args argnames
-    name=$(get_name "$1")
-    args=$(get_args "$1")
-    argnames=$(get_argnames "$1")
+    name=`get_name "$1"`
+    args=`get_args "$1"`
+    argnames=`get_argnames "$1"`
 
     cat <<EOF
 DECLARE_TRACE(ust_$name, TPPROTO($args), TPARGS($argnames));
@@ -264,7 +264,7 @@ linetoc_begin_ust()
 {
     cat <<EOF
 #include <ust/marker.h>
-$(ust_clean_namespace)
+`ust_clean_namespace`
 #include "trace.h"
 EOF
 }
@@ -272,10 +272,10 @@ EOF
 linetoc_ust()
 {
     local name args argnames fmt
-    name=$(get_name "$1")
-    args=$(get_args "$1")
-    argnames=$(get_argnames "$1")
-    fmt=$(get_fmt "$1")
+    name=`get_name "$1"`
+    args=`get_args "$1"`
+    argnames=`get_argnames "$1"`
+    fmt=`get_fmt "$1"`
 
     cat <<EOF
 DEFINE_TRACE(ust_$name);
Signature · 1 line
1.5.6.5
#10 lore raw

Am 14.09.2010 um 22:53 schrieb Blue Swirl:

Quoted 1 line

How about with the attached patch? If yes, does it work even with /bin/sh?

LC_ALL=C /usr/xpg4/bin/sh ./tracetool --nop --check-backend

works fine,

LC_ALL=C sh ./tracetool --nop --check-backend
./tracetool: bad substitution

#11 lore raw
In reply to Blue Swirl
Quoted 14 lines · Blue Swirl
Quoted 13 lines · Andreas Färber

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

Quoted 11 lines
Quoted 6 lines · Andreas Färber

Am 12.09.2010 um 19:22 schrieb Blue Swirl:

Quoted 1 line

What is the output of "sh ./tracetool --nop --check-backend"?

./tracetool: syntax error at line 51: `$' unexpected

Does this patch fix the problem?

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
tracetool +0 -0
index 534cc70..c7582bf 100755
@@ -48,7 +48,8 @@ get_argnames()
Quoted 8 lines

tracetool get_argnames() · line 52

Quoted 6 lines
tracetool +2 -1
 {
   local nfields field name
   nfields=0
-    for field in $(get_args "$1"); do
+    args=get_args "$1"
+    for field in "$args"; do

This part yes. (I took the liberty of adding args to the local line above)

Um. Are you sure it works as expected? I'm not at all shure. There are 2 errors in the above patch:

+ args=get_args "$1"

After this line, variable $args will contain one word: "get_args". Shell will try to execute a command or call a shell function which name is stored in $1, if it is assigned. If it is not, at least bash will complain that it can't execute command "".

The proper way is to add backticks:

+ args=get_args "$1"

In the second line:

+ for field in "$args"; do

the double quotes ensure that all words in $args are processed as single word, all at once. So the for loop will be executed exactly one time, no matter how many arguments are given (even if there's none).

So the right solution is to drop double quotes.

JFYI.

/mjt

#12 lore raw

Am 13.09.2010 um 10:49 schrieb Michael Tokarev:

Quoted 19 lines
Quoted 17 lines · Blue Swirl

On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <[email protected]

Quoted 16 lines

wrote:
Am 12.09.2010 um 19:47 schrieb Blue Swirl:

tracetool get_argnames() · line 52

Quoted 11 lines
tracetool +2 -1
index 534cc70..c7582bf 100755
@@ -48,7 +48,8 @@ get_argnames()
 {
  local nfields field name
  nfields=0
-    for field in $(get_args "$1"); do
+    args=get_args "$1"
+    for field in "$args"; do

This part yes. (I took the liberty of adding args to the local line above)

Quoted 1 line

Um. Are you sure it works as expected?

No, I'm not sure. It's Dark Magic to me and happened to unbreak configure; I'll try out your suggestions the next days.

Thanks,
Andreas

Quoted 29 lines

I'm not at all shure.
There are 2 errors in the above patch:

+ args=get_args "$1"

After this line, variable $args will contain one word: "get_args". Shell will try to execute a command or call a shell function which name is stored in $1, if it is assigned. If it is not, at least bash will complain that it can't execute command "".

The proper way is to add backticks:

+ args=get_args "$1"

In the second line:

+ for field in "$args"; do

the double quotes ensure that all words in $args are processed as single word, all at once. So the for loop will be executed exactly one time, no matter how many arguments are given (even if there's none).

So the right solution is to drop double quotes.

JFYI.

/mjt

#13 lore raw
In reply to Michael Tokarev
Quoted 45 lines · Michael Tokarev
Quoted 14 lines · Blue Swirl
Quoted 13 lines · Andreas Färber

Am 12.09.2010 um 19:47 schrieb Blue Swirl:

Quoted 11 lines
Quoted 6 lines · Andreas Färber

Am 12.09.2010 um 19:22 schrieb Blue Swirl:

Quoted 1 line

What is the output of "sh ./tracetool --nop --check-backend"?

./tracetool: syntax error at line 51: `$' unexpected

Does this patch fix the problem?

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
tracetool +0 -0
index 534cc70..c7582bf 100755
@@ -48,7 +48,8 @@ get_argnames()
Quoted 8 lines
Quoted 6 lines
tracetool +0 -0
 {

   local nfields field name
   nfields=0
-    for field in $(get_args "$1"); do
+    args=get_args "$1"
+    for field in "$args"; do

This part yes. (I took the liberty of adding args to the local line above)

Um.  Are you sure it works as expected?  I'm not at all shure. There are 2 errors in the above patch:

 +    args=get_args "$1"

After this line, variable $args will contain one word: "get_args". Shell will try to execute a command or call a shell function which name is stored in $1, if it is assigned.  If it is not, at least bash will complain that it can't execute command "".

The proper way is to add backticks:

 +    args=get_args "$1"

In the second line:

Quoted 8 lines

 +    for field in "$args"; do

the double quotes ensure that all words in $args are processed as single word, all at once.  So the for loop will be executed exactly one time, no matter how many arguments are given (even if there's none).

So the right solution is to drop double quotes.

Do you see any bug with the original?

If the problem is in fact that Solaris' /bin/sh is not standards compliant, we shouldn't fix the script but instead make sure that the shell used to run tracetool is the compliant one.

#14 lore raw
Quoted 1 line · blueswirl

On Mon, Sep 13, 2010 at 8:49 AM, Michael Tokarev <[email protected]> wrote:

[]

Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 13 lines

tracetool get_argnames() · line 52

Quoted 11 lines
tracetool +2 -1
index 534cc70..c7582bf 100755
@@ -48,7 +48,8 @@ get_argnames()
 {
   local nfields field name
   nfields=0
-    for field in $(get_args "$1"); do
+    args=get_args "$1"
+    for field in "$args"; do

This part yes. (I took the liberty of adding args to the local line above)

Quoted 2 lines
Quoted 2 lines

Um. Are you sure it works as expected? I'm not at all shure. There are 2 errors in the above patch:

[]

Quoted 1 line

Do you see any bug with the original?

The thing is - I've no idea what's the talk about. There's no mentions of tracetool in 0.13.0-rc1 tarball.

Quoted 3 lines

If the problem is in fact that Solaris' /bin/sh is not standards compliant, we shouldn't fix the script but instead make sure that the shell used to run tracetool is the compliant one.

Solaris's /bin/sh isn't exactly non-standard-compliant, it's very limited. In particular, $() construct weren't in the standard for quite some time, and I'm not sure it is now.

The usual idiom is to use backticks `` for this. Only in case of nested subshells or using case..esac (with closing brases for individual cases) standard backticks does not work.

/mjt

#15 lore raw
In reply to Andreas Färber

The shell-based tracetool has been replace in commit 650ab98d1d9551f0ca21 with a script that has been implemented in Python, so I think we can close this bug nowadays.

** Changed in: qemu
Status: New => Fix Released

Signature · 55 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/636315

Title:
  configure and build errors on Solaris 10 due to /bin/sh usage

Status in QEMU:
  Fix Released

Bug description:
  Running `LANG=C LC_ALL=C ./configure --prefix=...
  --install=/usr/ucb/install` on Solaris 10 amd64 results in the
  following errors:

  ./configure: bad substitution
  ./configure: !: not found
  ./configure: curl-config: not found
  ./configure: curl-config: not found

  Error: invalid trace backend
  Please choose a supported trace backend.

  
  Unfortunately it doesn't print the line numbers of the errors. It must be somewhere after the check for `install`.

  The first few can be resolved by running `bash ./configure ...`
  instead.

  The "check if trace backend exists" hardcodes `sh
  "$source_path/tracetool" ...` in configure. Replacing sh with bash
  makes it work.

  `gmake` complains "Makefile:331: no file name for -include", which is a filter for *.d files.
  `create_config` gets the 'bad substitution' error as well. Replacing sh with bash in rules.mak works.
  etc.

  To sum it up,
  a) there are shell script incompatibilities with Solaris 10's /bin/sh shell, and
  b) hardcoding 'sh' in configure or Makefiles seems like a bad idea.

  QEMU Git 73d7434279e3905164afd02360eebe4b43c7fa (ESP: fix ESP DMA
  access...)

  $ uname -a
  SunOS sonnengoettin 5.10 Generic_142901-03 i86pc i386 i86pc

  # No banner output for /bin/sh

  $ bash --version
  GNU bash, version 3.00.16(1)-release (i386-pc-solaris2.10)
  Copyright (C) 2004 Free Software Foundation, Inc.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/636315/+subscriptions