TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
+TMPI="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
# default parameters
prefix=""
;;
esac
gprof="no"
+sparse="no"
bigendian="no"
mingw32="no"
EXESUF=""
vde="yes"
fmod_lib=""
fmod_inc=""
+oss_lib=""
vnc_tls="yes"
bsd="no"
linux="no"
build_docs="no"
uname_release=""
curses="yes"
+aio="yes"
nptl="yes"
mixemu="no"
+bluez="yes"
# OS specific
targetos=`uname -s`
;;
GNU/kFreeBSD)
audio_drv_list="oss"
-audio_possible_drivers="oss sdl esd"
+audio_possible_drivers="oss sdl esd pa"
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
kqemu="yes"
fi
FreeBSD)
bsd="yes"
audio_drv_list="oss"
-audio_possible_drivers="oss sdl esd"
+audio_possible_drivers="oss sdl esd pa"
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
kqemu="yes"
fi
;;
OpenBSD)
bsd="yes"
+openbsd="yes"
audio_drv_list="oss"
audio_possible_drivers="oss sdl esd"
+oss_lib="-lossaudio"
;;
Darwin)
bsd="yes"
;;
--fmod-inc=*) fmod_inc="$optarg"
;;
- --audio-card-list=*) audio_card_list="$optarg"
+ --oss-lib=*) oss_lib="$optarg"
+ ;;
+ --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
;;
--audio-drv-list=*) audio_drv_list="$optarg"
;;
- --disable-vnc-tls) vnc_tls="no"
+ --enable-sparse) sparse="yes"
+ ;;
+ --disable-sparse) sparse="no"
;;
- --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no"
+ --disable-vnc-tls) vnc_tls="no"
;;
--disable-slirp) slirp="no"
;;
;;
--disable-brlapi) brlapi="no"
;;
+ --disable-bluez) bluez="no"
+ ;;
--enable-profiler) profiler="yes"
;;
--enable-cocoa)
;;
--enable-mixemu) mixemu="yes"
;;
+ --disable-aio) aio="no"
+ ;;
*) echo "ERROR: unknown option $opt"; show_help="yes"
;;
esac
done
-if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
- AIOLIBS=
-else
- # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
- AIOLIBS="-lrt -lpthread"
-fi
-
# default flags for all hosts
-CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
+CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
+CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings"
LDFLAGS="$LDFLAGS -g"
if test "$werror" = "yes" ; then
CFLAGS="$CFLAGS -Werror"
fi
+if ld --version 2>/dev/null | grep -q "GNU ld" ; then
+ LDFLAGS="$LDFLAGS -Wl,--warn-common"
+fi
+
#
# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
echo " --make=MAKE use specified make [$make]"
echo " --install=INSTALL use specified install [$install]"
echo " --static enable static build [$static]"
+echo " --enable-sparse enable sparse checker"
+echo " --disable-sparse disable sparse checker (default)"
echo " --disable-werror disable compilation abort on warning"
echo " --disable-sdl disable SDL"
echo " --enable-cocoa enable COCOA (Mac OS X only)"
-echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
echo " --audio-drv-list=LIST set audio drivers list:"
echo " Available drivers: $audio_possible_drivers"
echo " --audio-card-list=LIST set list of additional emulated audio cards"
echo " --disable-brlapi disable BrlAPI"
echo " --disable-vnc-tls disable TLS encryption for VNC server"
echo " --disable-curses disable curses output"
+echo " --disable-bluez disable bluez stack connectivity"
echo " --disable-nptl disable usermode NPTL support"
echo " --enable-system enable all system emulation targets"
echo " --disable-system disable all system emulation targets"
echo " --disable-darwin-user disable all darwin usermode emulation targets"
echo " --fmod-lib path to FMOD library"
echo " --fmod-inc path to FMOD includes"
+echo " --oss-lib path to OSS library"
echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
echo " --disable-vde disable support for vde network"
+echo " --disable-aio disable AIO support"
echo ""
echo "NOTE: The object files are built at the place where configure is launched"
exit 1
exit 1
fi
+# check compiler to see if we're on mingw32
+cat > $TMPC <<EOF
+#include <windows.h>
+#ifndef _WIN32
+#error not windows
+#endif
+int main(void) {}
+EOF
+
+if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
+ mingw32="yes"
+fi
+
if test "$mingw32" = "yes" ; then
linux="no"
EXESUF=".exe"
oss="no"
+ linux_user="no"
+fi
+
+if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
+ AIOLIBS=
+elif [ "$bsd" = "yes" ]; then
+ AIOLIBS="-lpthread"
+else
+ # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
+ AIOLIBS="-lrt -lpthread"
fi
# Check for gcc4, error if pre-gcc4
fi
fi
+if test ! -x "$(which cgcc 2>/dev/null)"; then
+ sparse="no"
+fi
+
#
# Solaris specific configure tool chain decisions
#
# ppc specific hostlongbits selection
if test "$cpu" = "powerpc" ; then
- cat > $TMPC <<EOF
-int main(void){return sizeof(long);}
-EOF
-
- if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null; then
- $TMPE
- case $? in
- 4) hostlongbits="32";;
- 8) hostlongbits="64";;
- *) echo "Couldn't determine bits per long value"; exit 1;;
- esac
+ if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev/null </dev/null; then
+ grep -q __powerpc64__ $TMPI && hostlongbits=64
else
echo hostlongbits test failed
exit 1
nptl="no"
fi
+##########################################
+# zlib check
+
+cat > $TMPC << EOF
+#include <zlib.h>
+int main(void) { zlibVersion(); return 0; }
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz 2> /dev/null ; then
+ :
+else
+ echo
+ echo "Error: zlib check failed"
+ echo "Make sure to have the zlib libs and headers installed."
+ echo
+ exit 1
+fi
+
##########################################
# SDL probe
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 $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$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
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$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
+
+ # 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
- # 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 ${OS_CFLAGS} `$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
+ if $cc -o $TMPE ${OS_CFLAGS} `$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
else
# Make sure to disable cocoa if sdl was set
if test "$sdl" = "yes" ; then
##########################################
# VNC TLS detection
if test "$vnc_tls" = "yes" ; then
- `pkg-config gnutls` || vnc_tls="no"
-fi
-if test "$vnc_tls" = "yes" ; then
- vnc_tls_cflags=`pkg-config --cflags gnutls`
- vnc_tls_libs=`pkg-config --libs gnutls`
+cat > $TMPC <<EOF
+#include <gnutls/gnutls.h>
+int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
+EOF
+ vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
+ vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
+ $vnc_tls_libs 2> /dev/null ; then
+ :
+ else
+ vnc_tls="no"
+ fi
fi
##########################################
if test "$vde" = "yes" ; then
cat > $TMPC << EOF
#include <libvdeplug.h>
-int main(void) { struct vde_open_args a = {0, 0, 0} ; return 0;}
+int main(void)
+{
+ struct vde_open_args a = {0, 0, 0};
+ vde_open("", "", &a);
+ return 0;
+}
EOF
- if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev/null ; then
:
else
vde="no"
fi
}
+audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
for drv in $audio_drv_list; do
case $drv in
alsa)
"pa_simple *s = NULL; pa_simple_free(s); return 0;"
;;
+ oss|sdl|core|wav|dsound)
+ # XXX: Probes for CoreAudio, DirectSound, SDL(?)
+ ;;
+
*)
echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
echo
exit 1
}
;;
-
esac
done
fi
fi # test "$curses"
+##########################################
+# bluez support probe
+if test "$bluez" = "yes" ; then
+ `pkg-config bluez` || bluez="no"
+fi
+if test "$bluez" = "yes" ; then
+ cat > $TMPC << EOF
+#include <bluetooth/bluetooth.h>
+int main(void) { return bt_error(0); }
+EOF
+ bluez_cflags=`pkg-config --cflags bluez`
+ bluez_libs=`pkg-config --libs bluez`
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
+ $bluez_libs 2> /dev/null ; then
+ :
+ else
+ bluez="no"
+ fi
+fi
+
+##########################################
+# AIO probe
+if test "$aio" = "yes" ; then
+ aio=no
+ cat > $TMPC << EOF
+#include <aio.h>
+int main(void) { return aio_write(NULL); }
+EOF
+ if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
+ aio=yes
+ fi
+fi
+
# Check if tools are available to build documentation.
if [ -x "`which texi2html 2>/dev/null`" ] && \
[ -x "`which pod2man 2>/dev/null`" ]; then
if test "$mingw32" = "yes" ; then
if test -z "$prefix" ; then
- prefix="/c/Program Files/Qemu"
+ prefix="c:\\\\Program Files\\\\Qemu"
fi
mansuffix=""
datasuffix=""
echo "host big endian $bigendian"
echo "target list $target_list"
echo "gprof enabled $gprof"
+echo "sparse enabled $sparse"
echo "profiler $profiler"
echo "static build $static"
echo "-Werror enabled $werror"
echo "uname -r $uname_release"
echo "NPTL support $nptl"
echo "vde support $vde"
+echo "AIO support $aio"
if test $sdl_too_old = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
exit 1
;;
esac
+if test "$sparse" = "yes" ; then
+ echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
+ echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
+ echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
+fi
if test "$bigendian" = "yes" ; then
echo "WORDS_BIGENDIAN=yes" >> $config_mak
echo "#define WORDS_BIGENDIAN 1" >> $config_h
echo "#define HAVE_BYTESWAP_H 1" >> $config_h
fi
fi
+
+if [ "$openbsd" = "yes" ] ; then
+ echo "#define ENOTSUP 4096" >> $config_h
+fi
+
if test "$darwin" = "yes" ; then
echo "CONFIG_DARWIN=yes" >> $config_mak
echo "#define CONFIG_DARWIN 1" >> $config_h
if test "$drv" = "fmod"; then
echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
+ elif test "$drv" = "oss"; then
+ echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
fi
done
echo "" >>$config_h
echo "#define CONFIG_BRLAPI 1" >> $config_h
echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
fi
+if test "$bluez" = "yes" ; then
+ echo "CONFIG_BLUEZ=yes" >> $config_mak
+ echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
+ echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
+ echo "#define CONFIG_BLUEZ 1" >> $config_h
+fi
+if test "$aio" = "yes" ; then
+ echo "#define CONFIG_AIO 1" >> $config_h
+ echo "CONFIG_AIO=yes" >> $config_mak
+fi
# XXX: suppress that
if [ "$bsd" = "yes" ] ; then
target_nptl="no"
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
+gdb_xml_files=""
case "$target_cpu" in
i386)
;;
alpha)
echo "TARGET_ARCH=alpha" >> $config_mak
- echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
echo "#define TARGET_ARCH \"alpha\"" >> $config_h
echo "#define TARGET_ALPHA 1" >> $config_h
- echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
;;
arm|armeb)
echo "TARGET_ARCH=arm" >> $config_mak
echo "#define TARGET_ARM 1" >> $config_h
bflt="yes"
target_nptl="yes"
+ gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
;;
cris)
echo "TARGET_ARCH=cris" >> $config_mak
echo "#define TARGET_ARCH \"m68k\"" >> $config_h
echo "#define TARGET_M68K 1" >> $config_h
bflt="yes"
+ gdb_xml_files="cf-core.xml cf-fp.xml"
;;
mips|mipsel)
echo "TARGET_ARCH=mips" >> $config_mak
;;
sh4|sh4eb)
echo "TARGET_ARCH=sh4" >> $config_mak
- echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
echo "#define TARGET_ARCH \"sh4\"" >> $config_h
echo "#define TARGET_SH4 1" >> $config_h
- echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
bflt="yes"
+ target_nptl="yes"
;;
sparc)
echo "TARGET_ARCH=sparc" >> $config_mak
echo "CONFIG_DARWIN_USER=yes" >> $config_mak
echo "#define CONFIG_DARWIN_USER 1" >> $config_h
fi
+list=""
+if test ! -z "$gdb_xml_files" ; then
+ for x in $gdb_xml_files; do
+ list="$list $source_path/gdb-xml/$x"
+ done
+fi
+echo "TARGET_XML_FILES=$list" >> $config_mak
if test "$target_cpu" = "arm" \
-o "$target_cpu" = "armeb" \
done
fi
-rm -f $TMPO $TMPC $TMPE $TMPS
+rm -f $TMPO $TMPC $TMPE $TMPS $TMPI