]> Git Repo - qemu.git/blame - configure
more ACPI definition to keep Solaris Happy (Juergen Kiel)
[qemu.git] / configure
CommitLineData
7d13299d
FB
1#!/bin/sh
2#
3ef693a0 3# qemu configure script (c) 2003 Fabrice Bellard
7d13299d
FB
4#
5# set temporary file name
6if test ! -z "$TMPDIR" ; then
7 TMPDIR1="${TMPDIR}"
8elif test ! -z "$TEMPDIR" ; then
9 TMPDIR1="${TEMPDIR}"
10else
11 TMPDIR1="/tmp"
12fi
13
3ef693a0
FB
14TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
17TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
7d13299d
FB
18
19# default parameters
11d9f695 20prefix=""
1e43adfc 21interp_prefix="/usr/gnemul/qemu-%M"
43ce4dfe 22static="no"
7d13299d
FB
23cross_prefix=""
24cc="gcc"
25host_cc="gcc"
26ar="ar"
27make="make"
6a882643 28install="install"
7d13299d
FB
29strip="strip"
30cpu=`uname -m`
5327cf48 31target_list=""
7d13299d
FB
32case "$cpu" in
33 i386|i486|i586|i686|i86pc|BePC)
97a847bc 34 cpu="i386"
7d13299d 35 ;;
ba68055e 36 armv*b)
808c4954
FB
37 cpu="armv4b"
38 ;;
ba68055e 39 armv*l)
7d13299d
FB
40 cpu="armv4l"
41 ;;
42 alpha)
43 cpu="alpha"
44 ;;
295defa5 45 "Power Macintosh"|ppc|ppc64)
7d13299d
FB
46 cpu="powerpc"
47 ;;
48 mips)
49 cpu="mips"
50 ;;
fb3e5849
FB
51 s390)
52 cpu="s390"
53 ;;
94ac5158 54 sparc|sun4[muv])
ae228531
FB
55 cpu="sparc"
56 ;;
57 sparc64)
58 cpu="sparc64"
59 ;;
a8baa8c5
FB
60 ia64)
61 cpu="ia64"
62 ;;
38e584a0
FB
63 m68k)
64 cpu="m68k"
65 ;;
bc51c5c9 66 x86_64|amd64)
0b0babc6 67 cpu="x86_64"
bc51c5c9 68 ;;
7d13299d
FB
69 *)
70 cpu="unknown"
71 ;;
72esac
73gprof="no"
74bigendian="no"
67b915a5
FB
75mingw32="no"
76EXESUF=""
77gdbstub="yes"
443f1376 78slirp="yes"
fb065187
FB
79adlib="no"
80oss="no"
1d14ffa9
FB
81dsound="no"
82coreaudio="no"
83alsa="no"
102a52e4
FB
84fmod="no"
85fmod_lib=""
86fmod_inc=""
b1a550a0 87bsd="no"
5327cf48 88linux="no"
c9ec1fe4 89kqemu="no"
05c2a3e7 90profiler="no"
c9ec1fe4 91kernel_path=""
5b0753e0 92cocoa="no"
97ccc689 93check_gfx="yes"
1aff381f 94check_gcc="yes"
0a8e90f4
PB
95softmmu="yes"
96user="no"
cc8ae6de 97build_docs="no"
c5937220 98uname_release=""
7d13299d
FB
99
100# OS specific
101targetos=`uname -s`
102case $targetos in
c326e0af
FB
103CYGWIN*)
104mingw32="yes"
105CFLAGS="-O2 -mno-cygwin"
106;;
67b915a5
FB
107MINGW32*)
108mingw32="yes"
109;;
7d3505c5
FB
110FreeBSD)
111bsd="yes"
fb065187 112oss="yes"
e99f9060 113if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
07f4ddbf
FB
114 kqemu="yes"
115fi
7d3505c5
FB
116;;
117NetBSD)
118bsd="yes"
fb065187 119oss="yes"
7d3505c5
FB
120;;
121OpenBSD)
122bsd="yes"
fb065187 123oss="yes"
7d3505c5 124;;
83fb7adf
FB
125Darwin)
126bsd="yes"
127darwin="yes"
128;;
ec530c81
FB
129SunOS)
130solaris="yes"
131;;
1d14ffa9 132*)
fb065187 133oss="yes"
5327cf48 134linux="yes"
0a8e90f4 135user="yes"
07f4ddbf 136if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
c9ec1fe4
FB
137 kqemu="yes"
138fi
fb065187 139;;
7d13299d
FB
140esac
141
7d3505c5 142if [ "$bsd" = "yes" ] ; then
b1a550a0 143 if [ "$darwin" != "yes" ] ; then
83fb7adf
FB
144 make="gmake"
145 fi
7d3505c5
FB
146fi
147
ec530c81
FB
148if [ "$solaris" = "yes" ] ; then
149 make="gmake"
150 install="ginstall"
151 solarisrev=`uname -r | cut -f2 -d.`
ec530c81
FB
152fi
153
7d13299d 154# find source path
ad064840
PB
155source_path=`dirname "$0"`
156if [ -z "$source_path" ]; then
7d13299d 157 source_path=`pwd`
ad064840
PB
158else
159 source_path=`cd "$source_path"; pwd`
160fi
161if test "$source_path" = `pwd` ; then
7d13299d 162 source_path_used="no"
ad064840
PB
163else
164 source_path_used="yes"
7d13299d
FB
165fi
166
167for opt do
a46e4035 168 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
7d13299d 169 case "$opt" in
2efc3265
FB
170 --help|-h) show_help=yes
171 ;;
b1a550a0 172 --prefix=*) prefix="$optarg"
7d13299d 173 ;;
b1a550a0 174 --interp-prefix=*) interp_prefix="$optarg"
32ce6337 175 ;;
b1a550a0 176 --source-path=*) source_path="$optarg"
ad064840 177 source_path_used="yes"
7d13299d 178 ;;
b1a550a0 179 --cross-prefix=*) cross_prefix="$optarg"
7d13299d 180 ;;
b1a550a0 181 --cc=*) cc="$optarg"
7d13299d 182 ;;
b1a550a0 183 --host-cc=*) host_cc="$optarg"
83469015 184 ;;
b1a550a0 185 --make=*) make="$optarg"
7d13299d 186 ;;
6a882643
PB
187 --install=*) install="$optarg"
188 ;;
b1a550a0 189 --extra-cflags=*) CFLAGS="$optarg"
7d13299d 190 ;;
b1a550a0 191 --extra-ldflags=*) LDFLAGS="$optarg"
7d13299d 192 ;;
b1a550a0 193 --cpu=*) cpu="$optarg"
7d13299d 194 ;;
b1a550a0 195 --target-list=*) target_list="$optarg"
de83cd02 196 ;;
7d13299d
FB
197 --enable-gprof) gprof="yes"
198 ;;
43ce4dfe
FB
199 --static) static="yes"
200 ;;
97a847bc
FB
201 --disable-sdl) sdl="no"
202 ;;
1d14ffa9
FB
203 --enable-coreaudio) coreaudio="yes"
204 ;;
205 --enable-alsa) alsa="yes"
206 ;;
207 --enable-dsound) dsound="yes"
208 ;;
102a52e4
FB
209 --enable-fmod) fmod="yes"
210 ;;
b1a550a0 211 --fmod-lib=*) fmod_lib="$optarg"
102a52e4 212 ;;
b1a550a0 213 --fmod-inc=*) fmod_inc="$optarg"
102a52e4 214 ;;
67b915a5 215 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
1d14ffa9 216 ;;
443f1376 217 --disable-slirp) slirp="no"
1d14ffa9 218 ;;
fb065187 219 --enable-adlib) adlib="yes"
1d14ffa9 220 ;;
c9ec1fe4 221 --disable-kqemu) kqemu="no"
1d14ffa9 222 ;;
05c2a3e7
FB
223 --enable-profiler) profiler="yes"
224 ;;
b1a550a0 225 --kernel-path=*) kernel_path="$optarg"
1d14ffa9
FB
226 ;;
227 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
228 ;;
97ccc689
FB
229 --disable-gfx-check) check_gfx="no"
230 ;;
1aff381f
FB
231 --disable-gcc-check) check_gcc="no"
232 ;;
cad25d69 233 --disable-system) softmmu="no"
0a8e90f4 234 ;;
cad25d69 235 --enable-system) softmmu="yes"
0a8e90f4
PB
236 ;;
237 --disable-user) user="no"
238 ;;
239 --enable-user) user="yes"
240 ;;
c5937220
PB
241 --enable-uname-release=*) uname_release="$optarg"
242 ;;
7d13299d
FB
243 esac
244done
245
246# Checking for CFLAGS
247if test -z "$CFLAGS"; then
248 CFLAGS="-O2"
249fi
250
af5db58e
PB
251if test x"$show_help" = x"yes" ; then
252cat << EOF
253
254Usage: configure [options]
255Options: [defaults in brackets after descriptions]
256
257EOF
258echo "Standard options:"
259echo " --help print this message"
260echo " --prefix=PREFIX install in PREFIX [$prefix]"
261echo " --interp-prefix=PREFIX where to find shared libraries, etc."
262echo " use %M for cpu name [$interp_prefix]"
263echo " --target-list=LIST set target list [$target_list]"
264echo ""
265echo "kqemu kernel acceleration support:"
266echo " --disable-kqemu disable kqemu support"
267echo " --kernel-path=PATH set the kernel path (configure probes it)"
268echo ""
269echo "Advanced options (experts only):"
270echo " --source-path=PATH path of source code [$source_path]"
271echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
272echo " --cc=CC use C compiler CC [$cc]"
273echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
274echo " --make=MAKE use specified make [$make]"
6a882643 275echo " --install=INSTALL use specified install [$install]"
af5db58e
PB
276echo " --static enable static build [$static]"
277echo " --enable-cocoa enable COCOA (Mac OS X only)"
278echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
279echo " --enable-adlib enable Adlib emulation"
280echo " --enable-coreaudio enable Coreaudio audio driver"
281echo " --enable-alsa enable ALSA audio driver"
282echo " --enable-fmod enable FMOD audio driver"
283echo " --enabled-dsound enable DirectSound audio driver"
284echo " --enable-system enable all system emulation targets"
285echo " --disable-system disable all system emulation targets"
286echo " --enable-user enable all linux usermode emulation targets"
287echo " --disable-user disable all linux usermode emulation targets"
288echo " --fmod-lib path to FMOD library"
289echo " --fmod-inc path to FMOD includes"
c5937220 290echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
af5db58e
PB
291echo ""
292echo "NOTE: The object files are build at the place where configure is launched"
293exit 1
294fi
295
7d13299d
FB
296cc="${cross_prefix}${cc}"
297ar="${cross_prefix}${ar}"
298strip="${cross_prefix}${strip}"
299
064aae13
PB
300# check that the C compiler works.
301cat > $TMPC <<EOF
302int main(void) {}
303EOF
304
305if $cc -c -o $TMPO $TMPC 2>/dev/null ; then
306 : C compiler works ok
307else
308 echo "ERROR: \"$cc\" either does not exist or does not work"
309 exit 1
a7350fa1
FB
310fi
311
67b915a5 312if test "$mingw32" = "yes" ; then
5327cf48 313 linux="no"
67b915a5 314 EXESUF=".exe"
9f059eca 315 oss="no"
07f4ddbf
FB
316 if [ "$cpu" = "i386" ] ; then
317 kqemu="yes"
318 fi
67b915a5
FB
319fi
320
ec530c81
FB
321#
322# Solaris specific configure tool chain decisions
323#
324if test "$solaris" = "yes" ; then
325 #
326 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
327 # override the check with --disable-gcc-check
328 #
329 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
330 solgcc=`which $cc`
331 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
332 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
333 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
334 echo "or get the latest patch from SunSolve for gcc"
335 exit 1
336 fi
337 fi
338 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
339 if test -z "$solinst" ; then
340 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
341 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
342 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
343 exit 1
344 fi
345 if test "$solinst" = "/usr/sbin/install" ; then
346 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
347 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
348 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
349 exit 1
350 fi
ec530c81
FB
351 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
352 if test -z "$sol_ar" ; then
353 echo "Error: No path includes ar"
354 if test -f /usr/ccs/bin/ar ; then
355 echo "Add /usr/ccs/bin to your path and rerun configure"
356 fi
357 exit 1
358 fi
359fi
360
361
5327cf48
FB
362if test -z "$target_list" ; then
363# these targets are portable
0a8e90f4
PB
364 if [ "$softmmu" = "yes" ] ; then
365 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
366 fi
5327cf48 367# the following are Linux specific
0a8e90f4 368 if [ "$user" = "yes" ] ; then
215cf0be 369 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
5327cf48 370 fi
6e20a45f 371else
b1a550a0 372 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
5327cf48 373fi
0a8e90f4
PB
374if test -z "$target_list" ; then
375 echo "No targets enabled"
376 exit 1
377fi
5327cf48 378
7d13299d
FB
379if test -z "$cross_prefix" ; then
380
381# ---
382# big/little endian test
383cat > $TMPC << EOF
384#include <inttypes.h>
385int main(int argc, char ** argv){
1d14ffa9
FB
386 volatile uint32_t i=0x01234567;
387 return (*((uint8_t*)(&i))) == 0x67;
7d13299d
FB
388}
389EOF
390
391if $cc -o $TMPE $TMPC 2>/dev/null ; then
392$TMPE && bigendian="yes"
393else
394echo big/little test failed
395fi
396
397else
398
399# if cross compiling, cannot launch a program, so make a static guess
808c4954 400if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
7d13299d
FB
401 bigendian="yes"
402fi
403
404fi
405
b6853697
FB
406# host long bits test
407hostlongbits="32"
408if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
409 hostlongbits="64"
410fi
411
e8cd23de 412# check gcc options support
04369ff2
FB
413cat > $TMPC <<EOF
414int main(void) {
04369ff2
FB
415}
416EOF
417
e8cd23de
FB
418have_gcc3_options="no"
419if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
420 have_gcc3_options="yes"
04369ff2 421fi
ca735206 422
b1a550a0 423# Check for gcc4, error if pre-gcc4
1aff381f
FB
424if test "$check_gcc" = "yes" ; then
425 cat > $TMPC <<EOF
b1a550a0
PB
426#if __GNUC__ < 4
427#error gcc3
1aff381f
FB
428#endif
429int main(){return 0;}
430EOF
b1a550a0 431 if $cc -o $TMPO $TMPC 2>/dev/null ; then
1aff381f
FB
432 echo "ERROR: \"$cc\" looks like gcc 4.x"
433 echo "QEMU is known to have problems when compiled with gcc 4.x"
434 echo "It is recommended that you use gcc 3.x to build QEMU"
435 echo "To use this compiler anyway, configure with --disable-gcc-check"
436 exit 1;
437 fi
438fi
439
11d9f695
FB
440##########################################
441# SDL probe
442
443sdl_too_old=no
444
445if test -z "$sdl" ; then
446
a6e022ad
FB
447sdl_config="sdl-config"
448sdl=no
7c1f25b4 449sdl_static=no
a6e022ad
FB
450
451if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
452# win32 cross compilation case
453 sdl_config="i386-mingw32msvc-sdl-config"
454 sdl=yes
455else
456# normal SDL probe
11d9f695
FB
457cat > $TMPC << EOF
458#include <SDL.h>
459#undef main /* We don't want SDL to override our main() */
460int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
461EOF
462
a6e022ad
FB
463if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
464_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
11d9f695
FB
465if test "$_sdlversion" -lt 121 ; then
466sdl_too_old=yes
467else
468sdl=yes
469fi
7c1f25b4
FB
470
471# static link with sdl ?
472if test "$sdl" = "yes" ; then
473aa="no"
474`$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
475sdl_static_libs=`$sdl_config --static-libs`
476if [ "$aa" = "yes" ] ; then
d8d8aa4e 477 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
7c1f25b4
FB
478fi
479
480if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
481 sdl_static=yes
11d9f695
FB
482fi
483
7c1f25b4
FB
484fi # static link
485
486fi # sdl compile test
487
a6e022ad
FB
488fi # cross compilation
489fi # -z $sdl
11d9f695 490
cc8ae6de 491# Check if tools are available to build documentation.
94ac5158 492if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
cc8ae6de
PB
493 build_docs="yes"
494fi
495
11d9f695
FB
496if test "$mingw32" = "yes" ; then
497if test -z "$prefix" ; then
498 prefix="/c/Program Files/Qemu"
499fi
500mandir="$prefix"
7efa4387 501datadir="$prefix"
1f50f8d1 502docdir="$prefix"
11d9f695
FB
503bindir="$prefix"
504else
505if test -z "$prefix" ; then
506 prefix="/usr/local"
507fi
5a67135a 508mandir="$prefix/share/man"
7efa4387 509datadir="$prefix/share/qemu"
1f50f8d1 510docdir="$prefix/share/doc/qemu"
11d9f695
FB
511bindir="$prefix/bin"
512fi
5a67135a 513
43ce4dfe 514echo "Install prefix $prefix"
7efa4387 515echo "BIOS directory $datadir"
11d9f695
FB
516echo "binary directory $bindir"
517if test "$mingw32" = "no" ; then
518echo "Manual directory $mandir"
43ce4dfe 519echo "ELF interp prefix $interp_prefix"
11d9f695 520fi
5a67135a 521echo "Source path $source_path"
43ce4dfe 522echo "C compiler $cc"
83469015 523echo "Host C compiler $host_cc"
43ce4dfe 524echo "make $make"
6a882643 525echo "install $install"
43ce4dfe 526echo "host CPU $cpu"
de83cd02 527echo "host big endian $bigendian"
97a847bc 528echo "target list $target_list"
43ce4dfe 529echo "gprof enabled $gprof"
05c2a3e7 530echo "profiler $profiler"
43ce4dfe 531echo "static build $static"
5b0753e0
FB
532if test "$darwin" = "yes" ; then
533 echo "Cocoa support $cocoa"
534fi
97a847bc 535echo "SDL support $sdl"
e4afee97
FB
536if test "$sdl" != "no" ; then
537 echo "SDL static link $sdl_static"
538fi
67b915a5 539echo "mingw32 support $mingw32"
fb065187 540echo "Adlib support $adlib"
1d14ffa9
FB
541echo "CoreAudio support $coreaudio"
542echo "ALSA support $alsa"
543echo "DSound support $dsound"
1d14ffa9
FB
544if test "$fmod" = "yes"; then
545 if test -z $fmod_lib || test -z $fmod_inc; then
546 echo
547 echo "Error: You must specify path to FMOD library and headers"
548 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
549 echo
550 exit 1
551 fi
b1a550a0
PB
552 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
553else
554 fmod_support=""
102a52e4 555fi
b1a550a0 556echo "FMOD support $fmod $fmod_support"
07f4ddbf 557echo "kqemu support $kqemu"
cc8ae6de 558echo "Documentation $build_docs"
c5937220
PB
559[ ! -z "$uname_release" ] && \
560echo "uname -r $uname_release"
67b915a5 561
97a847bc 562if test $sdl_too_old = "yes"; then
24b55b96 563echo "-> Your SDL version is too old - please upgrade to have SDL support"
7c1f25b4 564fi
24b55b96
FB
565#if test "$sdl_static" = "no"; then
566# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
567#fi
97a847bc
FB
568config_mak="config-host.mak"
569config_h="config-host.h"
7d13299d 570
7c1f25b4 571#echo "Creating $config_mak and $config_h"
7d13299d 572
97a847bc 573echo "# Automatically generated by configure - do not modify" > $config_mak
29517134 574echo "# Configured with: $0 $@" >> $config_mak
97a847bc 575echo "/* Automatically generated by configure - do not modify */" > $config_h
7d13299d 576
97a847bc 577echo "prefix=$prefix" >> $config_mak
11d9f695 578echo "bindir=$bindir" >> $config_mak
5a67135a 579echo "mandir=$mandir" >> $config_mak
7efa4387 580echo "datadir=$datadir" >> $config_mak
1f50f8d1 581echo "docdir=$docdir" >> $config_mak
7efa4387 582echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
97a847bc 583echo "MAKE=$make" >> $config_mak
6a882643 584echo "INSTALL=$install" >> $config_mak
97a847bc 585echo "CC=$cc" >> $config_mak
e8cd23de 586if test "$have_gcc3_options" = "yes" ; then
97a847bc 587 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
e8cd23de 588fi
97a847bc
FB
589echo "HOST_CC=$host_cc" >> $config_mak
590echo "AR=$ar" >> $config_mak
591echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
592echo "CFLAGS=$CFLAGS" >> $config_mak
593echo "LDFLAGS=$LDFLAGS" >> $config_mak
67b915a5 594echo "EXESUF=$EXESUF" >> $config_mak
97a847bc
FB
595if test "$cpu" = "i386" ; then
596 echo "ARCH=i386" >> $config_mak
597 echo "#define HOST_I386 1" >> $config_h
0b0babc6
FB
598elif test "$cpu" = "x86_64" ; then
599 echo "ARCH=x86_64" >> $config_mak
600 echo "#define HOST_X86_64 1" >> $config_h
808c4954
FB
601elif test "$cpu" = "armv4b" ; then
602 echo "ARCH=arm" >> $config_mak
603 echo "#define HOST_ARM 1" >> $config_h
7d13299d 604elif test "$cpu" = "armv4l" ; then
97a847bc
FB
605 echo "ARCH=arm" >> $config_mak
606 echo "#define HOST_ARM 1" >> $config_h
7d13299d 607elif test "$cpu" = "powerpc" ; then
97a847bc
FB
608 echo "ARCH=ppc" >> $config_mak
609 echo "#define HOST_PPC 1" >> $config_h
7d13299d 610elif test "$cpu" = "mips" ; then
97a847bc
FB
611 echo "ARCH=mips" >> $config_mak
612 echo "#define HOST_MIPS 1" >> $config_h
fb3e5849 613elif test "$cpu" = "s390" ; then
97a847bc
FB
614 echo "ARCH=s390" >> $config_mak
615 echo "#define HOST_S390 1" >> $config_h
295defa5 616elif test "$cpu" = "alpha" ; then
97a847bc
FB
617 echo "ARCH=alpha" >> $config_mak
618 echo "#define HOST_ALPHA 1" >> $config_h
ae228531 619elif test "$cpu" = "sparc" ; then
97a847bc
FB
620 echo "ARCH=sparc" >> $config_mak
621 echo "#define HOST_SPARC 1" >> $config_h
ae228531 622elif test "$cpu" = "sparc64" ; then
97a847bc
FB
623 echo "ARCH=sparc64" >> $config_mak
624 echo "#define HOST_SPARC64 1" >> $config_h
a8baa8c5 625elif test "$cpu" = "ia64" ; then
97a847bc
FB
626 echo "ARCH=ia64" >> $config_mak
627 echo "#define HOST_IA64 1" >> $config_h
38e584a0 628elif test "$cpu" = "m68k" ; then
38ca2abc
FB
629 echo "ARCH=m68k" >> $config_mak
630 echo "#define HOST_M68K 1" >> $config_h
7d13299d
FB
631else
632 echo "Unsupported CPU"
633 exit 1
634fi
635if test "$bigendian" = "yes" ; then
97a847bc
FB
636 echo "WORDS_BIGENDIAN=yes" >> $config_mak
637 echo "#define WORDS_BIGENDIAN 1" >> $config_h
638fi
b6853697 639echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
67b915a5
FB
640if test "$mingw32" = "yes" ; then
641 echo "CONFIG_WIN32=yes" >> $config_mak
11d9f695 642 echo "#define CONFIG_WIN32 1" >> $config_h
7d3505c5 643elif test -f "/usr/include/byteswap.h" ; then
67b915a5
FB
644 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
645fi
83fb7adf
FB
646if test "$darwin" = "yes" ; then
647 echo "CONFIG_DARWIN=yes" >> $config_mak
648 echo "#define CONFIG_DARWIN 1" >> $config_h
649fi
ec530c81
FB
650if test "$solaris" = "yes" ; then
651 echo "CONFIG_SOLARIS=yes" >> $config_mak
38cfa06c 652 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
ec530c81 653fi
67b915a5
FB
654if test "$gdbstub" = "yes" ; then
655 echo "CONFIG_GDBSTUB=yes" >> $config_mak
656 echo "#define CONFIG_GDBSTUB 1" >> $config_h
657fi
97a847bc
FB
658if test "$gprof" = "yes" ; then
659 echo "TARGET_GPROF=yes" >> $config_mak
660 echo "#define HAVE_GPROF 1" >> $config_h
661fi
662if test "$static" = "yes" ; then
663 echo "CONFIG_STATIC=yes" >> $config_mak
50863472 664 echo "#define CONFIG_STATIC 1" >> $config_h
7d13299d 665fi
05c2a3e7
FB
666if test $profiler = "yes" ; then
667 echo "#define CONFIG_PROFILER 1" >> $config_h
668fi
c20709aa
FB
669if test "$slirp" = "yes" ; then
670 echo "CONFIG_SLIRP=yes" >> $config_mak
671 echo "#define CONFIG_SLIRP 1" >> $config_h
672fi
fb065187
FB
673if test "$adlib" = "yes" ; then
674 echo "CONFIG_ADLIB=yes" >> $config_mak
675 echo "#define CONFIG_ADLIB 1" >> $config_h
676fi
677if test "$oss" = "yes" ; then
678 echo "CONFIG_OSS=yes" >> $config_mak
679 echo "#define CONFIG_OSS 1" >> $config_h
680fi
1d14ffa9
FB
681if test "$coreaudio" = "yes" ; then
682 echo "CONFIG_COREAUDIO=yes" >> $config_mak
683 echo "#define CONFIG_COREAUDIO 1" >> $config_h
684fi
685if test "$alsa" = "yes" ; then
686 echo "CONFIG_ALSA=yes" >> $config_mak
687 echo "#define CONFIG_ALSA 1" >> $config_h
688fi
689if test "$dsound" = "yes" ; then
690 echo "CONFIG_DSOUND=yes" >> $config_mak
691 echo "#define CONFIG_DSOUND 1" >> $config_h
692fi
102a52e4
FB
693if test "$fmod" = "yes" ; then
694 echo "CONFIG_FMOD=yes" >> $config_mak
695 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
696 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
697 echo "#define CONFIG_FMOD 1" >> $config_h
698fi
b1a550a0
PB
699qemu_version=`head $source_path/VERSION`
700echo "VERSION=$qemu_version" >>$config_mak
d4b8f039 701echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
97a847bc
FB
702
703echo "SRC_PATH=$source_path" >> $config_mak
ad064840
PB
704if [ "$source_path_used" = "yes" ]; then
705 echo "VPATH=$source_path" >> $config_mak
706fi
97a847bc 707echo "TARGET_DIRS=$target_list" >> $config_mak
cc8ae6de
PB
708if [ "$build_docs" = "yes" ] ; then
709 echo "BUILD_DOCS=yes" >> $config_mak
710fi
97a847bc 711
83fb7adf 712# XXX: suppress that
7d3505c5 713if [ "$bsd" = "yes" ] ; then
43003046 714 echo "#define O_LARGEFILE 0" >> $config_h
43003046 715 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
7d3505c5
FB
716 echo "#define _BSD 1" >> $config_h
717fi
718
c5937220
PB
719echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
720
1d14ffa9 721for target in $target_list; do
97a847bc
FB
722target_dir="$target"
723config_mak=$target_dir/config.mak
724config_h=$target_dir/config.h
725target_cpu=`echo $target | cut -d '-' -f 1`
726target_bigendian="no"
808c4954 727[ "$target_cpu" = "armeb" ] && target_bigendian=yes
1e43adfc 728[ "$target_cpu" = "sparc" ] && target_bigendian=yes
64b3ab24 729[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
67867308 730[ "$target_cpu" = "ppc" ] && target_bigendian=yes
a2458627 731[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
d3258560 732[ "$target_cpu" = "mips" ] && target_bigendian=yes
97a847bc
FB
733target_softmmu="no"
734if expr $target : '.*-softmmu' > /dev/null ; then
735 target_softmmu="yes"
736fi
997344f3
FB
737target_user_only="no"
738if expr $target : '.*-user' > /dev/null ; then
739 target_user_only="yes"
740fi
97a847bc 741
97ccc689 742if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1d14ffa9 743 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
97ccc689 744 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
9c038506 745 echo "To build QEMU without graphical output configure with --disable-gfx-check"
97ccc689
FB
746 echo "Note that this will disable all output from the virtual graphics card."
747 exit 1;
748fi
749
7c1f25b4 750#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
97a847bc
FB
751
752mkdir -p $target_dir
158142c2 753mkdir -p $target_dir/fpu
808c4954 754if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then
69de927c
FB
755 mkdir -p $target_dir/nwfpe
756fi
a7e61ed4
FB
757if test "$target_user_only" = "no" ; then
758 mkdir -p $target_dir/slirp
759fi
69de927c 760
ec530c81
FB
761#
762# don't use ln -sf as not all "ln -sf" over write the file/link
763#
764rm -f $target_dir/Makefile
765ln -s $source_path/Makefile.target $target_dir/Makefile
766
97a847bc
FB
767
768echo "# Automatically generated by configure - do not modify" > $config_mak
769echo "/* Automatically generated by configure - do not modify */" > $config_h
770
de83cd02 771
97a847bc
FB
772echo "include ../config-host.mak" >> $config_mak
773echo "#include \"../config-host.h\"" >> $config_h
1e43adfc 774
e5fe0c52 775bflt="no"
1e43adfc
FB
776interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
777echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
97a847bc
FB
778
779if test "$target_cpu" = "i386" ; then
780 echo "TARGET_ARCH=i386" >> $config_mak
781 echo "#define TARGET_ARCH \"i386\"" >> $config_h
782 echo "#define TARGET_I386 1" >> $config_h
07f4ddbf 783 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
824d560f
FB
784 echo "#define USE_KQEMU 1" >> $config_h
785 fi
808c4954 786elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
97a847bc
FB
787 echo "TARGET_ARCH=arm" >> $config_mak
788 echo "#define TARGET_ARCH \"arm\"" >> $config_h
789 echo "#define TARGET_ARM 1" >> $config_h
e5fe0c52 790 bflt="yes"
1e43adfc
FB
791elif test "$target_cpu" = "sparc" ; then
792 echo "TARGET_ARCH=sparc" >> $config_mak
793 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
794 echo "#define TARGET_SPARC 1" >> $config_h
64b3ab24
FB
795elif test "$target_cpu" = "sparc64" ; then
796 echo "TARGET_ARCH=sparc64" >> $config_mak
797 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
798 echo "#define TARGET_SPARC 1" >> $config_h
799 echo "#define TARGET_SPARC64 1" >> $config_h
67867308
FB
800elif test "$target_cpu" = "ppc" ; then
801 echo "TARGET_ARCH=ppc" >> $config_mak
802 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
803 echo "#define TARGET_PPC 1" >> $config_h
a2458627
FB
804elif test "$target_cpu" = "ppc64" ; then
805 echo "TARGET_ARCH=ppc64" >> $config_mak
806 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
807 echo "#define TARGET_PPC 1" >> $config_h
808 echo "#define TARGET_PPC64 1" >> $config_h
0b0babc6
FB
809elif test "$target_cpu" = "x86_64" ; then
810 echo "TARGET_ARCH=x86_64" >> $config_mak
811 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
812 echo "#define TARGET_I386 1" >> $config_h
813 echo "#define TARGET_X86_64 1" >> $config_h
07f4ddbf
FB
814 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
815 echo "#define USE_KQEMU 1" >> $config_h
816 fi
c20eb473 817elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
d3258560
FB
818 echo "TARGET_ARCH=mips" >> $config_mak
819 echo "#define TARGET_ARCH \"mips\"" >> $config_h
820 echo "#define TARGET_MIPS 1" >> $config_h
6ea83fed
FB
821 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
822 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
fdf9b3e8
FB
823elif test "$target_cpu" = "sh4" ; then
824 echo "TARGET_ARCH=sh4" >> $config_mak
825 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
826 echo "#define TARGET_SH4 1" >> $config_h
de83cd02
FB
827else
828 echo "Unsupported target CPU"
829 exit 1
830fi
831if test "$target_bigendian" = "yes" ; then
97a847bc
FB
832 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
833 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
de83cd02 834fi
97a847bc
FB
835if test "$target_softmmu" = "yes" ; then
836 echo "CONFIG_SOFTMMU=yes" >> $config_mak
837 echo "#define CONFIG_SOFTMMU 1" >> $config_h
43ce4dfe 838fi
997344f3
FB
839if test "$target_user_only" = "yes" ; then
840 echo "CONFIG_USER_ONLY=yes" >> $config_mak
841 echo "#define CONFIG_USER_ONLY 1" >> $config_h
842fi
97a847bc 843
158142c2
FB
844if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
845 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
846 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
847fi
e5fe0c52
PB
848if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
849 echo "TARGET_HAS_BFLT=yes" >> $config_mak
850 echo "#define TARGET_HAS_BFLT 1" >> $config_h
851fi
7c1f25b4
FB
852# sdl defines
853
854if test "$target_user_only" = "no"; then
855 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
dbb2c921 856 sdl1=$sdl_static
7c1f25b4 857 else
dbb2c921
FB
858 sdl1=$sdl
859 fi
860 if test "$sdl1" = "yes" ; then
861 echo "#define CONFIG_SDL 1" >> $config_h
862 echo "CONFIG_SDL=yes" >> $config_mak
863 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
864 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
865 else
7c1f25b4
FB
866 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
867 fi
dbb2c921 868 if [ "${aa}" = "yes" ] ; then
b1a550a0
PB
869 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
870 else
871 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
dbb2c921 872 fi
7c1f25b4 873 fi
7c1f25b4
FB
874fi
875
5b0753e0
FB
876if test "$cocoa" = "yes" ; then
877 echo "#define CONFIG_COCOA 1" >> $config_h
878 echo "CONFIG_COCOA=yes" >> $config_mak
879fi
880
97a847bc 881done # for target in $targets
7d13299d
FB
882
883# build tree in object directory if source path is different from current one
884if test "$source_path_used" = "yes" ; then
885 DIRS="tests"
886 FILES="Makefile tests/Makefile"
887 for dir in $DIRS ; do
888 mkdir -p $dir
889 done
ec530c81 890 # remove the link and recreate it, as not all "ln -sf" overwrite the link
7d13299d 891 for f in $FILES ; do
ec530c81
FB
892 rm -f $f
893 ln -s $source_path/$f $f
7d13299d
FB
894 done
895fi
7d13299d 896
97a847bc 897rm -f $TMPO $TMPC $TMPE $TMPS
This page took 0.253986 seconds and 4 git commands to generate.