cross_prefix=""
cc="gcc"
gcc3_search="yes"
-gcc3_list="gcc-3.4 gcc34 gcc-3.3 gcc33 gcc-3.2 gcc32"
+gcc3_list="gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
host_cc="gcc"
ar="ar"
make="make"
mips64)
cpu="mips64"
;;
- s390)
+ s390*)
cpu="s390"
;;
sparc|sun4[cdmuv])
CYGWIN*)
mingw32="yes"
OS_CFLAGS="-mno-cygwin"
+VL_OS_LDFLAGS="-mno-cygwin"
+if [ "$cpu" = "i386" ] ; then
+ kqemu="yes"
+fi
;;
MINGW32*)
mingw32="yes"
+if [ "$cpu" = "i386" ] ; then
+ kqemu="yes"
+fi
+;;
+GNU/kFreeBSD)
+oss="yes"
+if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
+ kqemu="yes"
+fi
;;
FreeBSD)
bsd="yes"
linux="no"
EXESUF=".exe"
oss="no"
- if [ "$cpu" = "i386" ] ; then
- kqemu="yes"
- fi
fi
# Check for gcc4, error if pre-gcc4
if test "$gcc3_search" = "yes" ; then
echo "Looking for gcc 3.x"
for compat_cc in $gcc3_list ; do
- if "$cross_prefix$compat_cc" --version > /dev/null 2>&1 ; then
+ if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
echo "Found \"$compat_cc\""
cc="$cross_prefix$compat_cc"
found_compat_cc="yes"
sdl_too_old=no
if test -z "$sdl" ; then
-
-sdl_config="sdl-config"
-sdl=no
-sdl_static=no
-
-if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
-# win32 cross compilation case
- sdl_config="i386-mingw32msvc-sdl-config"
- sdl=yes
-else
-# normal SDL probe
+ sdl_config="sdl-config"
+ sdl=no
+ sdl_static=no
+
+ if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
+ # win32 cross compilation case
+ sdl_config="i386-mingw32msvc-sdl-config"
+ sdl=yes
+ else
+ # normal SDL probe
cat > $TMPC << EOF
#include <SDL.h>
#undef main /* We don't want SDL to override our main() */
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
EOF
+ if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then
+ _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
+ if test "$_sdlversion" -lt 121 ; then
+ sdl_too_old=yes
+ else
+ if test "$cocoa" = "no" ; then
+ sdl=yes
+ fi
+ fi
-if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
-_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
-if test "$_sdlversion" -lt 121 ; then
-sdl_too_old=yes
-else
- if test "$cocoa" = "no" ; then
- sdl=yes
- fi
-fi
-
-# static link with sdl ?
-if test "$sdl" = "yes" ; then
-aa="no"
-`$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
-sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
-if [ "$aa" = "yes" ] ; then
- sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
-fi
-
-if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
- sdl_static=yes
-fi
-
-fi # static link
-
-fi # sdl compile test
-
-fi # cross compilation
-
+ # static link with sdl ?
+ if test "$sdl" = "yes" ; then
+ aa="no"
+ `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
+ sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
+ if [ "$aa" = "yes" ] ; then
+ sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
+ fi
+
+ if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
+ sdl_static=yes
+ fi
+ fi # static link
+ fi # sdl compile test
+ fi # cross compilation
else
- # Make sure to disable cocoa if sdl was set
- if test "$sdl" = "yes" ; then
- cocoa="no"
- coreaudio="no"
- fi
+ # Make sure to disable cocoa if sdl was set
+ if test "$sdl" = "yes" ; then
+ cocoa="no"
+ coreaudio="no"
+ fi
fi # -z $sdl
##########################################
if test $sdl_too_old = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
fi
+if [ -s /tmp/qemu-$$-sdl-config.log ]; then
+ echo "The error log from compiling the libSDL test is: "
+ cat /tmp/qemu-$$-sdl-config.log
+fi
+rm -f /tmp/qemu-$$-sdl-config.log
#if test "$sdl_static" = "no"; then
# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
#fi
#echo "Creating $config_mak and $config_h"
+test -f $config_h && mv $config_h ${config_h}~
+
echo "# Automatically generated by configure - do not modify" > $config_mak
echo "# Configured with: $0 $@" >> $config_mak
echo "/* Automatically generated by configure - do not modify */" > $config_h
echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
+echo "VL_OS_LDFLAGS=$VL_OS_LDFLAGS" >> $config_mak
echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
echo "CFLAGS=$CFLAGS" >> $config_mak
echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
+test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
+
for target in $target_list; do
target_dir="$target"
config_mak=$target_dir/config.mak
[ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
[ "$target_cpu" = "m68k" ] && target_bigendian=yes
target_softmmu="no"
-if expr $target : '.*-softmmu' > /dev/null ; then
- target_softmmu="yes"
-fi
target_user_only="no"
-if expr $target : '.*-user' > /dev/null ; then
- target_user_only="yes"
-fi
-
target_linux_user="no"
-if expr $target : '.*-linux-user' > /dev/null ; then
- target_linux_user="yes"
-fi
-
target_darwin_user="no"
-if expr $target : '.*-darwin-user' > /dev/null ; then
- target_darwin_user="yes"
-fi
+case "$target" in
+ ${target_cpu}-softmmu)
+ target_softmmu="yes"
+ ;;
+ ${target_cpu}-linux-user)
+ target_user_only="yes"
+ target_linux_user="yes"
+ ;;
+ ${target_cpu}-darwin-user)
+ target_user_only="yes"
+ target_darwin_user="yes"
+ ;;
+ *)
+ echo "ERROR: Target '$target' not recognised"
+ exit 1
+ ;;
+esac
if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
-a "$sdl" = "no" -a "$cocoa" = "no" ; then
#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
+test -f $config_h && mv $config_h ${config_h}~
+
mkdir -p $target_dir
mkdir -p $target_dir/fpu
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
echo "CONFIG_COCOA=yes" >> $config_mak
fi
+test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
+
done # for target in $targets
# build tree in object directory if source path is different from current one