From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LjfJG-0008Lt-H9 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 15:50:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LjfJC-0008IZ-2d for qemu-devel@nongnu.org; Tue, 17 Mar 2009 15:50:45 -0400 Received: from [199.232.76.173] (port=54411 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LjfJB-0008IW-Q8 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 15:50:41 -0400 Received: from mx.freeshell.org ([192.94.73.19]:52592 helo=sdf.lonestar.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LjfJB-000555-7W for qemu-devel@nongnu.org; Tue, 17 Mar 2009 15:50:41 -0400 Received: from sdf.lonestar.org (IDENT:palle@otaku.freeshell.org [192.94.73.2]) by sdf.lonestar.org (8.14.3/8.13.8) with ESMTP id n2HJbF5Z000963 for ; Tue, 17 Mar 2009 19:37:15 GMT Date: Tue, 17 Mar 2009 19:37:14 +0000 (UTC) From: Palle Lyckegaard Subject: Re: [Qemu-devel] [PATCH] Get sh right on OpenSolaris/SPARC In-Reply-To: <49AEFBF3.2020509@codemonkey.ws> Message-ID: References: <49AEFBF3.2020509@codemonkey.ws> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, 4 Mar 2009, Anthony Liguori wrote: > Date: Wed, 04 Mar 2009 16:08:51 -0600 > From: Anthony Liguori > Reply-To: qemu-devel@nongnu.org > To: qemu-devel@nongnu.org > Subject: Re: [Qemu-devel] [PATCH] Get sh right on OpenSolaris/SPARC > > Palle Lyckegaard wrote: >> >> The patch below solves a problem when building qemu on OpenSolaris/SPARC. >> >> "feature_to_c.sh: test: argument expected" >> >> There seemes to be a problem with how "features_to_c.sh" is started from >> the makefile. On Solaris the shell in /bin/sh is not standards compliant >> according to http://docs.sun.com/app/docs/doc/816-5165/sh-1?a=view so the >> patch fixes the configure script so a proper sh in located in /usr/xpg4/bin >> when building on OpenSolaris. Other platforms defaults to whatever is in >> the path when configure is running. >> >> Please consider this patch so qemu builds out-of-the-box for OpenSolaris... > > Why not change: > > test -z "$output" > > to > > test "x$output" = "x" > > Which I believe is a pretty common way to work around this problem. > > Regards, > > Anthony Liguori Hi, The following patch fixes the feature_to_c.sh problems encountered on Solaris. Tested on Ubuntu Linux as well... Please consider applying the patch... Regards Palle Index: feature_to_c.sh =================================================================== --- feature_to_c.sh (revision 6858) +++ feature_to_c.sh (working copy) @@ -24,17 +24,17 @@ output=$1 shift -if test -z "$output" || test -z "$1"; then +if test "x$output" = "x" || test "x$1" = "x"; then echo "Usage: $0 OUTPUTFILE INPUTFILE..." exit 1 fi -if test -e "$output"; then +if test -f "$output"; then echo "Output file \"$output\" already exists; refusing to overwrite." exit 1 fi -for input; do +for input do arrayname=xml_feature_`echo $input | sed 's,.*/,,; s/[-.]/_/g'` ${AWK:-awk} 'BEGIN { n = 0 @@ -68,7 +68,7 @@ echo "extern const char *const xml_builtin[][2];" >> $output echo "const char *const xml_builtin[][2] = {" >> $output -for input; do +for input do basename=`echo $input | sed 's,.*/,,'` arrayname=xml_feature_`echo $input | sed 's,.*/,,; s/[-.]/_/g'` echo " { \"$basename\", $arrayname }," >> $output > >> Best regards >> Palle >> >> ------ start of patch >> >> Index: configure >> =================================================================== >> --- configure (revision 6657) >> +++ configure (working copy) >> @@ -34,6 +34,7 @@ >> make="make" >> install="install" >> strip="strip" >> +shell="`which sh`" >> >> # parse CC options first >> for opt do >> @@ -263,6 +264,7 @@ >> SunOS) >> solaris="yes" >> make="gmake" >> + shell="/usr/xpg4/bin/sh" >> install="ginstall" >> needs_libsunmath="no" >> solarisrev=`uname -r | cut -f2 -d.` >> @@ -1178,6 +1180,7 @@ >> echo "INSTALL=$install" >> $config_mak >> echo "CC=$cc" >> $config_mak >> echo "HOST_CC=$host_cc" >> $config_mak >> +echo "SHELL=$shell" >> $config_mak >> echo "AR=$ar" >> $config_mak >> echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak >> # XXX: only use CFLAGS and LDFLAGS ? >> >> >> ------ end of patch >> >> >> > > > >