~ubuntu-branches/debian/jessie/qemu/jessie

« back to all changes in this revision

Viewing changes to configure

  • Committer: Package Import Robot
  • Author(s): Vagrant Cascadian
  • Date: 2011-10-03 12:29:18 UTC
  • mfrom: (1.2.13) (10.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20111003122918-zc4kv6epchrbgdta
Tags: 0.15.0+dfsg-1
* New upstream version.
* Install new qemu-system, qemu-user and qemu-user-static variants: 
  lm32, microblazeel, s390x, unicore32
* Patch from upstream to set QEMU_INCLUDES before QEMU_CFLAGS.
* Update debian/watch to check http://qemu.org/download.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
docs=""
115
115
fdt=""
116
116
kvm=""
117
 
kvm_para=""
118
117
nptl=""
119
118
sdl=""
 
119
vnc="yes"
120
120
sparse="no"
121
121
uuid=""
122
122
vde=""
126
126
vnc_png=""
127
127
vnc_thread="no"
128
128
xen=""
 
129
xen_ctrl_version=""
129
130
linux_aio=""
130
131
attr=""
131
132
vhost_net=""
144
145
datadir="\${prefix}/share/qemu"
145
146
docdir="\${prefix}/share/doc/qemu"
146
147
bindir="\${prefix}/bin"
 
148
libdir="\${prefix}/lib"
147
149
sysconfdir="\${prefix}/etc"
148
150
confsuffix="/qemu"
149
151
slirp="yes"
163
165
uname_release=""
164
166
io_thread="no"
165
167
mixemu="no"
166
 
kerneldir=""
167
168
aix="no"
168
169
blobs="yes"
169
170
pkgversion=""
174
175
trace_file="trace"
175
176
spice=""
176
177
rbd=""
 
178
smartcard=""
 
179
smartcard_nss=""
 
180
usb_redir=""
 
181
opengl=""
 
182
guest_agent="yes"
177
183
 
178
184
# parse CC options first
179
185
for opt do
224
230
# default flags for all hosts
225
231
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
226
232
CFLAGS="-g $CFLAGS"
227
 
QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
 
233
QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
228
234
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
229
235
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
230
236
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
280
286
fi
281
287
 
282
288
case "$cpu" in
283
 
  alpha|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64)
 
289
  alpha|cris|ia64|lm32|m68k|microblaze|ppc|ppc64|sparc64|unicore32)
284
290
    cpu="$cpu"
285
291
  ;;
286
292
  i386|i486|i586|i686|i86pc|BePC)
453
459
  linux="yes"
454
460
  linux_user="yes"
455
461
  usb="linux"
 
462
  kvm="yes"
 
463
  vhost_net="yes"
456
464
  if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
457
465
    audio_possible_drivers="$audio_possible_drivers fmod"
458
466
  fi
468
476
 
469
477
: ${make=${MAKE-make}}
470
478
: ${install=${INSTALL-install}}
 
479
: ${python=${PYTHON-python}}
471
480
 
472
481
if test "$mingw32" = "yes" ; then
473
482
  EXESUF=".exe"
474
483
  QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
475
484
  # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
476
485
  QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
477
 
  LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
 
486
  LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS"
478
487
  prefix="c:/Program Files/Qemu"
479
488
  mandir="\${prefix}"
480
489
  datadir="\${prefix}"
491
500
  case "$opt" in
492
501
  --help|-h) show_help=yes
493
502
  ;;
 
503
  --version|-V) exec cat $source_path/VERSION
 
504
  ;;
494
505
  --prefix=*) prefix="$optarg"
495
506
  ;;
496
507
  --interp-prefix=*) interp_prefix="$optarg"
507
518
  ;;
508
519
  --install=*) install="$optarg"
509
520
  ;;
 
521
  --python=*) python="$optarg"
 
522
  ;;
510
523
  --extra-cflags=*)
511
524
  ;;
512
525
  --extra-ldflags=*)
529
542
  ;;
530
543
  --bindir=*) bindir="$optarg"
531
544
  ;;
 
545
  --libdir=*) libdir="$optarg"
 
546
  ;;
532
547
  --datadir=*) datadir="$optarg"
533
548
  ;;
534
549
  --docdir=*) docdir="$optarg"
539
554
  ;;
540
555
  --enable-sdl) sdl="yes"
541
556
  ;;
 
557
  --disable-vnc) vnc="no"
 
558
  ;;
 
559
  --enable-vnc) vnc="yes"
 
560
  ;;
542
561
  --fmod-lib=*) fmod_lib="$optarg"
543
562
  ;;
544
563
  --fmod-inc=*) fmod_inc="$optarg"
701
720
  ;;
702
721
  --disable-blobs) blobs="no"
703
722
  ;;
704
 
  --kerneldir=*) kerneldir="$optarg"
705
 
  ;;
706
723
  --with-pkgversion=*) pkgversion=" ($optarg)"
707
724
  ;;
708
725
  --disable-docs) docs="no"
713
730
  ;;
714
731
  --enable-vhost-net) vhost_net="yes"
715
732
  ;;
 
733
  --disable-opengl) opengl="no"
 
734
  ;;
 
735
  --enable-opengl) opengl="yes"
 
736
  ;;
716
737
  --*dir)
717
738
  ;;
718
739
  --disable-rbd) rbd="no"
719
740
  ;;
720
741
  --enable-rbd) rbd="yes"
721
742
  ;;
 
743
  --disable-smartcard) smartcard="no"
 
744
  ;;
 
745
  --enable-smartcard) smartcard="yes"
 
746
  ;;
 
747
  --disable-smartcard-nss) smartcard_nss="no"
 
748
  ;;
 
749
  --enable-smartcard-nss) smartcard_nss="yes"
 
750
  ;;
 
751
  --disable-usb-redir) usb_redir="no"
 
752
  ;;
 
753
  --enable-usb-redir) usb_redir="yes"
 
754
  ;;
 
755
  --enable-guest-agent) guest_agent="yes"
 
756
  ;;
 
757
  --disable-guest-agent) guest_agent="no"
 
758
  ;;
722
759
  *) echo "ERROR: unknown option $opt"; show_help="yes"
723
760
  ;;
724
761
  esac
793
830
    hppa*)
794
831
           host_guest_base="yes"
795
832
           ;;
 
833
    unicore32*)
 
834
           host_guest_base="yes"
 
835
           ;;
796
836
esac
797
837
 
798
838
[ -z "$guest_base" ] && guest_base="$host_guest_base"
799
839
 
 
840
 
 
841
default_target_list=""
 
842
 
 
843
# these targets are portable
 
844
if [ "$softmmu" = "yes" ] ; then
 
845
    default_target_list="\
 
846
i386-softmmu \
 
847
x86_64-softmmu \
 
848
arm-softmmu \
 
849
cris-softmmu \
 
850
lm32-softmmu \
 
851
m68k-softmmu \
 
852
microblaze-softmmu \
 
853
microblazeel-softmmu \
 
854
mips-softmmu \
 
855
mipsel-softmmu \
 
856
mips64-softmmu \
 
857
mips64el-softmmu \
 
858
ppc-softmmu \
 
859
ppcemb-softmmu \
 
860
ppc64-softmmu \
 
861
sh4-softmmu \
 
862
sh4eb-softmmu \
 
863
sparc-softmmu \
 
864
sparc64-softmmu \
 
865
s390x-softmmu \
 
866
"
 
867
fi
 
868
# the following are Linux specific
 
869
if [ "$linux_user" = "yes" ] ; then
 
870
    default_target_list="${default_target_list}\
 
871
i386-linux-user \
 
872
x86_64-linux-user \
 
873
alpha-linux-user \
 
874
arm-linux-user \
 
875
armeb-linux-user \
 
876
cris-linux-user \
 
877
m68k-linux-user \
 
878
microblaze-linux-user \
 
879
microblazeel-linux-user \
 
880
mips-linux-user \
 
881
mipsel-linux-user \
 
882
ppc-linux-user \
 
883
ppc64-linux-user \
 
884
ppc64abi32-linux-user \
 
885
sh4-linux-user \
 
886
sh4eb-linux-user \
 
887
sparc-linux-user \
 
888
sparc64-linux-user \
 
889
sparc32plus-linux-user \
 
890
unicore32-linux-user \
 
891
s390x-linux-user \
 
892
"
 
893
fi
 
894
# the following are Darwin specific
 
895
if [ "$darwin_user" = "yes" ] ; then
 
896
    default_target_list="$default_target_list i386-darwin-user ppc-darwin-user "
 
897
fi
 
898
# the following are BSD specific
 
899
if [ "$bsd_user" = "yes" ] ; then
 
900
    default_target_list="${default_target_list}\
 
901
i386-bsd-user \
 
902
x86_64-bsd-user \
 
903
sparc-bsd-user \
 
904
sparc64-bsd-user \
 
905
"
 
906
fi
 
907
 
800
908
if test x"$show_help" = x"yes" ; then
801
909
cat << EOF
802
910
 
809
917
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
810
918
echo "  --interp-prefix=PREFIX   where to find shared libraries, etc."
811
919
echo "                           use %M for cpu name [$interp_prefix]"
812
 
echo "  --target-list=LIST       set target list [$target_list]"
 
920
echo "  --target-list=LIST       set target list (default: build everything)"
 
921
echo "Available targets: $default_target_list" | \
 
922
    fold -s -w 53 | sed -e 's/^/                           /'
813
923
echo ""
814
924
echo "Advanced options (experts only):"
815
925
echo "  --source-path=PATH       path of source code [$source_path]"
821
931
echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
822
932
echo "  --make=MAKE              use specified make [$make]"
823
933
echo "  --install=INSTALL        use specified install [$install]"
 
934
echo "  --python=PYTHON          use specified python [$python]"
824
935
echo "  --static                 enable static build [$static]"
825
936
echo "  --mandir=PATH            install man pages in PATH"
826
937
echo "  --datadir=PATH           install firmware in PATH"
836
947
echo "  --disable-werror         disable compilation abort on warning"
837
948
echo "  --disable-sdl            disable SDL"
838
949
echo "  --enable-sdl             enable SDL"
 
950
echo "  --disable-vnc            disable VNC"
 
951
echo "  --enable-vnc             enable VNC"
839
952
echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
840
953
echo "  --audio-drv-list=LIST    set audio drivers list:"
841
954
echo "                           Available drivers: $audio_possible_drivers"
868
981
echo "  --enable-check-utests    enable check unit-tests"
869
982
echo "  --disable-bluez          disable bluez stack connectivity"
870
983
echo "  --enable-bluez           enable bluez stack connectivity"
 
984
echo "  --disable-slirp          disable SLIRP userspace network connectivity"
871
985
echo "  --disable-kvm            disable KVM acceleration support"
872
986
echo "  --enable-kvm             enable KVM acceleration support"
873
987
echo "  --disable-nptl           disable usermode NPTL support"
902
1016
echo "  --enable-attr            enable attr and xattr support"
903
1017
echo "  --enable-io-thread       enable IO thread"
904
1018
echo "  --disable-blobs          disable installing provided firmware blobs"
905
 
echo "  --kerneldir=PATH         look for kernel includes in PATH"
906
1019
echo "  --enable-docs            enable documentation build"
907
1020
echo "  --disable-docs           disable documentation build"
908
1021
echo "  --disable-vhost-net      disable vhost-net acceleration support"
914
1027
echo "  --disable-spice          disable spice"
915
1028
echo "  --enable-spice           enable spice"
916
1029
echo "  --enable-rbd             enable building the rados block device (rbd)"
 
1030
echo "  --disable-smartcard      disable smartcard support"
 
1031
echo "  --enable-smartcard       enable smartcard support"
 
1032
echo "  --disable-smartcard-nss  disable smartcard nss support"
 
1033
echo "  --enable-smartcard-nss   enable smartcard nss support"
 
1034
echo "  --disable-usb-redir      disable usb network redirection support"
 
1035
echo "  --enable-usb-redir       enable usb network redirection support"
 
1036
echo "  --disable-guest-agent    disable building of the QEMU Guest Agent"
 
1037
echo "  --enable-guest-agent     enable building of the QEMU Guest Agent"
917
1038
echo ""
918
1039
echo "NOTE: The object files are built at the place where configure is launched"
919
1040
exit 1
934
1055
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
935
1056
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
936
1057
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
937
 
gcc_flags="-fstack-protector-all $gcc_flags"
 
1058
gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags"
938
1059
cat > $TMPC << EOF
939
1060
int main(void) { return 0; }
940
1061
EOF
973
1094
  fi
974
1095
fi
975
1096
 
 
1097
if test "$guest_agent" != "no" ; then
 
1098
  if has $python; then
 
1099
    :
 
1100
  else
 
1101
    echo "Python not found. Use --python=/path/to/python"
 
1102
    exit 1
 
1103
  fi
 
1104
fi
976
1105
 
977
1106
if test -z "$target_list" ; then
978
 
# these targets are portable
979
 
    if [ "$softmmu" = "yes" ] ; then
980
 
        target_list="\
981
 
i386-softmmu \
982
 
x86_64-softmmu \
983
 
arm-softmmu \
984
 
cris-softmmu \
985
 
m68k-softmmu \
986
 
microblaze-softmmu \
987
 
mips-softmmu \
988
 
mipsel-softmmu \
989
 
mips64-softmmu \
990
 
mips64el-softmmu \
991
 
ppc-softmmu \
992
 
ppcemb-softmmu \
993
 
ppc64-softmmu \
994
 
sh4-softmmu \
995
 
sh4eb-softmmu \
996
 
sparc-softmmu \
997
 
sparc64-softmmu \
998
 
"
999
 
    fi
1000
 
# the following are Linux specific
1001
 
    if [ "$linux_user" = "yes" ] ; then
1002
 
        target_list="${target_list}\
1003
 
i386-linux-user \
1004
 
x86_64-linux-user \
1005
 
alpha-linux-user \
1006
 
arm-linux-user \
1007
 
armeb-linux-user \
1008
 
cris-linux-user \
1009
 
m68k-linux-user \
1010
 
microblaze-linux-user \
1011
 
mips-linux-user \
1012
 
mipsel-linux-user \
1013
 
ppc-linux-user \
1014
 
ppc64-linux-user \
1015
 
ppc64abi32-linux-user \
1016
 
sh4-linux-user \
1017
 
sh4eb-linux-user \
1018
 
sparc-linux-user \
1019
 
sparc64-linux-user \
1020
 
sparc32plus-linux-user \
1021
 
"
1022
 
    fi
1023
 
# the following are Darwin specific
1024
 
    if [ "$darwin_user" = "yes" ] ; then
1025
 
        target_list="$target_list i386-darwin-user ppc-darwin-user "
1026
 
    fi
1027
 
# the following are BSD specific
1028
 
    if [ "$bsd_user" = "yes" ] ; then
1029
 
        target_list="${target_list}\
1030
 
i386-bsd-user \
1031
 
x86_64-bsd-user \
1032
 
sparc-bsd-user \
1033
 
sparc64-bsd-user \
1034
 
"
1035
 
    fi
 
1107
    target_list="$default_target_list"
1036
1108
else
1037
1109
    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
1038
1110
fi
1145
1217
 
1146
1218
if test "$xen" != "no" ; then
1147
1219
  xen_libs="-lxenstore -lxenctrl -lxenguest"
 
1220
 
 
1221
  # Xen unstable
1148
1222
  cat > $TMPC <<EOF
1149
1223
#include <xenctrl.h>
1150
1224
#include <xs.h>
1151
 
int main(void) { xs_daemon_open(); xc_interface_open(); return 0; }
 
1225
#include <stdint.h>
 
1226
#include <xen/hvm/hvm_info_table.h>
 
1227
#if !defined(HVM_MAX_VCPUS)
 
1228
# error HVM_MAX_VCPUS not defined
 
1229
#endif
 
1230
int main(void) {
 
1231
  xc_interface *xc;
 
1232
  xs_daemon_open();
 
1233
  xc = xc_interface_open(0, 0, 0);
 
1234
  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
 
1235
  xc_gnttab_open(NULL, 0);
 
1236
  xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
 
1237
  return 0;
 
1238
}
1152
1239
EOF
1153
1240
  if compile_prog "" "$xen_libs" ; then
1154
 
    xen=yes
1155
 
    libs_softmmu="$xen_libs $libs_softmmu"
 
1241
    xen_ctrl_version=410
 
1242
    xen=yes
 
1243
 
 
1244
  # Xen 4.0.0
 
1245
  elif (
 
1246
      cat > $TMPC <<EOF
 
1247
#include <xenctrl.h>
 
1248
#include <xs.h>
 
1249
#include <stdint.h>
 
1250
#include <xen/hvm/hvm_info_table.h>
 
1251
#if !defined(HVM_MAX_VCPUS)
 
1252
# error HVM_MAX_VCPUS not defined
 
1253
#endif
 
1254
int main(void) {
 
1255
  struct xen_add_to_physmap xatp = {
 
1256
    .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
 
1257
  };
 
1258
  xs_daemon_open();
 
1259
  xc_interface_open();
 
1260
  xc_gnttab_open();
 
1261
  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
 
1262
  xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
 
1263
  return 0;
 
1264
}
 
1265
EOF
 
1266
      compile_prog "" "$xen_libs"
 
1267
    ) ; then
 
1268
    xen_ctrl_version=400
 
1269
    xen=yes
 
1270
 
 
1271
  # Xen 3.4.0
 
1272
  elif (
 
1273
      cat > $TMPC <<EOF
 
1274
#include <xenctrl.h>
 
1275
#include <xs.h>
 
1276
int main(void) {
 
1277
  struct xen_add_to_physmap xatp = {
 
1278
    .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
 
1279
  };
 
1280
  xs_daemon_open();
 
1281
  xc_interface_open();
 
1282
  xc_gnttab_open();
 
1283
  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
 
1284
  xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
 
1285
  return 0;
 
1286
}
 
1287
EOF
 
1288
      compile_prog "" "$xen_libs"
 
1289
    ) ; then
 
1290
    xen_ctrl_version=340
 
1291
    xen=yes
 
1292
 
 
1293
  # Xen 3.3.0
 
1294
  elif (
 
1295
      cat > $TMPC <<EOF
 
1296
#include <xenctrl.h>
 
1297
#include <xs.h>
 
1298
int main(void) {
 
1299
  xs_daemon_open();
 
1300
  xc_interface_open();
 
1301
  xc_gnttab_open();
 
1302
  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
 
1303
  return 0;
 
1304
}
 
1305
EOF
 
1306
      compile_prog "" "$xen_libs"
 
1307
    ) ; then
 
1308
    xen_ctrl_version=330
 
1309
    xen=yes
 
1310
 
 
1311
  # Xen not found or unsupported
1156
1312
  else
1157
1313
    if test "$xen" = "yes" ; then
1158
1314
      feature_not_found "xen"
1159
1315
    fi
1160
1316
    xen=no
1161
1317
  fi
 
1318
 
 
1319
  if test "$xen" = yes; then
 
1320
    libs_softmmu="$xen_libs $libs_softmmu"
 
1321
  fi
1162
1322
fi
1163
1323
 
1164
1324
##########################################
1170
1330
fi
1171
1331
 
1172
1332
##########################################
 
1333
# libtool probe
 
1334
 
 
1335
if ! has libtool; then
 
1336
    libtool=
 
1337
else
 
1338
    libtool=libtool
 
1339
fi
 
1340
 
 
1341
##########################################
1173
1342
# Sparse probe
1174
1343
if test "$sparse" != "no" ; then
1175
1344
  if has cgcc; then
1203
1372
  fi
1204
1373
  sdl=no
1205
1374
fi
1206
 
if test -n "$cross_prefix" && test "`basename $sdlconfig`" = sdl-config; then
 
1375
if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
1207
1376
  echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
1208
1377
fi
1209
1378
 
1270
1439
 
1271
1440
##########################################
1272
1441
# VNC TLS detection
1273
 
if test "$vnc_tls" != "no" ; then
 
1442
if test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then
1274
1443
  cat > $TMPC <<EOF
1275
1444
#include <gnutls/gnutls.h>
1276
1445
int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
1290
1459
 
1291
1460
##########################################
1292
1461
# VNC SASL detection
1293
 
if test "$vnc_sasl" != "no" ; then
 
1462
if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then
1294
1463
  cat > $TMPC <<EOF
1295
1464
#include <sasl/sasl.h>
1296
1465
#include <stdio.h>
1312
1481
 
1313
1482
##########################################
1314
1483
# VNC JPEG detection
1315
 
if test "$vnc_jpeg" != "no" ; then
 
1484
if test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then
1316
1485
cat > $TMPC <<EOF
1317
1486
#include <stdio.h>
1318
1487
#include <jpeglib.h>
1333
1502
 
1334
1503
##########################################
1335
1504
# VNC PNG detection
1336
 
if test "$vnc_png" != "no" ; then
 
1505
if test "$vnc" = "yes" -a "$vnc_png" != "no" ; then
1337
1506
cat > $TMPC <<EOF
1338
1507
//#include <stdio.h>
1339
1508
#include <png.h>
1497
1666
 
1498
1667
    pa)
1499
1668
    audio_drv_probe $drv pulse/simple.h "-lpulse-simple -lpulse" \
1500
 
        "pa_simple *s = NULL; pa_simple_free(s); return 0;"
 
1669
        "pa_simple *s = 0; pa_simple_free(s); return 0;"
1501
1670
    libs_softmmu="-lpulse -lpulse-simple $libs_softmmu"
1502
1671
    audio_pt_int="yes"
1503
1672
    ;;
1559
1728
 
1560
1729
##########################################
1561
1730
# curses probe
1562
 
curses_list="-lncurses -lcurses"
 
1731
if test "$mingw32" = "yes" ; then
 
1732
    curses_list="-lpdcurses"
 
1733
else
 
1734
    curses_list="-lncurses -lcurses"
 
1735
fi
1563
1736
 
1564
1737
if test "$curses" != "no" ; then
1565
1738
  curses_found=no
1599
1772
if test "$curl" != "no" ; then
1600
1773
  cat > $TMPC << EOF
1601
1774
#include <curl/curl.h>
1602
 
int main(void) { return curl_easy_init(); }
 
1775
int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; }
1603
1776
EOF
1604
1777
  curl_cflags=`$curlconfig --cflags 2>/dev/null`
1605
1778
  curl_libs=`$curlconfig --libs 2>/dev/null`
1656
1829
fi
1657
1830
 
1658
1831
##########################################
1659
 
# kvm probe
1660
 
if test "$kvm" != "no" ; then
1661
 
    cat > $TMPC <<EOF
1662
 
#include <linux/kvm.h>
1663
 
#if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1664
 
#error Invalid KVM version
1665
 
#endif
1666
 
EOF
1667
 
    must_have_caps="KVM_CAP_USER_MEMORY \
1668
 
                    KVM_CAP_DESTROY_MEMORY_REGION_WORKS \
1669
 
                    KVM_CAP_COALESCED_MMIO \
1670
 
                    KVM_CAP_SYNC_MMU \
1671
 
                   "
1672
 
    if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) ; then
1673
 
      must_have_caps="$caps \
1674
 
                      KVM_CAP_SET_TSS_ADDR \
1675
 
                      KVM_CAP_EXT_CPUID \
1676
 
                      KVM_CAP_CLOCKSOURCE \
1677
 
                      KVM_CAP_NOP_IO_DELAY \
1678
 
                      KVM_CAP_PV_MMU \
1679
 
                      KVM_CAP_MP_STATE \
1680
 
                      KVM_CAP_USER_NMI \
1681
 
                     "
1682
 
    fi
1683
 
    for c in $must_have_caps ; do
1684
 
      cat >> $TMPC <<EOF
1685
 
#if !defined($c)
1686
 
#error Missing KVM capability $c
1687
 
#endif
1688
 
EOF
1689
 
    done
1690
 
    cat >> $TMPC <<EOF
1691
 
int main(void) { return 0; }
1692
 
EOF
1693
 
  if test "$kerneldir" != "" ; then
1694
 
      kvm_cflags=-I"$kerneldir"/include
1695
 
      if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1696
 
         -a -d "$kerneldir/arch/x86/include" ; then
1697
 
            kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1698
 
        elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1699
 
            kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1700
 
        elif test "$cpu" = "s390x" -a -d "$kerneldir/arch/s390/include" ; then
1701
 
            kvm_cflags="$kvm_cflags -I$kerneldir/arch/s390/include"
1702
 
        elif test -d "$kerneldir/arch/$cpu/include" ; then
1703
 
            kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1704
 
      fi
1705
 
  else
1706
 
    kvm_cflags=`$pkg_config --cflags kvm-kmod 2>/dev/null`
1707
 
  fi
1708
 
  if compile_prog "$kvm_cflags" "" ; then
1709
 
    kvm=yes
1710
 
    cat > $TMPC <<EOF
1711
 
#include <linux/kvm_para.h>
1712
 
int main(void) { return 0; }
1713
 
EOF
1714
 
    if compile_prog "$kvm_cflags" "" ; then
1715
 
      kvm_para=yes
1716
 
    fi
1717
 
  else
1718
 
    if test "$kvm" = "yes" ; then
1719
 
      if has awk && has grep; then
1720
 
        kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \
1721
 
        | grep "error: " \
1722
 
        | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1723
 
        if test "$kvmerr" != "" ; then
1724
 
          echo -e "${kvmerr}\n\
1725
 
NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \
1726
 
recent kvm-kmod from http://sourceforge.net/projects/kvm."
1727
 
        fi
1728
 
      fi
1729
 
      feature_not_found "kvm"
1730
 
    fi
1731
 
    kvm=no
1732
 
  fi
1733
 
fi
1734
 
 
1735
 
##########################################
1736
 
# test for vhost net
1737
 
 
1738
 
if test "$vhost_net" != "no"; then
1739
 
    if test "$kvm" != "no"; then
1740
 
            cat > $TMPC <<EOF
1741
 
    #include <linux/vhost.h>
1742
 
    int main(void) { return 0; }
1743
 
EOF
1744
 
            if compile_prog "$kvm_cflags" "" ; then
1745
 
                vhost_net=yes
1746
 
            else
1747
 
                if test "$vhost_net" = "yes" ; then
1748
 
                    feature_not_found "vhost-net"
1749
 
                fi
1750
 
                vhost_net=no
1751
 
            fi
 
1832
# glib support probe
 
1833
if test "$guest_agent" != "no" ; then
 
1834
    if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then
 
1835
        glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null`
 
1836
        glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null`
 
1837
        libs_softmmu="$glib_libs $libs_softmmu"
 
1838
        libs_tools="$glib_libs $libs_tools"
1752
1839
    else
1753
 
            if test "$vhost_net" = "yes" ; then
1754
 
                echo "NOTE: vhost-net feature requires KVM (--enable-kvm)."
1755
 
                feature_not_found "vhost-net"
1756
 
            fi
1757
 
            vhost_net=no
 
1840
        echo "glib-2.0 required to compile QEMU"
 
1841
        exit 1
1758
1842
    fi
1759
1843
fi
1760
1844
 
1792
1876
if test "$rbd" != "no" ; then
1793
1877
  cat > $TMPC <<EOF
1794
1878
#include <stdio.h>
1795
 
#include <rados/librados.h>
1796
 
int main(void) { rados_initialize(0, NULL); return 0; }
 
1879
#include <rbd/librbd.h>
 
1880
int main(void) {
 
1881
    rados_t cluster;
 
1882
    rados_create(&cluster, NULL);
 
1883
    return 0;
 
1884
}
1797
1885
EOF
1798
 
  rbd_libs="-lrados"
 
1886
  rbd_libs="-lrbd -lrados"
1799
1887
  if compile_prog "" "$rbd_libs" ; then
1800
 
    librados_too_old=no
1801
 
    cat > $TMPC <<EOF
1802
 
#include <stdio.h>
1803
 
#include <rados/librados.h>
1804
 
#ifndef CEPH_OSD_TMAP_SET
1805
 
#error missing CEPH_OSD_TMAP_SET
1806
 
#endif
1807
 
int main(void) {
1808
 
    int (*func)(const rados_pool_t pool, uint64_t *snapid) = rados_selfmanaged_snap_create;
1809
 
    rados_initialize(0, NULL);
1810
 
    return 0;
1811
 
}
1812
 
EOF
1813
 
    if compile_prog "" "$rbd_libs" ; then
1814
 
      rbd=yes
1815
 
      libs_tools="$rbd_libs $libs_tools"
1816
 
      libs_softmmu="$rbd_libs $libs_softmmu"
1817
 
    else
1818
 
      rbd=no
1819
 
      librados_too_old=yes
1820
 
    fi
 
1888
    rbd=yes
 
1889
    libs_tools="$rbd_libs $libs_tools"
 
1890
    libs_softmmu="$rbd_libs $libs_softmmu"
1821
1891
  else
1822
1892
    if test "$rbd" = "yes" ; then
1823
1893
      feature_not_found "rados block device"
1824
1894
    fi
1825
1895
    rbd=no
1826
1896
  fi
1827
 
  if test "$librados_too_old" = "yes" ; then
1828
 
    echo "-> Your librados version is too old - upgrade needed to have rbd support"
1829
 
  fi
1830
1897
fi
1831
1898
 
1832
1899
##########################################
1907
1974
EOF
1908
1975
  if compile_prog "" "$fdt_libs" ; then
1909
1976
    fdt=yes
1910
 
    libs_softmmu="$fdt_libs $libs_softmmu"
1911
1977
  else
1912
1978
    if test "$fdt" = "yes" ; then
1913
1979
      feature_not_found "fdt"
1914
1980
    fi
 
1981
    fdt_libs=
1915
1982
    fdt=no
1916
1983
  fi
1917
1984
fi
1918
1985
 
 
1986
##########################################
 
1987
# opengl probe, used by milkymist-tmu2
 
1988
if test "$opengl" != "no" ; then
 
1989
  opengl_libs="-lGL"
 
1990
  cat > $TMPC << EOF
 
1991
#include <X11/Xlib.h>
 
1992
#include <GL/gl.h>
 
1993
#include <GL/glx.h>
 
1994
int main(void) { GL_VERSION; return 0; }
 
1995
EOF
 
1996
  if compile_prog "" "-lGL" ; then
 
1997
    opengl=yes
 
1998
  else
 
1999
    if test "$opengl" = "yes" ; then
 
2000
      feature_not_found "opengl"
 
2001
    fi
 
2002
    opengl_libs=
 
2003
    opengl=no
 
2004
  fi
 
2005
fi
 
2006
 
1919
2007
#
1920
2008
# Check for xxxat() functions when we are building linux-user
1921
2009
# emulator.  This is done because older glibc versions don't
2065
2153
 
2066
2154
if compile_prog "" "" ; then
2067
2155
  signalfd=yes
 
2156
elif test "$kvm" = "yes" -a "$io_thread" != "yes"; then
 
2157
  echo
 
2158
  echo "ERROR: Host kernel lacks signalfd() support,"
 
2159
  echo "but KVM depends on it when the IO thread is disabled."
 
2160
  echo
 
2161
  exit 1
2068
2162
fi
2069
2163
 
2070
2164
# check if eventfd is supported
2144
2238
  dup3=yes
2145
2239
fi
2146
2240
 
 
2241
# check for epoll support
 
2242
epoll=no
 
2243
cat > $TMPC << EOF
 
2244
#include <sys/epoll.h>
 
2245
 
 
2246
int main(void)
 
2247
{
 
2248
    epoll_create(0);
 
2249
    return 0;
 
2250
}
 
2251
EOF
 
2252
if compile_prog "$ARCH_CFLAGS" "" ; then
 
2253
  epoll=yes
 
2254
fi
 
2255
 
 
2256
# epoll_create1 and epoll_pwait are later additions
 
2257
# so we must check separately for their presence
 
2258
epoll_create1=no
 
2259
cat > $TMPC << EOF
 
2260
#include <sys/epoll.h>
 
2261
 
 
2262
int main(void)
 
2263
{
 
2264
    /* Note that we use epoll_create1 as a value, not as
 
2265
     * a function being called. This is necessary so that on
 
2266
     * old SPARC glibc versions where the function was present in
 
2267
     * the library but not declared in the header file we will
 
2268
     * fail the configure check. (Otherwise we will get a compiler
 
2269
     * warning but not an error, and will proceed to fail the
 
2270
     * qemu compile where we compile with -Werror.)
 
2271
     */
 
2272
    epoll_create1;
 
2273
    return 0;
 
2274
}
 
2275
EOF
 
2276
if compile_prog "$ARCH_CFLAGS" "" ; then
 
2277
  epoll_create1=yes
 
2278
fi
 
2279
 
 
2280
epoll_pwait=no
 
2281
cat > $TMPC << EOF
 
2282
#include <sys/epoll.h>
 
2283
 
 
2284
int main(void)
 
2285
{
 
2286
    epoll_pwait(0, 0, 0, 0, 0);
 
2287
    return 0;
 
2288
}
 
2289
EOF
 
2290
if compile_prog "$ARCH_CFLAGS" "" ; then
 
2291
  epoll_pwait=yes
 
2292
fi
 
2293
 
2147
2294
# Check if tools are available to build documentation.
2148
2295
if test "$docs" != "no" ; then
2149
2296
  if has makeinfo && has pod2man; then
2234
2381
EOF
2235
2382
  spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
2236
2383
  spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
2237
 
  if $pkg_config --atleast-version=0.5.3 spice-server >/dev/null 2>&1 && \
 
2384
  if $pkg_config --atleast-version=0.6.0 spice-server >/dev/null 2>&1 && \
2238
2385
     compile_prog "$spice_cflags" "$spice_libs" ; then
2239
2386
    spice="yes"
2240
2387
    libs_softmmu="$libs_softmmu $spice_libs"
2247
2394
  fi
2248
2395
fi
2249
2396
 
 
2397
# check for libcacard for smartcard support
 
2398
if test "$smartcard" != "no" ; then
 
2399
    smartcard="yes"
 
2400
    smartcard_cflags=""
 
2401
    # TODO - what's the minimal nss version we support?
 
2402
    if test "$smartcard_nss" != "no"; then
 
2403
        if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 ; then
 
2404
            smartcard_nss="yes"
 
2405
            smartcard_cflags="-I\$(SRC_PATH)/libcacard"
 
2406
            libcacard_libs=$($pkg_config --libs nss 2>/dev/null)
 
2407
            libcacard_cflags=$($pkg_config --cflags nss 2>/dev/null)
 
2408
            QEMU_CFLAGS="$QEMU_CFLAGS $smartcard_cflags $libcacard_cflags"
 
2409
            LIBS="$libcacard_libs $LIBS"
 
2410
        else
 
2411
            if test "$smartcard_nss" = "yes"; then
 
2412
                feature_not_found "nss"
 
2413
            fi
 
2414
            smartcard_nss="no"
 
2415
        fi
 
2416
    fi
 
2417
fi
 
2418
if test "$smartcard" = "no" ; then
 
2419
    smartcard_nss="no"
 
2420
fi
 
2421
 
 
2422
# check for usbredirparser for usb network redirection support
 
2423
if test "$usb_redir" != "no" ; then
 
2424
    if $pkg_config libusbredirparser >/dev/null 2>&1 ; then
 
2425
        usb_redir="yes"
 
2426
        usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null)
 
2427
        usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null)
 
2428
        QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags"
 
2429
        LIBS="$LIBS $usb_redir_libs"
 
2430
    else
 
2431
        if test "$usb_redir" = "yes"; then
 
2432
            feature_not_found "usb-redir"
 
2433
        fi
 
2434
        usb_redir="no"
 
2435
    fi
 
2436
fi
 
2437
 
2250
2438
##########################################
2251
2439
 
2252
2440
##########################################
2255
2443
fdatasync=no
2256
2444
cat > $TMPC << EOF
2257
2445
#include <unistd.h>
2258
 
int main(void) { return fdatasync(0); }
 
2446
int main(void) {
 
2447
#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
 
2448
return fdatasync(0);
 
2449
#else
 
2450
#abort Not supported
 
2451
#endif
 
2452
}
2259
2453
EOF
2260
2454
if compile_prog "" "" ; then
2261
2455
    fdatasync=yes
2334
2528
fi
2335
2529
 
2336
2530
##########################################
 
2531
# __sync_fetch_and_and requires at least -march=i486. Many toolchains
 
2532
# use i686 as default anyway, but for those that don't, an explicit
 
2533
# specification is necessary
 
2534
if test $vhost_net = "yes" && test $cpu = "i386"; then
 
2535
  cat > $TMPC << EOF
 
2536
int sfaa(unsigned *ptr)
 
2537
{
 
2538
  return __sync_fetch_and_and(ptr, 0);
 
2539
}
 
2540
 
 
2541
int main(int argc, char **argv)
 
2542
{
 
2543
  int val = 42;
 
2544
  sfaa(&val);
 
2545
  return val;
 
2546
}
 
2547
EOF
 
2548
  if ! compile_prog "" "" ; then
 
2549
    CFLAGS+="-march=i486"
 
2550
  fi
 
2551
fi
 
2552
 
 
2553
##########################################
2337
2554
# End of CC checks
2338
2555
# After here, no more $cc or $ld runs
2339
2556
 
2390
2607
  tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
2391
2608
  if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
2392
2609
      tools="qemu-nbd\$(EXESUF) $tools"
 
2610
    if [ "$guest_agent" = "yes" ]; then
 
2611
      tools="qemu-ga\$(EXESUF) $tools"
 
2612
    fi
2393
2613
    if [ "$check_utests" = "yes" ]; then
2394
2614
      tools="check-qint check-qstring check-qdict check-qlist $tools"
2395
2615
      tools="check-qfloat check-qjson $tools"
2404
2624
        "$softmmu" = yes ; then
2405
2625
  roms="optionrom"
2406
2626
fi
2407
 
 
 
2627
if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
 
2628
  roms="$roms spapr-rtas"
 
2629
fi
2408
2630
 
2409
2631
echo "Install prefix    $prefix"
2410
2632
echo "BIOS directory    `eval echo $datadir`"
2411
2633
echo "binary directory  `eval echo $bindir`"
 
2634
echo "library directory `eval echo $libdir`"
2412
2635
echo "config directory  `eval echo $sysconfdir`"
2413
2636
if test "$mingw32" = "no" ; then
2414
2637
echo "Manual directory  `eval echo $mandir`"
2422
2645
echo "LDFLAGS           $LDFLAGS"
2423
2646
echo "make              $make"
2424
2647
echo "install           $install"
 
2648
echo "python            $python"
2425
2649
echo "host CPU          $cpu"
2426
2650
echo "host big endian   $bigendian"
2427
2651
echo "target list       $target_list"
2445
2669
echo "Extra audio cards $audio_card_list"
2446
2670
echo "Block whitelist   $block_drv_whitelist"
2447
2671
echo "Mixer emulation   $mixemu"
2448
 
echo "VNC TLS support   $vnc_tls"
2449
 
echo "VNC SASL support  $vnc_sasl"
2450
 
echo "VNC JPEG support  $vnc_jpeg"
2451
 
echo "VNC PNG support   $vnc_png"
2452
 
echo "VNC thread        $vnc_thread"
 
2672
echo "VNC support       $vnc"
 
2673
if test "$vnc" = "yes" ; then
 
2674
    echo "VNC TLS support   $vnc_tls"
 
2675
    echo "VNC SASL support  $vnc_sasl"
 
2676
    echo "VNC JPEG support  $vnc_jpeg"
 
2677
    echo "VNC PNG support   $vnc_png"
 
2678
    echo "VNC thread        $vnc_thread"
 
2679
fi
2453
2680
if test -n "$sparc_cpu"; then
2454
2681
    echo "Target Sparc Arch $sparc_cpu"
2455
2682
fi
2480
2707
echo "spice support     $spice"
2481
2708
echo "rbd support       $rbd"
2482
2709
echo "xfsctl support    $xfs"
 
2710
echo "nss used          $smartcard_nss"
 
2711
echo "usb net redir     $usb_redir"
 
2712
echo "OpenGL support    $opengl"
 
2713
echo "build guest agent $guest_agent"
2483
2714
 
2484
2715
if test $sdl_too_old = "yes"; then
2485
2716
echo "-> Your SDL version is too old - please upgrade to have SDL support"
2496
2727
echo all: >> $config_host_mak
2497
2728
echo "prefix=$prefix" >> $config_host_mak
2498
2729
echo "bindir=$bindir" >> $config_host_mak
 
2730
echo "libdir=$libdir" >> $config_host_mak
2499
2731
echo "mandir=$mandir" >> $config_host_mak
2500
2732
echo "datadir=$datadir" >> $config_host_mak
2501
2733
echo "sysconfdir=$sysconfdir" >> $config_host_mak
2503
2735
echo "confdir=$confdir" >> $config_host_mak
2504
2736
 
2505
2737
case "$cpu" in
2506
 
  i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
 
2738
  i386|x86_64|alpha|cris|hppa|ia64|lm32|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64|unicore32)
2507
2739
    ARCH=$cpu
2508
2740
  ;;
2509
2741
  armv4b|armv4l)
2599
2831
if test "$mixemu" = "yes" ; then
2600
2832
  echo "CONFIG_MIXEMU=y" >> $config_host_mak
2601
2833
fi
 
2834
if test "$vnc" = "yes" ; then
 
2835
  echo "CONFIG_VNC=y" >> $config_host_mak
 
2836
fi
2602
2837
if test "$vnc_tls" = "yes" ; then
2603
2838
  echo "CONFIG_VNC_TLS=y" >> $config_host_mak
2604
2839
  echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
2607
2842
  echo "CONFIG_VNC_SASL=y" >> $config_host_mak
2608
2843
  echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
2609
2844
fi
2610
 
if test "$vnc_jpeg" != "no" ; then
 
2845
if test "$vnc_jpeg" = "yes" ; then
2611
2846
  echo "CONFIG_VNC_JPEG=y" >> $config_host_mak
2612
2847
  echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak
2613
2848
fi
2614
 
if test "$vnc_png" != "no" ; then
 
2849
if test "$vnc_png" = "yes" ; then
2615
2850
  echo "CONFIG_VNC_PNG=y" >> $config_host_mak
2616
2851
  echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak
2617
2852
fi
2618
 
if test "$vnc_thread" != "no" ; then
 
2853
if test "$vnc_thread" = "yes" ; then
2619
2854
  echo "CONFIG_VNC_THREAD=y" >> $config_host_mak
2620
 
  echo "CONFIG_THREAD=y" >> $config_host_mak
2621
2855
fi
2622
2856
if test "$fnmatch" = "yes" ; then
2623
2857
  echo "CONFIG_FNMATCH=y" >> $config_host_mak
2676
2910
if test "$dup3" = "yes" ; then
2677
2911
  echo "CONFIG_DUP3=y" >> $config_host_mak
2678
2912
fi
 
2913
if test "$epoll" = "yes" ; then
 
2914
  echo "CONFIG_EPOLL=y" >> $config_host_mak
 
2915
fi
 
2916
if test "$epoll_create1" = "yes" ; then
 
2917
  echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak
 
2918
fi
 
2919
if test "$epoll_pwait" = "yes" ; then
 
2920
  echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak
 
2921
fi
2679
2922
if test "$inotify" = "yes" ; then
2680
2923
  echo "CONFIG_INOTIFY=y" >> $config_host_mak
2681
2924
fi
2699
2942
  echo "CONFIG_BLUEZ=y" >> $config_host_mak
2700
2943
  echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
2701
2944
fi
 
2945
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
2702
2946
if test "$xen" = "yes" ; then
2703
 
  echo "CONFIG_XEN=y" >> $config_host_mak
 
2947
  echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
 
2948
  echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
2704
2949
fi
2705
2950
if test "$io_thread" = "yes" ; then
2706
2951
  echo "CONFIG_IOTHREAD=y" >> $config_host_mak
2707
 
  echo "CONFIG_THREAD=y" >> $config_host_mak
2708
2952
fi
2709
2953
if test "$linux_aio" = "yes" ; then
2710
2954
  echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
2752
2996
  echo "CONFIG_SPICE=y" >> $config_host_mak
2753
2997
fi
2754
2998
 
 
2999
if test "$smartcard" = "yes" ; then
 
3000
  echo "CONFIG_SMARTCARD=y" >> $config_host_mak
 
3001
fi
 
3002
 
 
3003
if test "$smartcard_nss" = "yes" ; then
 
3004
  echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak
 
3005
fi
 
3006
 
 
3007
if test "$usb_redir" = "yes" ; then
 
3008
  echo "CONFIG_USB_REDIR=y" >> $config_host_mak
 
3009
fi
 
3010
 
 
3011
if test "$opengl" = "yes" ; then
 
3012
  echo "CONFIG_OPENGL=y" >> $config_host_mak
 
3013
fi
 
3014
 
2755
3015
# XXX: suppress that
2756
3016
if [ "$bsd" = "yes" ] ; then
2757
3017
  echo "CONFIG_BSD=y" >> $config_host_mak
2785
3045
fi
2786
3046
# Set the appropriate trace file.
2787
3047
if test "$trace_backend" = "simple"; then
2788
 
  trace_file="\"$trace_file-%u\""
 
3048
  trace_file="\"$trace_file-\" FMT_pid"
2789
3049
fi
2790
3050
if test "$trace_backend" = "dtrace" -a "$trace_backend_stap" = "yes" ; then
2791
3051
  echo "CONFIG_SYSTEMTAP_TRACE=y" >> $config_host_mak
2799
3059
echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
2800
3060
echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
2801
3061
echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
 
3062
echo "PYTHON=$python" >> $config_host_mak
2802
3063
echo "CC=$cc" >> $config_host_mak
2803
3064
echo "CC_I386=$cc_i386" >> $config_host_mak
2804
3065
echo "HOST_CC=$host_cc" >> $config_host_mak
2806
3067
echo "OBJCOPY=$objcopy" >> $config_host_mak
2807
3068
echo "LD=$ld" >> $config_host_mak
2808
3069
echo "WINDRES=$windres" >> $config_host_mak
 
3070
echo "LIBTOOL=$libtool" >> $config_host_mak
2809
3071
echo "CFLAGS=$CFLAGS" >> $config_host_mak
2810
3072
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
2811
3073
echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
2850
3112
target_bigendian="no"
2851
3113
 
2852
3114
case "$target_arch2" in
2853
 
  armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus)
 
3115
  armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus)
2854
3116
  target_bigendian=yes
2855
3117
  ;;
2856
3118
esac
2897
3159
mkdir -p $target_dir/fpu
2898
3160
mkdir -p $target_dir/tcg
2899
3161
mkdir -p $target_dir/ide
 
3162
mkdir -p $target_dir/9pfs
2900
3163
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
2901
3164
  mkdir -p $target_dir/nwfpe
2902
3165
fi
2910
3173
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
2911
3174
echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
2912
3175
gdb_xml_files=""
 
3176
target_short_alignment=2
 
3177
target_int_alignment=4
 
3178
target_long_alignment=4
 
3179
target_llong_alignment=8
 
3180
target_libs_softmmu=
2913
3181
 
2914
3182
TARGET_ARCH="$target_arch2"
2915
3183
TARGET_BASE_ARCH=""
2917
3185
 
2918
3186
case "$target_arch2" in
2919
3187
  i386)
2920
 
    target_phys_bits=32
 
3188
    target_phys_bits=64
2921
3189
  ;;
2922
3190
  x86_64)
2923
3191
    TARGET_BASE_ARCH=i386
2924
3192
    target_phys_bits=64
 
3193
    target_long_alignment=8
2925
3194
  ;;
2926
3195
  alpha)
2927
3196
    target_phys_bits=64
 
3197
    target_long_alignment=8
2928
3198
    target_nptl="yes"
2929
3199
  ;;
2930
3200
  arm|armeb)
2933
3203
    target_nptl="yes"
2934
3204
    gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
2935
3205
    target_phys_bits=32
 
3206
    target_llong_alignment=4
2936
3207
  ;;
2937
3208
  cris)
2938
3209
    target_nptl="yes"
2939
3210
    target_phys_bits=32
2940
3211
  ;;
 
3212
  lm32)
 
3213
    target_phys_bits=32
 
3214
    target_libs_softmmu="$opengl_libs"
 
3215
  ;;
2941
3216
  m68k)
2942
3217
    bflt="yes"
2943
3218
    gdb_xml_files="cf-core.xml cf-fp.xml"
2944
3219
    target_phys_bits=32
 
3220
    target_int_alignment=2
 
3221
    target_long_alignment=2
 
3222
    target_llong_alignment=2
2945
3223
  ;;
2946
 
  microblaze)
 
3224
  microblaze|microblazeel)
 
3225
    TARGET_ARCH=microblaze
2947
3226
    bflt="yes"
2948
3227
    target_nptl="yes"
2949
3228
    target_phys_bits=32
 
3229
    target_libs_softmmu="$fdt_libs"
2950
3230
  ;;
2951
3231
  mips|mipsel)
2952
3232
    TARGET_ARCH=mips
2965
3245
    TARGET_BASE_ARCH=mips
2966
3246
    echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
2967
3247
    target_phys_bits=64
 
3248
    target_long_alignment=8
2968
3249
  ;;
2969
3250
  ppc)
2970
3251
    gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2971
3252
    target_phys_bits=32
2972
3253
    target_nptl="yes"
 
3254
    target_libs_softmmu="$fdt_libs"
2973
3255
  ;;
2974
3256
  ppcemb)
2975
3257
    TARGET_BASE_ARCH=ppc
2977
3259
    gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2978
3260
    target_phys_bits=64
2979
3261
    target_nptl="yes"
 
3262
    target_libs_softmmu="$fdt_libs"
2980
3263
  ;;
2981
3264
  ppc64)
2982
3265
    TARGET_BASE_ARCH=ppc
2983
3266
    TARGET_ABI_DIR=ppc
2984
3267
    gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2985
3268
    target_phys_bits=64
 
3269
    target_long_alignment=8
 
3270
    target_libs_softmmu="$fdt_libs"
2986
3271
  ;;
2987
3272
  ppc64abi32)
2988
3273
    TARGET_ARCH=ppc64
2991
3276
    echo "TARGET_ABI32=y" >> $config_target_mak
2992
3277
    gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2993
3278
    target_phys_bits=64
 
3279
    target_libs_softmmu="$fdt_libs"
2994
3280
  ;;
2995
3281
  sh4|sh4eb)
2996
3282
    TARGET_ARCH=sh4
3004
3290
  sparc64)
3005
3291
    TARGET_BASE_ARCH=sparc
3006
3292
    target_phys_bits=64
 
3293
    target_long_alignment=8
3007
3294
  ;;
3008
3295
  sparc32plus)
3009
3296
    TARGET_ARCH=sparc64
3013
3300
    target_phys_bits=64
3014
3301
  ;;
3015
3302
  s390x)
 
3303
    target_nptl="yes"
3016
3304
    target_phys_bits=64
 
3305
    target_long_alignment=8
 
3306
  ;;
 
3307
  unicore32)
 
3308
    target_phys_bits=32
3017
3309
  ;;
3018
3310
  *)
3019
3311
    echo "Unsupported target CPU"
3020
3312
    exit 1
3021
3313
  ;;
3022
3314
esac
 
3315
echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
 
3316
echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
 
3317
echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
 
3318
echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak
3023
3319
echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
3024
3320
target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`"
3025
3321
echo "TARGET_$target_arch_name=y" >> $config_target_mak
3036
3332
case "$target_arch2" in
3037
3333
  i386|x86_64)
3038
3334
    if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
 
3335
      target_phys_bits=64
3039
3336
      echo "CONFIG_XEN=y" >> $config_target_mak
 
3337
      if test "$cpu" = "i386" -o "$cpu" = "x86_64"; then
 
3338
          echo "CONFIG_XEN_MAPCACHE=y" >> $config_target_mak
 
3339
      fi
3040
3340
    fi
3041
3341
esac
3042
3342
case "$target_arch2" in
3046
3346
      \( "$target_arch2" = "$cpu" -o \
3047
3347
      \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \
3048
3348
      \( "$target_arch2" = "ppc64"  -a "$cpu" = "ppc" \) -o \
 
3349
      \( "$target_arch2" = "ppc"    -a "$cpu" = "ppc64" \) -o \
 
3350
      \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \) -o \
3049
3351
      \( "$target_arch2" = "x86_64" -a "$cpu" = "i386"   \) -o \
3050
3352
      \( "$target_arch2" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
3051
3353
      echo "CONFIG_KVM=y" >> $config_target_mak
3052
 
      echo "KVM_CFLAGS=$kvm_cflags" >> $config_target_mak
3053
 
      if test "$kvm_para" = "yes"; then
3054
 
        echo "CONFIG_KVM_PARA=y" >> $config_target_mak
3055
 
      fi
3056
3354
      if test $vhost_net = "yes" ; then
3057
3355
        echo "CONFIG_VHOST_NET=y" >> $config_target_mak
3058
3356
      fi
3064
3362
if test "$target_softmmu" = "yes" ; then
3065
3363
  echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak
3066
3364
  echo "CONFIG_SOFTMMU=y" >> $config_target_mak
3067
 
  echo "LIBS+=$libs_softmmu" >> $config_target_mak
 
3365
  echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak
3068
3366
  echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak
3069
3367
  echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
3070
3368
fi
3077
3375
if test "$target_darwin_user" = "yes" ; then
3078
3376
  echo "CONFIG_DARWIN_USER=y" >> $config_target_mak
3079
3377
fi
 
3378
if test "$smartcard_nss" = "yes" ; then
 
3379
  echo "subdir-$target: subdir-libcacard" >> $config_host_mak
 
3380
  echo "libcacard_libs=$libcacard_libs" >> $config_host_mak
 
3381
  echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak
 
3382
fi
3080
3383
list=""
3081
3384
if test ! -z "$gdb_xml_files" ; then
3082
3385
  for x in $gdb_xml_files; do
3085
3388
  echo "TARGET_XML_FILES=$list" >> $config_target_mak
3086
3389
fi
3087
3390
 
3088
 
case "$target_arch2" in
3089
 
  i386|x86_64)
3090
 
    echo "CONFIG_NOSOFTFLOAT=y" >> $config_target_mak
3091
 
    ;;
3092
 
  *)
3093
 
    echo "CONFIG_SOFTFLOAT=y" >> $config_target_mak
3094
 
    ;;
3095
 
esac
3096
 
 
3097
3391
if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
3098
3392
  echo "TARGET_HAS_BFLT=y" >> $config_target_mak
3099
3393
fi
3162
3456
    echo "CONFIG_M68K_DIS=y"  >> $config_target_mak
3163
3457
    echo "CONFIG_M68K_DIS=y"  >> $libdis_config_mak
3164
3458
  ;;
3165
 
  microblaze)
 
3459
  microblaze*)
3166
3460
    echo "CONFIG_MICROBLAZE_DIS=y"  >> $config_target_mak
3167
3461
    echo "CONFIG_MICROBLAZE_DIS=y"  >> $libdis_config_mak
3168
3462
  ;;
3201
3495
  arm)
3202
3496
    cflags="-DHAS_AUDIO $cflags"
3203
3497
  ;;
 
3498
  lm32)
 
3499
    cflags="-DHAS_AUDIO $cflags"
 
3500
  ;;
3204
3501
  i386|mips|ppc)
3205
3502
    cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
3206
3503
  ;;
3247
3544
  esac
3248
3545
fi
3249
3546
 
 
3547
# use included Linux headers
 
3548
if test "$linux" = "yes" ; then
 
3549
  includes="-I\$(SRC_PATH)/linux-headers $includes"
 
3550
  mkdir -p linux-headers
 
3551
  case "$cpu" in
 
3552
  i386|x86_64)
 
3553
    symlink $source_path/linux-headers/asm-x86 linux-headers/asm
 
3554
    ;;
 
3555
  ppcemb|ppc|ppc64)
 
3556
    symlink $source_path/linux-headers/asm-powerpc linux-headers/asm
 
3557
    ;;
 
3558
  s390x)
 
3559
    symlink $source_path/linux-headers/asm-s390 linux-headers/asm
 
3560
    ;;
 
3561
  esac
 
3562
fi
 
3563
 
3250
3564
echo "LDFLAGS+=$ldflags" >> $config_target_mak
3251
3565
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
3252
3566
echo "QEMU_INCLUDES+=$includes" >> $config_target_mak
3255
3569
 
3256
3570
# build tree in object directory in case the source is not in the current directory
3257
3571
DIRS="tests tests/cris slirp audio block net pc-bios/optionrom"
 
3572
DIRS="$DIRS pc-bios/spapr-rtas"
3258
3573
DIRS="$DIRS roms/seabios roms/vgabios"
3259
3574
DIRS="$DIRS fsdev ui"
 
3575
DIRS="$DIRS qapi"
 
3576
DIRS="$DIRS qga"
3260
3577
FILES="Makefile tests/Makefile"
3261
3578
FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
3262
3579
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
 
3580
FILES="$FILES pc-bios/spapr-rtas/Makefile"
3263
3581
FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
3264
 
for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.dtb $source_path/pc-bios/openbios-*; do
 
3582
for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.rom $source_path/pc-bios/*.dtb $source_path/pc-bios/openbios-*; do
3265
3583
    FILES="$FILES pc-bios/`basename $bios_file`"
3266
3584
done
3267
3585
mkdir -p $DIRS
3268
3586
for f in $FILES ; do
3269
 
    test -e $f || symlink $source_path/$f $f
 
3587
    if [ -e "$source_path/$f" ] && ! [ -e "$f" ]; then
 
3588
        symlink "$source_path/$f" "$f"
 
3589
    fi
3270
3590
done
3271
3591
 
3272
3592
# temporary config to build submodules
3287
3607
  mkdir -p $d
3288
3608
  mkdir -p $d/ide
3289
3609
  symlink $source_path/Makefile.hw $d/Makefile
 
3610
  mkdir -p $d/9pfs
3290
3611
  echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
3291
3612
done
3292
3613
 
 
3614
if [ "$source_path" != `pwd` ]; then
 
3615
    # out of tree build
 
3616
    mkdir -p libcacard
 
3617
    rm -f libcacard/Makefile
 
3618
    symlink "$source_path/libcacard/Makefile" libcacard/Makefile
 
3619
fi
 
3620
 
3293
3621
d=libuser
3294
3622
mkdir -p $d
3295
3623
symlink $source_path/Makefile.user $d/Makefile