Revision a558ee17 configure
b/configure | ||
---|---|---|
18 | 18 |
trap "rm -f $TMPC $TMPO $TMPE ; exit" 0 2 3 15 |
19 | 19 |
|
20 | 20 |
compile_object() { |
21 |
$cc $CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null |
|
21 |
$cc $QEMU_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null
|
|
22 | 22 |
} |
23 | 23 |
|
24 | 24 |
compile_prog() { |
25 | 25 |
local_cflags="$1" |
26 | 26 |
local_ldflags="$2" |
27 |
$cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags > /dev/null 2> /dev/null |
|
27 |
$cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags > /dev/null 2> /dev/null
|
|
28 | 28 |
} |
29 | 29 |
|
30 | 30 |
# default parameters |
... | ... | |
55 | 55 |
;; |
56 | 56 |
--cpu=*) cpu="$optarg" |
57 | 57 |
;; |
58 |
--extra-cflags=*) CFLAGS="$optarg $CFLAGS"
|
|
58 |
--extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
|
|
59 | 59 |
;; |
60 | 60 |
--extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" |
61 | 61 |
;; |
... | ... | |
224 | 224 |
case $targetos in |
225 | 225 |
CYGWIN*) |
226 | 226 |
mingw32="yes" |
227 |
CFLAGS="-mno-cygwin $CFLAGS"
|
|
227 |
QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS"
|
|
228 | 228 |
audio_possible_drivers="sdl" |
229 | 229 |
;; |
230 | 230 |
MINGW32*) |
... | ... | |
277 | 277 |
[ "$is_x86_64" = "1" ] && cpu=x86_64 |
278 | 278 |
fi |
279 | 279 |
if [ "$cpu" = "x86_64" ] ; then |
280 |
CFLAGS="-arch x86_64 $CFLAGS"
|
|
280 |
QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
|
|
281 | 281 |
LDFLAGS="-arch x86_64 $LDFLAGS" |
282 | 282 |
else |
283 |
CFLAGS="-mdynamic-no-pic $CFLAGS"
|
|
283 |
QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS"
|
|
284 | 284 |
fi |
285 | 285 |
darwin_user="yes" |
286 | 286 |
cocoa="yes" |
... | ... | |
320 | 320 |
audio_drv_list="oss" |
321 | 321 |
fi |
322 | 322 |
audio_possible_drivers="oss sdl" |
323 |
CFLAGS="-std=gnu99 $CFLAGS"
|
|
323 |
QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
|
|
324 | 324 |
LIBS="-lsocket -lnsl -lresolv $LIBS" |
325 | 325 |
;; |
326 | 326 |
AIX) |
... | ... | |
354 | 354 |
kqemu="yes" |
355 | 355 |
fi |
356 | 356 |
EXESUF=".exe" |
357 |
CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $CFLAGS"
|
|
357 |
QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
|
|
358 | 358 |
LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" |
359 | 359 |
fi |
360 | 360 |
|
... | ... | |
515 | 515 |
|
516 | 516 |
# |
517 | 517 |
# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right |
518 |
# CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) |
|
518 |
# QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
|
|
519 | 519 |
# |
520 | 520 |
host_guest_base="no" |
521 | 521 |
case "$cpu" in |
522 | 522 |
sparc) case $sparc_cpu in |
523 | 523 |
v7|v8) |
524 |
CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $CFLAGS"
|
|
524 |
QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
|
|
525 | 525 |
;; |
526 | 526 |
v8plus|v8plusa) |
527 |
CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $CFLAGS"
|
|
527 |
QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
|
|
528 | 528 |
;; |
529 | 529 |
*) # sparc_cpu not defined in the command line |
530 |
CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $CFLAGS"
|
|
530 |
QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS"
|
|
531 | 531 |
esac |
532 | 532 |
LDFLAGS="-m32 $LDFLAGS" |
533 |
CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $CFLAGS"
|
|
533 |
QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS"
|
|
534 | 534 |
if test "$solaris" = "no" ; then |
535 |
CFLAGS="-ffixed-g1 -ffixed-g6 $CFLAGS"
|
|
535 |
QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS"
|
|
536 | 536 |
fi |
537 | 537 |
;; |
538 | 538 |
sparc64) |
539 |
CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $CFLAGS"
|
|
539 |
QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS"
|
|
540 | 540 |
LDFLAGS="-m64 $LDFLAGS" |
541 |
CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $CFLAGS"
|
|
541 |
QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS"
|
|
542 | 542 |
if test "$solaris" != "no" ; then |
543 |
CFLAGS="-ffixed-g1 $CFLAGS"
|
|
543 |
QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS"
|
|
544 | 544 |
fi |
545 | 545 |
;; |
546 | 546 |
s390) |
547 |
CFLAGS="-march=z900 $CFLAGS"
|
|
547 |
QEMU_CFLAGS="-march=z900 $QEMU_CFLAGS"
|
|
548 | 548 |
;; |
549 | 549 |
i386) |
550 |
CFLAGS="-m32 $CFLAGS"
|
|
550 |
QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
|
|
551 | 551 |
LDFLAGS="-m32 $LDFLAGS" |
552 | 552 |
host_guest_base="yes" |
553 | 553 |
;; |
554 | 554 |
x86_64) |
555 |
CFLAGS="-m64 $CFLAGS"
|
|
555 |
QEMU_CFLAGS="-m64 $QEMU_CFLAGS"
|
|
556 | 556 |
LDFLAGS="-m64 $LDFLAGS" |
557 | 557 |
host_guest_base="yes" |
558 | 558 |
;; |
... | ... | |
588 | 588 |
echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
589 | 589 |
echo " --cc=CC use C compiler CC [$cc]" |
590 | 590 |
echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." |
591 |
echo " --extra-cflags=CFLAGS append extra C compiler flags CFLAGS" |
|
591 |
echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS"
|
|
592 | 592 |
echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" |
593 | 593 |
echo " --make=MAKE use specified make [$make]" |
594 | 594 |
echo " --install=INSTALL use specified install [$install]" |
... | ... | |
1131 | 1131 |
kvm="no"; |
1132 | 1132 |
if [ -x "`which awk 2>/dev/null`" ] && \ |
1133 | 1133 |
[ -x "`which grep 2>/dev/null`" ]; then |
1134 |
kvmerr=`LANG=C $cc $CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \ |
|
1134 |
kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \
|
|
1135 | 1135 |
| grep "error: " \ |
1136 | 1136 |
| awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'` |
1137 | 1137 |
if test "$kvmerr" != "" ; then |
... | ... | |
1382 | 1382 |
# After here, no more $cc or $ld runs |
1383 | 1383 |
|
1384 | 1384 |
# default flags for all hosts |
1385 |
CFLAGS="-g -fno-strict-aliasing $CFLAGS" |
|
1385 |
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" |
|
1386 |
CFLAGS="-g $CFLAGS" |
|
1386 | 1387 |
if test "$debug" = "no" ; then |
1387 | 1388 |
CFLAGS="-O2 $CFLAGS" |
1388 | 1389 |
fi |
1389 |
CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls $CFLAGS"
|
|
1390 |
QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
|
|
1390 | 1391 |
LDFLAGS="-g $LDFLAGS" |
1391 | 1392 |
|
1392 | 1393 |
# Consult white-list to determine whether to enable werror |
... | ... | |
1402 | 1403 |
fi |
1403 | 1404 |
|
1404 | 1405 |
if test "$werror" = "yes" ; then |
1405 |
CFLAGS="-Werror $CFLAGS"
|
|
1406 |
QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
|
|
1406 | 1407 |
fi |
1407 | 1408 |
|
1408 | 1409 |
if test "$solaris" = "no" ; then |
... | ... | |
1440 | 1441 |
echo "C compiler $cc" |
1441 | 1442 |
echo "Host C compiler $host_cc" |
1442 | 1443 |
echo "CFLAGS $CFLAGS" |
1444 |
echo "QEMU_CFLAGS $QEMU_CFLAGS" |
|
1443 | 1445 |
echo "LDFLAGS $LDFLAGS" |
1444 | 1446 |
echo "make $make" |
1445 | 1447 |
echo "install $install" |
... | ... | |
1740 | 1742 |
if test "$sparse" = "yes" ; then |
1741 | 1743 |
echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak |
1742 | 1744 |
echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak |
1743 |
echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak |
|
1745 |
echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
|
|
1744 | 1746 |
fi |
1745 | 1747 |
echo "AR=$ar" >> $config_host_mak |
1746 | 1748 |
echo "OBJCOPY=$objcopy" >> $config_host_mak |
1747 | 1749 |
echo "LD=$ld" >> $config_host_mak |
1748 | 1750 |
echo "CFLAGS=$CFLAGS" >> $config_host_mak |
1751 |
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak |
|
1749 | 1752 |
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak |
1750 | 1753 |
echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak |
1751 | 1754 |
echo "ARLIBS_END=$arlibs_end" >> $config_host_mak |
... | ... | |
2116 | 2119 |
rm -f $d/Makefile |
2117 | 2120 |
ln -s $source_path/Makefile.hw $d/Makefile |
2118 | 2121 |
echo "HWLIB=libqemuhw$hwlib.a" > $d/config.mak |
2119 |
echo "CPPFLAGS=-DTARGET_PHYS_ADDR_BITS=$hwlib" >> $d/config.mak
|
|
2122 |
echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" >> $d/config.mak
|
|
2120 | 2123 |
done |
Also available in: Unified diff