qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Patch to make configure /bin/sh compatible
@ 2006-04-14 15:57 Ben Taylor
  2006-04-14 17:22 ` Thiemo Seufer
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Taylor @ 2006-04-14 15:57 UTC (permalink / raw)
  To: Qemu-devel

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

This is a patch to make configure truly /bin/sh compatible,
as well as changing some logic to remove "echo -n" for
output to files, as "echo -n" is not consistent among
environments.

This is against the latest cvs branch, and I appreciate
any feedback.

Ben

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: configure.qemu-snapshot-2006-04-12_23.patch --]
[-- Type: text/x-patch; name="configure.qemu-snapshot-2006-04-12_23.patch", Size: 5714 bytes --]

--- configure.ORIG	2006-04-14 10:26:38.028745000 -0400
+++ configure	2006-04-14 11:47:28.766258000 -0400
@@ -133,7 +133,7 @@
 esac
 
 if [ "$bsd" = "yes" ] ; then
-  if [ ! "$darwin" = "yes" ] ; then
+  if [ "$darwin" != "yes" ] ; then
     make="gmake"
   fi
 fi
@@ -141,39 +141,40 @@
 # find source path
 # XXX: we assume an absolute path is given when launching configure,
 # except in './configure' case.
-source_path=${0%configure}
-source_path=${source_path%/}
+source_path=`dirname $0`
 source_path_used="yes"
 if test -z "$source_path" -o "$source_path" = "." ; then
     source_path=`pwd`
     source_path_used="no"
 fi
 
+
 for opt do
+  optarg=`expr "$opt" : '[^=]*=\(.*\)'`
   case "$opt" in
   --help|-h) show_help=yes
   ;;
-  --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
+  --prefix=*) prefix="$optarg"
   ;;
-  --interp-prefix=*) interp_prefix=`echo $opt | cut -d '=' -f 2`
+  --interp-prefix=*) interp_prefix="$optarg"
   ;;
-  --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
+  --source-path=*) source_path="$optarg"
   ;;
-  --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
+  --cross-prefix=*) cross_prefix="$optarg"
   ;;
-  --cc=*) cc=`echo $opt | cut -d '=' -f 2`
+  --cc=*) cc="$optarg"
   ;;
-  --host-cc=*) host_cc=`echo $opt | cut -d '=' -f 2`
+  --host-cc=*) host_cc="$optarg"
   ;;
-  --make=*) make=`echo $opt | cut -d '=' -f 2`
+  --make=*) make="$optarg"
   ;;
-  --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
+  --extra-cflags=*) CFLAGS="$optarg"
   ;;
-  --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}"
+  --extra-ldflags=*) LDFLAGS="$optarg"
   ;;
-  --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
+  --cpu=*) cpu="$optarg"
   ;;
-  --target-list=*) target_list=${opt#--target-list=}
+  --target-list=*) target_list="$optarg"
   ;;
   --enable-gprof) gprof="yes"
   ;;
@@ -189,9 +190,9 @@
   ;;
   --enable-fmod) fmod="yes"
   ;;
-  --fmod-lib=*) fmod_lib=${opt#--fmod-lib=}
+  --fmod-lib=*) fmod_lib="$optarg"
   ;;
-  --fmod-inc=*) fmod_inc=${opt#--fmod-inc=}
+  --fmod-inc=*) fmod_inc="$optarg"
   ;;
   --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
   ;;
@@ -203,7 +204,7 @@
   ;;
   --enable-profiler) profiler="yes"
   ;;
-  --kernel-path=*) kernel_path=${opt#--kernel-path=}
+  --kernel-path=*) kernel_path="$optarg"
   ;;
   --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
   ;;
@@ -294,7 +295,7 @@
         target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
     fi
 else
-    target_list=$(echo "$target_list" | sed -e 's/,/ /g')
+    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
 fi
 if test -z "$target_list" ; then
     echo "No targets enabled"
@@ -348,12 +349,12 @@
 # Check for gcc4
 if test "$check_gcc" = "yes" ; then
     cat > $TMPC <<EOF
-#if __GNUC__ >= 4
+#if __GNUC__ < 4
 #error gcc4
 #endif
 int main(){return 0;}
 EOF
-    if ! $cc -o $TMPO $TMPC 2>/dev/null ; then
+    if $cc -o $TMPO $TMPC 2>/dev/null ; then
         echo "ERROR: \"$cc\" looks like gcc 4.x"
         echo "QEMU is known to have problems when compiled with gcc 4.x"
         echo "It is recommended that you use gcc 3.x to build QEMU"
@@ -460,7 +461,6 @@
 echo "CoreAudio support $coreaudio"
 echo "ALSA support      $alsa"
 echo "DSound support    $dsound"
-echo -n "FMOD support      $fmod"
 if test "$fmod" = "yes"; then
     if test -z $fmod_lib || test -z $fmod_inc; then
         echo
@@ -469,8 +469,11 @@
         echo
         exit 1
     fi
-    echo -n " (lib='$fmod_lib' include='$fmod_inc')"
+    fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
+else
+    fmod_support=""
 fi
+echo "FMOD support      $fmod $fmod_support"
 echo ""
 echo "kqemu support     $kqemu"
 
@@ -480,7 +483,6 @@
 #if test "$sdl_static" = "no"; then
 #  echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
 #fi
-
 config_mak="config-host.mak"
 config_h="config-host.h"
 
@@ -607,12 +609,12 @@
   echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
   echo "#define CONFIG_FMOD 1" >> $config_h
 fi
-echo -n "VERSION=" >>$config_mak
-head $source_path/VERSION >>$config_mak
-echo "" >>$config_mak
-echo -n "#define QEMU_VERSION \"" >> $config_h
-head $source_path/VERSION >> $config_h
-echo "\"" >> $config_h
+echo "VERSION=`head $source_path/VERSION`" >>$config_mak
+#head $source_path/VERSION >>$config_mak
+#echo "" >>$config_mak
+echo "#define QEMU_VERSION \"`head $source_path/VERSION`\"" >> $config_h
+#head $source_path/VERSION >> $config_h
+#echo "\"" >> $config_h
 
 echo "SRC_PATH=$source_path" >> $config_mak
 echo "TARGET_DIRS=$target_list" >> $config_mak
@@ -625,7 +627,6 @@
 fi
 
 for target in $target_list; do
-
 target_dir="$target"
 config_mak=$target_dir/config.mak
 config_h=$target_dir/config.h
@@ -750,16 +751,15 @@
     if test "$sdl1" = "yes" ; then
         echo "#define CONFIG_SDL 1" >> $config_h
         echo "CONFIG_SDL=yes" >> $config_mak
+        SDL_CFLAGS=" SDL_CFLAGS=`$sdl_config --cflags`"
+        if [ "${aa}" = "yes" ] ; then
+            SDL_CFLAGS="$SDL_CFLAGS `aalib-config --cflags`"
+        fi
         if test "$target_softmmu" = "no" -o "$static" = "yes"; then
-            echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
+            echo "SDL_LIBS=$sdl_static_libs $SDL_CFLAGS`" >> $config_mak
         else
-            echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
-        fi
-        echo -n "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
-        if [ "${aa}" = "yes" ] ; then
-            echo -n " `aalib-config --cflags`" >> $config_mak ;
+            echo "SDL_LIBS=`$sdl_config --libs` $SDL_CFLAGS" >> $config_mak
         fi
-        echo "" >> $config_mak
     fi
 fi
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Patch to make configure /bin/sh compatible
  2006-04-14 15:57 [Qemu-devel] Patch to make configure /bin/sh compatible Ben Taylor
@ 2006-04-14 17:22 ` Thiemo Seufer
  2006-04-14 17:38   ` Michael McConnell
  2006-04-14 17:39   ` Anderson Lizardo
  0 siblings, 2 replies; 6+ messages in thread
From: Thiemo Seufer @ 2006-04-14 17:22 UTC (permalink / raw)
  To: sol10x86, qemu-devel

Ben Taylor wrote:
> This is a patch to make configure truly /bin/sh compatible,
> as well as changing some logic to remove "echo -n" for
> output to files, as "echo -n" is not consistent among
> environments.
> 
> This is against the latest cvs branch, and I appreciate
> any feedback.

[snip]
> @@ -294,7 +295,7 @@
>          target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
>      fi
>  else
> -    target_list=$(echo "$target_list" | sed -e 's/,/ /g')
> +    target_list=`echo "$target_list" | sed -e 's/,/ /g'`

A standard-conforming /bin/sh should be capable of handling this.

>  fi
>  if test -z "$target_list" ; then
>      echo "No targets enabled"
> @@ -348,12 +349,12 @@
>  # Check for gcc4
>  if test "$check_gcc" = "yes" ; then
>      cat > $TMPC <<EOF
> -#if __GNUC__ >= 4
> +#if __GNUC__ < 4
>  #error gcc4
>  #endif
>  int main(){return 0;}
>  EOF
> -    if ! $cc -o $TMPO $TMPC 2>/dev/null ; then
> +    if $cc -o $TMPO $TMPC 2>/dev/null ; then
>          echo "ERROR: \"$cc\" looks like gcc 4.x"
>          echo "QEMU is known to have problems when compiled with gcc 4.x"
>          echo "It is recommended that you use gcc 3.x to build QEMU"

This looks weird, to error out if gcc is a good version. Wouldn't
something like

gcc -dM -E -xc /dev/null |awk '{ if (/__GNUC__/) print $3 }'

be simpler to find out the gcc major version?


Thiemo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Patch to make configure /bin/sh compatible
  2006-04-14 17:22 ` Thiemo Seufer
@ 2006-04-14 17:38   ` Michael McConnell
  2006-04-14 17:39   ` Anderson Lizardo
  1 sibling, 0 replies; 6+ messages in thread
From: Michael McConnell @ 2006-04-14 17:38 UTC (permalink / raw)
  To: qemu-devel

On Fri, 14 Apr 2006, Thiemo Seufer wrote:

> Ben Taylor wrote:
> > This is a patch to make configure truly /bin/sh compatible,
> > as well as changing some logic to remove "echo -n" for
> > output to files, as "echo -n" is not consistent among
> > environments.
> > 
> > This is against the latest cvs branch, and I appreciate
> > any feedback.
> 
> [snip]
> > @@ -294,7 +295,7 @@
> >          target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
> >      fi
> >  else
> > -    target_list=$(echo "$target_list" | sed -e 's/,/ /g')
> > +    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
> 
> A standard-conforming /bin/sh should be capable of handling this.

I've seen various /bin/sh (and ksh) versions that will accept the `....` form 
but not the $(...) form.  It's bitten me a few times too.

-- Michael "Soruk" McConnell
   Eridani Star System

   MailStripper - http://mailstripper.eridani.co.uk/ - SMTP spam filter
   Mail Me Anywhere - http://www.MailMeAnywhere.com/ - Mobile email

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Patch to make configure /bin/sh compatible
  2006-04-14 17:22 ` Thiemo Seufer
  2006-04-14 17:38   ` Michael McConnell
@ 2006-04-14 17:39   ` Anderson Lizardo
  1 sibling, 0 replies; 6+ messages in thread
From: Anderson Lizardo @ 2006-04-14 17:39 UTC (permalink / raw)
  To: qemu-devel

On 4/14/06, Thiemo Seufer <ths@networkno.de> wrote:
> gcc -dM -E -xc /dev/null |awk '{ if (/__GNUC__/) print $3 }'

Or even simpler:

 gcc -dM -E -xc /dev/null | awk '/__GNUC__/{print $3}'

Regards,
--
Anderson Lizardo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Patch to make configure /bin/sh compatible
  2006-04-14 17:43 Ben Taylor
@ 2006-04-14 17:57 ` Thiemo Seufer
  0 siblings, 0 replies; 6+ messages in thread
From: Thiemo Seufer @ 2006-04-14 17:57 UTC (permalink / raw)
  To: Ben Taylor; +Cc: qemu-devel

Ben Taylor wrote:
> Thiemo Seufer <ths@networkno.de>
> > 
> > Ben Taylor wrote:
> > > This is a patch to make configure truly /bin/sh compatible,
> > > as well as changing some logic to remove "echo -n" for
> > > output to files, as "echo -n" is not consistent among
> > > environments.
> > > 
> > > This is against the latest cvs branch, and I appreciate
> > > any feedback.
> > 
> > [snip]
> > > @@ -294,7 +295,7 @@
> > >          target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
> > >      fi
> > >  else
> > > -    target_list=$(echo "$target_list" | sed -e 's/,/ /g')
> > > +    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
> > 
> > A standard-conforming /bin/sh should be capable of handling this.
> 
> do you mean a shell that looks like /bin/sh but is really
> more like ksh or bash.  Solaris /bin/sh did not like
> that construct.

I meant
http://www.opengroup.org/onlinepubs/007908799/xcu/chap2.html#tag_001_006_003
which IIRC looks that way since POSIX times.

Apparently Solaris isn't conformant WRT.


Thiemo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Patch to make configure /bin/sh compatible
       [not found] <BAY0-MC6-F17UW5RmrG0011a6d8@bay0-mc6-f17.bay0.hotmail.com>
@ 2006-04-20 15:08 ` Nathan Kunkee
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan Kunkee @ 2006-04-20 15:08 UTC (permalink / raw)
  To: qemu-devel

Solaris 10 does have standards complaint shells. The problem is finding 
them. :-7
Check out 'man standards' or this link: 
http://docs.sun.com/app/docs/doc/816-5175/6mbba7f3v?a=view
In the utilities section it discusses which shells exist on the system, and 
which standards they support.

I found I had the best luck with /bin/xpg4/sh for configure.

Nathan

------------------------------

Message: 6
Date: Fri, 14 Apr 2006 18:38:27 +0100 (BST)
From: Michael McConnell <soruk@eridani.co.uk>
Subject: Re: [Qemu-devel] Patch to make configure /bin/sh compatible
To: qemu-devel@nongnu.org
Message-ID:
	<Pine.LNX.4.44.0604141837110.32560-100000@zeskia.int.eridani.co.uk>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Fri, 14 Apr 2006, Thiemo Seufer wrote:

 > Ben Taylor wrote:
 > > This is a patch to make configure truly /bin/sh compatible,
 > > as well as changing some logic to remove "echo -n" for
 > > output to files, as "echo -n" is not consistent among
 > > environments.
 > >
 > > This is against the latest cvs branch, and I appreciate
 > > any feedback.
 >
 > [snip]
 > > @@ -294,7 +295,7 @@
 > >          target_list="i386-user arm-user armeb-user sparc-user ppc-user 
mips-user mipsel-user $target_list"
 > >      fi
 > >  else
 > > -    target_list=$(echo "$target_list" | sed -e 's/,/ /g')
 > > +    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
 >
 > A standard-conforming /bin/sh should be capable of handling this.

I've seen various /bin/sh (and ksh) versions that will accept the `....` 
form
but not the $(...) form.  It's bitten me a few times too.

-- Michael "Soruk" McConnell
    Eridani Star System

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-04-20 15:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-14 15:57 [Qemu-devel] Patch to make configure /bin/sh compatible Ben Taylor
2006-04-14 17:22 ` Thiemo Seufer
2006-04-14 17:38   ` Michael McConnell
2006-04-14 17:39   ` Anderson Lizardo
  -- strict thread matches above, loose matches on Subject: below --
2006-04-14 17:43 Ben Taylor
2006-04-14 17:57 ` Thiemo Seufer
     [not found] <BAY0-MC6-F17UW5RmrG0011a6d8@bay0-mc6-f17.bay0.hotmail.com>
2006-04-20 15:08 ` Nathan Kunkee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).