]> Git Repo - qemu.git/blobdiff - configure
Document the binutils source files used in constructing sparc-dis.c
[qemu.git] / configure
index fd04766410053a8cfed8b2a768157b36d65c16e3..aefa69bb2c5668a71376344414a9bebb3794bf64 100755 (executable)
--- a/configure
+++ b/configure
@@ -15,6 +15,7 @@ TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
 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=""
@@ -84,6 +85,7 @@ case "$cpu" in
   ;;
 esac
 gprof="no"
+sparse="no"
 bigendian="no"
 mingw32="no"
 EXESUF=""
@@ -92,6 +94,7 @@ slirp="yes"
 vde="yes"
 fmod_lib=""
 fmod_inc=""
+oss_lib=""
 vnc_tls="yes"
 bsd="no"
 linux="no"
@@ -106,8 +109,10 @@ darwin_user="no"
 build_docs="no"
 uname_release=""
 curses="yes"
+aio="yes"
 nptl="yes"
 mixemu="no"
+bluez="yes"
 
 # OS specific
 targetos=`uname -s`
@@ -129,7 +134,7 @@ audio_possible_drivers="dsound sdl fmod"
 ;;
 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
@@ -137,7 +142,7 @@ 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
@@ -149,8 +154,10 @@ audio_possible_drivers="oss sdl esd"
 ;;
 OpenBSD)
 bsd="yes"
+openbsd="yes"
 audio_drv_list="oss"
 audio_possible_drivers="oss sdl esd"
+oss_lib="-lossaudio"
 ;;
 Darwin)
 bsd="yes"
@@ -271,13 +278,17 @@ for opt do
   ;;
   --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"
   ;;
@@ -287,6 +298,8 @@ for opt do
   ;;
   --disable-brlapi) brlapi="no"
   ;;
+  --disable-bluez) bluez="no"
+  ;;
   --enable-profiler) profiler="yes"
   ;;
   --enable-cocoa)
@@ -334,25 +347,25 @@ for opt do
   ;;
   --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)
@@ -412,10 +425,11 @@ echo "  --host-cc=CC             use C compiler CC [$host_cc] for dyngen etc."
 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"
@@ -424,6 +438,7 @@ echo "  --enable-mixemu          enable mixer emulation"
 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"
@@ -433,9 +448,11 @@ echo "  --enable-darwin-user     enable all darwin usermode 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
@@ -457,10 +474,33 @@ else
     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
@@ -497,6 +537,10 @@ EOF
     fi
 fi
 
+if test ! -x "$(which cgcc 2>/dev/null)"; then
+    sparse="no"
+fi
+
 #
 # Solaris specific configure tool chain decisions
 #
@@ -639,17 +683,8 @@ fi
 
 # 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
@@ -680,6 +715,23 @@ else
    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
 
@@ -690,42 +742,35 @@ if test -z "$sdl" ; then
     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
@@ -737,11 +782,18 @@ fi # -z $sdl
 ##########################################
 # 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
 
 ##########################################
@@ -749,9 +801,14 @@ 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"
@@ -783,6 +840,7 @@ EOF
     fi
 }
 
+audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
 for drv in $audio_drv_list; do
     case $drv in
     alsa)
@@ -810,6 +868,10 @@ for drv in $audio_drv_list; do
         "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
@@ -819,7 +881,6 @@ for drv in $audio_drv_list; do
         exit 1
     }
     ;;
-
     esac
 done
 
@@ -851,6 +912,39 @@ EOF
   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
@@ -859,7 +953,7 @@ fi
 
 if test "$mingw32" = "yes" ; then
   if test -z "$prefix" ; then
-      prefix="/c/Program Files/Qemu"
+      prefix="c:\\\\Program Files\\\\Qemu"
   fi
   mansuffix=""
   datasuffix=""
@@ -892,6 +986,7 @@ echo "host CPU          $cpu"
 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"
@@ -922,6 +1017,7 @@ echo "Documentation     $build_docs"
 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"
@@ -1039,6 +1135,11 @@ case "$cpu" in
     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
@@ -1056,6 +1157,11 @@ EOF
     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
@@ -1109,6 +1215,8 @@ for drv in $audio_drv_list; do
     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
@@ -1167,6 +1275,16 @@ if test "$brlapi" = "yes" ; then
   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
@@ -1268,6 +1386,7 @@ elfload32="no"
 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)
@@ -1298,10 +1417,8 @@ case "$target_cpu" in
   ;;
   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
@@ -1309,6 +1426,7 @@ case "$target_cpu" in
     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
@@ -1320,6 +1438,7 @@ case "$target_cpu" in
     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
@@ -1378,11 +1497,10 @@ case "$target_cpu" in
   ;;
   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
@@ -1430,6 +1548,13 @@ if test "$target_darwin_user" = "yes" ; then
   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" \
@@ -1480,4 +1605,4 @@ if test "$source_path_used" = "yes" ; then
     done
 fi
 
-rm -f $TMPO $TMPC $TMPE $TMPS
+rm -f $TMPO $TMPC $TMPE $TMPS $TMPI
This page took 0.039576 seconds and 4 git commands to generate.