Commit b1a550a0da91d0b14e9202f1f5a84c4a920d5812

Authored by pbrook
1 parent 0f8134bf

Remove non-portable code from configure.

Allow newline at end of VERSION file.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1816 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 33 additions and 35 deletions
1 -0.8.0  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +0.8.0
configure
@@ -83,6 +83,7 @@ alsa="no" @@ -83,6 +83,7 @@ alsa="no"
83 fmod="no" 83 fmod="no"
84 fmod_lib="" 84 fmod_lib=""
85 fmod_inc="" 85 fmod_inc=""
  86 +bsd="no"
86 linux="no" 87 linux="no"
87 kqemu="no" 88 kqemu="no"
88 profiler="no" 89 profiler="no"
@@ -133,7 +134,7 @@ fi @@ -133,7 +134,7 @@ fi
133 esac 134 esac
134 135
135 if [ "$bsd" = "yes" ] ; then 136 if [ "$bsd" = "yes" ] ; then
136 - if [ ! "$darwin" = "yes" ] ; then 137 + if [ "$darwin" != "yes" ] ; then
137 make="gmake" 138 make="gmake"
138 fi 139 fi
139 fi 140 fi
@@ -152,31 +153,32 @@ else @@ -152,31 +153,32 @@ else
152 fi 153 fi
153 154
154 for opt do 155 for opt do
  156 + optarg=`expr "$opt" : '[^=]*=\(.*\)'`
155 case "$opt" in 157 case "$opt" in
156 --help|-h) show_help=yes 158 --help|-h) show_help=yes
157 ;; 159 ;;
158 - --prefix=*) prefix=`echo $opt | cut -d '=' -f 2` 160 + --prefix=*) prefix="$optarg"
159 ;; 161 ;;
160 - --interp-prefix=*) interp_prefix=`echo $opt | cut -d '=' -f 2` 162 + --interp-prefix=*) interp_prefix="$optarg"
161 ;; 163 ;;
162 - --source-path=*) source_path=`echo $opt | cut -d '=' -f 2` 164 + --source-path=*) source_path="$optarg"
163 source_path_used="yes" 165 source_path_used="yes"
164 ;; 166 ;;
165 - --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` 167 + --cross-prefix=*) cross_prefix="$optarg"
166 ;; 168 ;;
167 - --cc=*) cc=`echo $opt | cut -d '=' -f 2` 169 + --cc=*) cc="$optarg"
168 ;; 170 ;;
169 - --host-cc=*) host_cc=`echo $opt | cut -d '=' -f 2` 171 + --host-cc=*) host_cc="$optarg"
170 ;; 172 ;;
171 - --make=*) make=`echo $opt | cut -d '=' -f 2` 173 + --make=*) make="$optarg"
172 ;; 174 ;;
173 - --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}" 175 + --extra-cflags=*) CFLAGS="$optarg"
174 ;; 176 ;;
175 - --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}" 177 + --extra-ldflags=*) LDFLAGS="$optarg"
176 ;; 178 ;;
177 - --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` 179 + --cpu=*) cpu="$optarg"
178 ;; 180 ;;
179 - --target-list=*) target_list=${opt#--target-list=} 181 + --target-list=*) target_list="$optarg"
180 ;; 182 ;;
181 --enable-gprof) gprof="yes" 183 --enable-gprof) gprof="yes"
182 ;; 184 ;;
@@ -192,9 +194,9 @@ for opt do @@ -192,9 +194,9 @@ for opt do
192 ;; 194 ;;
193 --enable-fmod) fmod="yes" 195 --enable-fmod) fmod="yes"
194 ;; 196 ;;
195 - --fmod-lib=*) fmod_lib=${opt#--fmod-lib=} 197 + --fmod-lib=*) fmod_lib="$optarg"
196 ;; 198 ;;
197 - --fmod-inc=*) fmod_inc=${opt#--fmod-inc=} 199 + --fmod-inc=*) fmod_inc="$optarg"
198 ;; 200 ;;
199 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" 201 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
200 ;; 202 ;;
@@ -206,7 +208,7 @@ for opt do @@ -206,7 +208,7 @@ for opt do
206 ;; 208 ;;
207 --enable-profiler) profiler="yes" 209 --enable-profiler) profiler="yes"
208 ;; 210 ;;
209 - --kernel-path=*) kernel_path=${opt#--kernel-path=} 211 + --kernel-path=*) kernel_path="$optarg"
210 ;; 212 ;;
211 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no" 213 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
212 ;; 214 ;;
@@ -297,7 +299,7 @@ if test -z "$target_list" ; then @@ -297,7 +299,7 @@ if test -z "$target_list" ; then
297 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list" 299 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
298 fi 300 fi
299 else 301 else
300 - target_list=$(echo "$target_list" | sed -e 's/,/ /g') 302 + target_list=`echo "$target_list" | sed -e 's/,/ /g'`
301 fi 303 fi
302 if test -z "$target_list" ; then 304 if test -z "$target_list" ; then
303 echo "No targets enabled" 305 echo "No targets enabled"
@@ -348,15 +350,15 @@ if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/nu @@ -348,15 +350,15 @@ if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/nu
348 have_gcc3_options="yes" 350 have_gcc3_options="yes"
349 fi 351 fi
350 352
351 -# Check for gcc4 353 +# Check for gcc4, error if pre-gcc4
352 if test "$check_gcc" = "yes" ; then 354 if test "$check_gcc" = "yes" ; then
353 cat > $TMPC <<EOF 355 cat > $TMPC <<EOF
354 -#if __GNUC__ >= 4  
355 -#error gcc4 356 +#if __GNUC__ < 4
  357 +#error gcc3
356 #endif 358 #endif
357 int main(){return 0;} 359 int main(){return 0;}
358 EOF 360 EOF
359 - if ! $cc -o $TMPO $TMPC 2>/dev/null ; then 361 + if $cc -o $TMPO $TMPC 2>/dev/null ; then
360 echo "ERROR: \"$cc\" looks like gcc 4.x" 362 echo "ERROR: \"$cc\" looks like gcc 4.x"
361 echo "QEMU is known to have problems when compiled with gcc 4.x" 363 echo "QEMU is known to have problems when compiled with gcc 4.x"
362 echo "It is recommended that you use gcc 3.x to build QEMU" 364 echo "It is recommended that you use gcc 3.x to build QEMU"
@@ -463,7 +465,6 @@ echo &quot;Adlib support $adlib&quot; @@ -463,7 +465,6 @@ echo &quot;Adlib support $adlib&quot;
463 echo "CoreAudio support $coreaudio" 465 echo "CoreAudio support $coreaudio"
464 echo "ALSA support $alsa" 466 echo "ALSA support $alsa"
465 echo "DSound support $dsound" 467 echo "DSound support $dsound"
466 -echo -n "FMOD support $fmod"  
467 if test "$fmod" = "yes"; then 468 if test "$fmod" = "yes"; then
468 if test -z $fmod_lib || test -z $fmod_inc; then 469 if test -z $fmod_lib || test -z $fmod_inc; then
469 echo 470 echo
@@ -472,9 +473,11 @@ if test &quot;$fmod&quot; = &quot;yes&quot;; then @@ -472,9 +473,11 @@ if test &quot;$fmod&quot; = &quot;yes&quot;; then
472 echo 473 echo
473 exit 1 474 exit 1
474 fi 475 fi
475 - echo -n " (lib='$fmod_lib' include='$fmod_inc')" 476 + fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
  477 +else
  478 + fmod_support=""
476 fi 479 fi
477 -echo "" 480 +echo "FMOD support $fmod $fmod_support"
478 echo "kqemu support $kqemu" 481 echo "kqemu support $kqemu"
479 482
480 if test $sdl_too_old = "yes"; then 483 if test $sdl_too_old = "yes"; then
@@ -483,7 +486,6 @@ fi @@ -483,7 +486,6 @@ fi
483 #if test "$sdl_static" = "no"; then 486 #if test "$sdl_static" = "no"; then
484 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" 487 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
485 #fi 488 #fi
486 -  
487 config_mak="config-host.mak" 489 config_mak="config-host.mak"
488 config_h="config-host.h" 490 config_h="config-host.h"
489 491
@@ -610,12 +612,9 @@ if test &quot;$fmod&quot; = &quot;yes&quot; ; then @@ -610,12 +612,9 @@ if test &quot;$fmod&quot; = &quot;yes&quot; ; then
610 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak 612 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
611 echo "#define CONFIG_FMOD 1" >> $config_h 613 echo "#define CONFIG_FMOD 1" >> $config_h
612 fi 614 fi
613 -echo -n "VERSION=" >>$config_mak  
614 -head $source_path/VERSION >>$config_mak  
615 -echo "" >>$config_mak  
616 -echo -n "#define QEMU_VERSION \"" >> $config_h  
617 -head $source_path/VERSION >> $config_h  
618 -echo "\"" >> $config_h 615 +qemu_version=`head $source_path/VERSION`
  616 +echo "VERSION=$qemu_version" >>$config_mak
  617 +echo "#define QEMU_VERSION $qemu_version" >> $config_h
619 618
620 echo "SRC_PATH=$source_path" >> $config_mak 619 echo "SRC_PATH=$source_path" >> $config_mak
621 if [ "$source_path_used" = "yes" ]; then 620 if [ "$source_path_used" = "yes" ]; then
@@ -631,7 +630,6 @@ if [ &quot;$bsd&quot; = &quot;yes&quot; ] ; then @@ -631,7 +630,6 @@ if [ &quot;$bsd&quot; = &quot;yes&quot; ] ; then
631 fi 630 fi
632 631
633 for target in $target_list; do 632 for target in $target_list; do
634 -  
635 target_dir="$target" 633 target_dir="$target"
636 config_mak=$target_dir/config.mak 634 config_mak=$target_dir/config.mak
637 config_h=$target_dir/config.h 635 config_h=$target_dir/config.h
@@ -761,11 +759,11 @@ if test &quot;$target_user_only&quot; = &quot;no&quot;; then @@ -761,11 +759,11 @@ if test &quot;$target_user_only&quot; = &quot;no&quot;; then
761 else 759 else
762 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak 760 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
763 fi 761 fi
764 - echo -n "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak  
765 if [ "${aa}" = "yes" ] ; then 762 if [ "${aa}" = "yes" ] ; then
766 - echo -n " `aalib-config --cflags`" >> $config_mak ; 763 + echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
  764 + else
  765 + echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
767 fi 766 fi
768 - echo "" >> $config_mak  
769 fi 767 fi
770 fi 768 fi
771 769