1#!/bin/sh 2# 3# qemu configure script (c) 2003 Fabrice Bellard 4# 5 6# Unset some variables known to interfere with behavior of common tools, 7# just as autoconf does. Unlike autoconf, we assume that unset exists. 8unset CLICOLOR_FORCE GREP_OPTIONS BASH_ENV ENV MAIL MAILPATH CDPATH 9 10# Don't allow CCACHE, if present, to use cached results of compile tests! 11export CCACHE_RECACHE=yes 12 13# make source path absolute 14source_path=$(cd "$(dirname -- "$0")"; pwd) 15 16if test "$PWD" -ef "$source_path" 17then 18 echo "Using './build' as the directory for build output" 19 20 MARKER=build/auto-created-by-configure 21 22 if test -e build 23 then 24 if test -f $MARKER 25 then 26 rm -rf build 27 else 28 echo "ERROR: ./build dir already exists and was not previously created by configure" 29 exit 1 30 fi 31 fi 32 33 if ! mkdir build || ! touch $MARKER 34 then 35 echo "ERROR: Could not create ./build directory. Check the permissions on" 36 echo "your source directory, or try doing an out-of-tree build." 37 exit 1 38 fi 39 40 cat > GNUmakefile <<'EOF' 41# This file is auto-generated by configure to support in-source tree 42# 'make' command invocation 43 44build: 45 @echo 'changing dir to build for $(MAKE) "$(MAKECMDGOALS)"...' 46 @$(MAKE) -C build -f Makefile $(MAKECMDGOALS) 47 @if test "$(MAKECMDGOALS)" = "distclean" && \ 48 test -e build/auto-created-by-configure ; \ 49 then \ 50 rm -rf build GNUmakefile ; \ 51 fi 52%: build 53 @ 54.PHONY: build 55GNUmakefile: ; 56 57EOF 58 cd build 59 exec "$source_path/configure" "$@" 60fi 61 62# Temporary directory used for files created while 63# configure runs. Since it is in the build directory 64# we can safely blow away any previous version of it 65# (and we need not jump through hoops to try to delete 66# it when configure exits.) 67TMPDIR1="config-temp" 68rm -rf "${TMPDIR1}" 69if ! mkdir -p "${TMPDIR1}"; then 70 echo "ERROR: failed to create temporary directory" 71 exit 1 72fi 73 74TMPB="qemu-conf" 75TMPC="${TMPDIR1}/${TMPB}.c" 76TMPO="${TMPDIR1}/${TMPB}.o" 77TMPE="${TMPDIR1}/${TMPB}.exe" 78 79rm -f config.log 80 81# Print a helpful header at the top of config.log 82echo "# QEMU configure log $(date)" >> config.log 83printf "# Configured with:" >> config.log 84# repeat the invocation to log and stdout for CI 85invoke=$(printf " '%s'" "$0" "$@") 86test -n "$GITLAB_CI" && echo "configuring with: $invoke" 87{ echo "$invoke"; echo; echo "#"; } >> config.log 88 89quote_sh() { 90 printf "%s" "$1" | sed "s,','\\\\'',g; s,.*,'&'," 91} 92 93error_exit() { 94 (echo 95 echo "ERROR: $1" 96 while test -n "$2"; do 97 echo " $2" 98 shift 99 done 100 echo) >&2 101 exit 1 102} 103 104do_compiler() { 105 # Run the compiler, capturing its output to the log. First argument 106 # is compiler binary to execute. 107 compiler="$1" 108 shift 109 if test -n "$BASH_VERSION"; then eval ' 110 echo >>config.log " 111funcs: ${FUNCNAME[*]} 112lines: ${BASH_LINENO[*]}" 113 '; fi 114 echo $compiler "$@" >> config.log 115 $compiler "$@" >> config.log 2>&1 || return $? 116} 117 118do_cc() { 119 do_compiler "$cc" $CPU_CFLAGS "$@" 120} 121 122compile_object() { 123 local_cflags="$1" 124 do_cc $CFLAGS $EXTRA_CFLAGS $local_cflags -c -o $TMPO $TMPC 125} 126 127compile_prog() { 128 local_cflags="$1" 129 local_ldflags="$2" 130 do_cc $CFLAGS $EXTRA_CFLAGS $local_cflags -o $TMPE $TMPC \ 131 $LDFLAGS $EXTRA_LDFLAGS $local_ldflags 132} 133 134# symbolically link $1 to $2. Portable version of "ln -sf". 135symlink() { 136 rm -rf "$2" 137 mkdir -p "$(dirname "$2")" 138 ln -s "$1" "$2" 139} 140 141# check whether a command is available to this shell (may be either an 142# executable or a builtin) 143has() { 144 type "$1" >/dev/null 2>&1 145} 146 147version_ge () { 148 local_ver1=$(expr "$1" : '\([0-9.]*\)' | tr . ' ') 149 local_ver2=$(echo "$2" | tr . ' ') 150 while true; do 151 set x $local_ver1 152 local_first=${2-0} 153 # 'shift 2' if $2 is set, or 'shift' if $2 is not set 154 shift ${2:+2} 155 local_ver1=$* 156 set x $local_ver2 157 # the second argument finished, the first must be greater or equal 158 test $# = 1 && return 0 159 test $local_first -lt $2 && return 1 160 test $local_first -gt $2 && return 0 161 shift ${2:+2} 162 local_ver2=$* 163 done 164} 165 166if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]"; 167then 168 error_exit "main directory cannot contain spaces nor colons" 169fi 170 171# parse CC options first; some compiler tests are used to establish 172# some defaults, based on the host environment 173 174# default parameters 175container_engine="auto" 176cpu="" 177cross_compile="no" 178cross_prefix="" 179host_cc="cc" 180EXTRA_CFLAGS="" 181EXTRA_CXXFLAGS="" 182EXTRA_OBJCFLAGS="" 183EXTRA_LDFLAGS="" 184 185# Default value for a variable defining feature "foo". 186# * foo="no" feature will only be used if --enable-foo arg is given 187# * foo="" feature will be searched for, and if found, will be used 188# unless --disable-foo is given 189# * foo="yes" this value will only be set by --enable-foo flag. 190# feature will searched for, 191# if not found, configure exits with error 192# 193# Always add --enable-foo and --disable-foo command line args. 194# Distributions want to ensure that several features are compiled in, and it 195# is impossible without a --enable-foo that exits if a feature is not found. 196default_feature="" 197 198for opt do 199 optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') 200 case "$opt" in 201 --cross-prefix=*) cross_prefix="$optarg" 202 cross_compile="yes" 203 ;; 204 --cc=*) CC="$optarg" 205 ;; 206 --cxx=*) CXX="$optarg" 207 ;; 208 --objcc=*) objcc="$optarg" 209 ;; 210 --rustc=*) RUSTC="$optarg" 211 ;; 212 --cpu=*) cpu="$optarg" 213 ;; 214 --extra-cflags=*) 215 EXTRA_CFLAGS="$EXTRA_CFLAGS $optarg" 216 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg" 217 EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg" 218 ;; 219 --extra-cxxflags=*) EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg" 220 ;; 221 --extra-objcflags=*) EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg" 222 ;; 223 --extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg" 224 ;; 225 --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option" 226 ;; 227 --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-cflags-}; cc_arch=${cc_arch%%=*} 228 eval "cross_cc_cflags_${cc_arch}=\$optarg" 229 ;; 230 --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*} 231 eval "cross_cc_${cc_arch}=\$optarg" 232 ;; 233 --cross-prefix-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-prefix-FOO option" 234 ;; 235 --cross-prefix-*) cc_arch=${opt#--cross-prefix-}; cc_arch=${cc_arch%%=*} 236 eval "cross_prefix_${cc_arch}=\$optarg" 237 ;; 238 --without-default-features) default_feature="no" 239 ;; 240 esac 241done 242 243default_cflags='-O2 -g' 244git_submodules_action="update" 245docs="auto" 246EXESUF="" 247system="yes" 248linux_user="" 249bsd_user="" 250plugins="$default_feature" 251subdirs="" 252ninja="" 253python= 254download="enabled" 255skip_meson=no 256use_containers="yes" 257rust="disabled" 258rust_target_triple="" 259gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb") 260gdb_arches="" 261 262# Don't accept a target_list environment variable. 263unset target_list 264unset target_list_exclude 265 266# The following Meson options are handled manually (still they 267# are included in the automatically generated help message) 268# because they automatically enable/disable other options 269tcg="auto" 270cfi="false" 271 272# Meson has PIE as a boolean rather than enabled/disabled/auto, 273# and we also need to check for -static-pie before Meson runs 274# which requires knowing whether --static is enabled. 275pie="" 276static="no" 277 278# Preferred compiler: 279# ${CC} (if set) 280# ${cross_prefix}gcc (if cross-prefix specified) 281# system compiler 282if test -z "${CC}${cross_prefix}"; then 283 cc="cc" 284else 285 cc="${CC-${cross_prefix}gcc}" 286fi 287 288if test -z "${CXX}${cross_prefix}"; then 289 cxx="c++" 290else 291 cxx="${CXX-${cross_prefix}g++}" 292fi 293 294# Preferred ObjC compiler: 295# $objcc (if set, i.e. via --objcc option) 296# ${cross_prefix}clang (if cross-prefix specified) 297# clang (if available) 298# $cc 299if test -z "${objcc}${cross_prefix}"; then 300 if has clang; then 301 objcc=clang 302 else 303 objcc="$cc" 304 fi 305else 306 objcc="${objcc-${cross_prefix}clang}" 307fi 308 309ar="${AR-${cross_prefix}ar}" 310as="${AS-${cross_prefix}as}" 311ccas="${CCAS-$cc}" 312dlltool="${DLLTOOL-${cross_prefix}dlltool}" 313objcopy="${OBJCOPY-${cross_prefix}objcopy}" 314ld="${LD-${cross_prefix}ld}" 315ranlib="${RANLIB-${cross_prefix}ranlib}" 316nm="${NM-${cross_prefix}nm}" 317readelf="${READELF-${cross_prefix}readelf}" 318strip="${STRIP-${cross_prefix}strip}" 319widl="${WIDL-${cross_prefix}widl}" 320windres="${WINDRES-${cross_prefix}windres}" 321windmc="${WINDMC-${cross_prefix}windmc}" 322pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}" 323sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" 324 325rustc="${RUSTC-rustc}" 326 327check_define() { 328cat > $TMPC <<EOF 329#if !defined($1) 330#error $1 not defined 331#endif 332int main(void) { return 0; } 333EOF 334 compile_object 335} 336 337write_c_skeleton() { 338 cat > $TMPC <<EOF 339int main(void) { return 0; } 340EOF 341} 342 343if check_define __linux__ ; then 344 host_os=linux 345elif check_define _WIN32 ; then 346 host_os=windows 347elif check_define __OpenBSD__ ; then 348 host_os=openbsd 349elif check_define __sun__ ; then 350 host_os=sunos 351elif check_define __HAIKU__ ; then 352 host_os=haiku 353elif check_define __FreeBSD__ ; then 354 host_os=freebsd 355elif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then 356 host_os=gnu/kfreebsd 357elif check_define __DragonFly__ ; then 358 host_os=dragonfly 359elif check_define __NetBSD__; then 360 host_os=netbsd 361elif check_define __APPLE__; then 362 host_os=darwin 363else 364 # This is a fatal error, but don't report it yet, because we 365 # might be going to just print the --help text, or it might 366 # be the result of a missing compiler. 367 host_os=bogus 368fi 369 370if test ! -z "$cpu" ; then 371 # command line argument 372 : 373elif check_define __i386__ ; then 374 cpu="i386" 375elif check_define __x86_64__ ; then 376 if check_define __ILP32__ ; then 377 cpu="x32" 378 else 379 cpu="x86_64" 380 fi 381elif check_define __sparc__ ; then 382 if check_define __arch64__ ; then 383 cpu="sparc64" 384 else 385 cpu="sparc" 386 fi 387elif check_define _ARCH_PPC ; then 388 if check_define _ARCH_PPC64 ; then 389 if check_define _LITTLE_ENDIAN ; then 390 cpu="ppc64le" 391 else 392 cpu="ppc64" 393 fi 394 else 395 cpu="ppc" 396 fi 397elif check_define __mips__ ; then 398 if check_define __mips64 ; then 399 cpu="mips64" 400 else 401 cpu="mips" 402 fi 403elif check_define __s390__ ; then 404 if check_define __s390x__ ; then 405 cpu="s390x" 406 else 407 cpu="s390" 408 fi 409elif check_define __riscv ; then 410 if check_define _LP64 ; then 411 cpu="riscv64" 412 else 413 cpu="riscv32" 414 fi 415elif check_define __arm__ ; then 416 cpu="arm" 417elif check_define __aarch64__ ; then 418 cpu="aarch64" 419elif check_define __loongarch64 ; then 420 cpu="loongarch64" 421else 422 # Using uname is really broken, but it is just a fallback for architectures 423 # that are going to use TCI anyway 424 cpu=$(uname -m) 425 if test "$host_os" != "bogus"; then 426 echo "WARNING: unrecognized host CPU, proceeding with 'uname -m' output '$cpu'" 427 fi 428fi 429 430# Normalise host CPU name to the values used by Meson cross files and in source 431# directories, and set multilib cflags. The canonicalization isn't really 432# necessary, because the architectures that we check for should not hit the 433# 'uname -m' case, but better safe than sorry in case --cpu= is used. 434# 435# Note that this case should only have supported host CPUs, not guests. 436# Please keep it sorted and synchronized with meson.build's host_arch. 437host_arch= 438linux_arch= 439raw_cpu=$cpu 440case "$cpu" in 441 aarch64) 442 host_arch=aarch64 443 linux_arch=arm64 444 ;; 445 446 armv*b|armv*l|arm) 447 cpu=arm 448 host_arch=arm 449 linux_arch=arm 450 ;; 451 452 i386|i486|i586|i686) 453 cpu="i386" 454 host_arch=i386 455 linux_arch=x86 456 CPU_CFLAGS="-m32" 457 ;; 458 459 loongarch*) 460 cpu=loongarch64 461 host_arch=loongarch64 462 linux_arch=loongarch 463 ;; 464 465 mips64*|mipsisa64*) 466 cpu=mips64 467 host_arch=mips 468 linux_arch=mips 469 ;; 470 mips*) 471 cpu=mips 472 host_arch=mips 473 linux_arch=mips 474 ;; 475 476 ppc) 477 host_arch=ppc 478 linux_arch=powerpc 479 CPU_CFLAGS="-m32" 480 ;; 481 ppc64) 482 host_arch=ppc64 483 linux_arch=powerpc 484 CPU_CFLAGS="-m64 -mbig-endian" 485 ;; 486 ppc64le) 487 cpu=ppc64 488 host_arch=ppc64 489 linux_arch=powerpc 490 CPU_CFLAGS="-m64 -mlittle-endian" 491 ;; 492 493 riscv32 | riscv64) 494 host_arch=riscv 495 linux_arch=riscv 496 ;; 497 498 s390) 499 linux_arch=s390 500 CPU_CFLAGS="-m31" 501 ;; 502 s390x) 503 host_arch=s390x 504 linux_arch=s390 505 CPU_CFLAGS="-m64" 506 ;; 507 508 sparc|sun4[cdmuv]) 509 cpu=sparc 510 CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" 511 ;; 512 sparc64) 513 host_arch=sparc64 514 CPU_CFLAGS="-m64 -mcpu=ultrasparc" 515 ;; 516 517 x32) 518 cpu="x86_64" 519 host_arch=x86_64 520 linux_arch=x86 521 CPU_CFLAGS="-mx32" 522 ;; 523 x86_64|amd64) 524 cpu="x86_64" 525 host_arch=x86_64 526 linux_arch=x86 527 CPU_CFLAGS="-m64" 528 ;; 529esac 530 531if test -n "$host_arch" && { 532 ! test -d "$source_path/linux-user/include/host/$host_arch" || 533 ! test -d "$source_path/common-user/host/$host_arch"; }; then 534 error_exit "linux-user/include/host/$host_arch does not exist." \ 535 "This is a bug in the configure script, please report it." 536fi 537if test -n "$linux_arch" && ! test -d "$source_path/linux-headers/asm-$linux_arch"; then 538 error_exit "linux-headers/asm-$linux_arch does not exist." \ 539 "This is a bug in the configure script, please report it." 540fi 541 542check_py_version() { 543 # We require python >= 3.8. 544 # NB: a True python conditional creates a non-zero return code (Failure) 545 "$1" -c 'import sys; sys.exit(sys.version_info < (3,8))' 546} 547 548first_python= 549if test -z "${PYTHON}"; then 550 # A bare 'python' is traditionally python 2.x, but some distros 551 # have it as python 3.x, so check in both places. 552 for binary in python3 python python3.12 python3.11 \ 553 python3.10 python3.9 python3.8; do 554 if has "$binary"; then 555 python=$(command -v "$binary") 556 if check_py_version "$python"; then 557 # This one is good. 558 first_python= 559 break 560 else 561 first_python=$python 562 fi 563 fi 564 done 565else 566 # Same as above, but only check the environment variable. 567 has "${PYTHON}" || error_exit "The PYTHON environment variable does not point to an executable" 568 python=$(command -v "$PYTHON") 569 if check_py_version "$python"; then 570 # This one is good. 571 first_python= 572 else 573 first_python=$first_python 574 fi 575fi 576 577# Check for ancillary tools used in testing 578genisoimage= 579for binary in genisoimage mkisofs 580do 581 if has $binary 582 then 583 genisoimage=$(command -v "$binary") 584 break 585 fi 586done 587 588if test "$host_os" = "windows" ; then 589 EXESUF=".exe" 590fi 591 592meson_option_build_array() { 593 printf '[' 594 (if test "$host_os" = windows; then 595 IFS=\; 596 else 597 IFS=: 598 fi 599 for e in $1; do 600 printf '"""' 601 # backslash escape any '\' and '"' characters 602 printf "%s" "$e" | sed -e 's/\([\"]\)/\\\1/g' 603 printf '""",' 604 done) 605 printf ']\n' 606} 607 608. "$source_path/scripts/meson-buildoptions.sh" 609 610meson_options= 611meson_option_add() { 612 local arg 613 for arg; do 614 meson_options="$meson_options $(quote_sh "$arg")" 615 done 616} 617meson_option_parse() { 618 meson_options="$meson_options $(_meson_option_parse "$@")" 619 if test $? -eq 1; then 620 echo "ERROR: unknown option $1" 621 echo "Try '$0 --help' for more information" 622 exit 1 623 fi 624} 625has_meson_option() { 626 test "${meson_options#*"$1"}" != "$meson_options" 627} 628 629meson_add_machine_file() { 630 if test "$cross_compile" = "yes"; then 631 meson_option_add --cross-file "$1" 632 else 633 meson_option_add --native-file "$1" 634 fi 635} 636 637for opt do 638 optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') 639 case "$opt" in 640 --help|-h) show_help=yes 641 ;; 642 --version|-V) exec cat "$source_path/VERSION" 643 ;; 644 --cross-prefix=*) 645 ;; 646 --cc=*) 647 ;; 648 --host-cc=*) host_cc="$optarg" 649 ;; 650 --cxx=*) 651 ;; 652 --objcc=*) 653 ;; 654 --rustc=*) 655 ;; 656 --make=*) 657 ;; 658 --install=*) 659 ;; 660 --python=*) python="$optarg" 661 ;; 662 --skip-meson) skip_meson=yes 663 ;; 664 --ninja=*) ninja="$optarg" 665 ;; 666 --extra-cflags=*) 667 ;; 668 --extra-cxxflags=*) 669 ;; 670 --extra-objcflags=*) 671 ;; 672 --extra-ldflags=*) 673 ;; 674 --cross-cc-*) 675 ;; 676 --cross-prefix-*) 677 ;; 678 --enable-docs) docs=enabled 679 ;; 680 --disable-docs) docs=disabled 681 ;; 682 --cpu=*) 683 ;; 684 --target-list=*) target_list="$optarg" 685 if test "$target_list_exclude"; then 686 error_exit "Can't mix --target-list with --target-list-exclude" 687 fi 688 ;; 689 --target-list-exclude=*) target_list_exclude="$optarg" 690 if test "$target_list"; then 691 error_exit "Can't mix --target-list-exclude with --target-list" 692 fi 693 ;; 694 --with-default-devices) meson_option_add -Ddefault_devices=true 695 ;; 696 --without-default-devices) meson_option_add -Ddefault_devices=false 697 ;; 698 --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO option" 699 ;; 700 --with-devices-*) device_arch=${opt#--with-devices-}; 701 device_arch=${device_arch%%=*} 702 cf=$source_path/configs/devices/$device_arch-softmmu/$optarg.mak 703 if test -f "$cf"; then 704 device_archs="$device_archs $device_arch" 705 eval "devices_${device_arch}=\$optarg" 706 else 707 error_exit "File $cf does not exist" 708 fi 709 ;; 710 --without-default-features) # processed above 711 ;; 712 --static) static="yes" 713 ;; 714 --host=*|--build=*|\ 715 --disable-dependency-tracking|\ 716 --sbindir=*|--sharedstatedir=*|\ 717 --oldincludedir=*|--datarootdir=*|--infodir=*|\ 718 --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) 719 # These switches are silently ignored, for compatibility with 720 # autoconf-generated configure scripts. This allows QEMU's 721 # configure to be used by RPM and similar macros that set 722 # lots of directory switches by default. 723 ;; 724 --enable-debug) 725 # Enable debugging options that aren't excessively noisy 726 meson_option_parse --enable-debug-tcg "" 727 meson_option_parse --enable-debug-graph-lock "" 728 meson_option_parse --enable-debug-mutex "" 729 meson_option_add -Doptimization=0 730 default_cflags='-O0 -g' 731 ;; 732 --disable-tcg) tcg="disabled" 733 ;; 734 --enable-tcg) tcg="enabled" 735 ;; 736 --disable-system) system="no" 737 ;; 738 --enable-system) system="yes" 739 ;; 740 --disable-user) 741 linux_user="no" ; 742 bsd_user="no" ; 743 ;; 744 --enable-user) ;; 745 --disable-linux-user) linux_user="no" 746 ;; 747 --enable-linux-user) linux_user="yes" 748 ;; 749 --disable-bsd-user) bsd_user="no" 750 ;; 751 --enable-bsd-user) bsd_user="yes" 752 ;; 753 --enable-pie) pie="yes" 754 ;; 755 --disable-pie) pie="no" 756 ;; 757 --enable-cfi) cfi=true 758 ;; 759 --disable-cfi) cfi=false 760 ;; 761 --disable-download) download="disabled"; git_submodules_action=validate; 762 ;; 763 --enable-download) download="enabled"; git_submodules_action=update; 764 ;; 765 --enable-plugins) plugins="yes" 766 ;; 767 --disable-plugins) plugins="no" 768 ;; 769 --enable-containers) use_containers="yes" 770 ;; 771 --disable-containers) use_containers="no" 772 ;; 773 --container-engine=*) container_engine="$optarg" 774 ;; 775 --rust-target-triple=*) rust_target_triple="$optarg" 776 ;; 777 --gdb=*) gdb_bin="$optarg" 778 ;; 779 --enable-rust) rust=enabled 780 ;; 781 --disable-rust) rust=disabled 782 ;; 783 # everything else has the same name in configure and meson 784 --*) meson_option_parse "$opt" "$optarg" 785 ;; 786 # Pass through -Dxxxx options to meson 787 -D*) meson_option_add "$opt" 788 ;; 789 esac 790done 791 792if ! test -e "$source_path/.git" 793then 794 git_submodules_action="validate" 795fi 796 797if ! test -f "$source_path/subprojects/keycodemapdb/README" \ 798 && test "$download" = disabled 799then 800 echo 801 echo "ERROR: missing subprojects" 802 echo 803 if test -e "$source_path/.git"; then 804 echo "--disable-download specified but subprojects were not" 805 echo 'checked out. Please invoke "meson subprojects download"' 806 echo "before configuring QEMU, or remove --disable-download" 807 echo "from the command line." 808 else 809 echo "This is not a GIT checkout but subproject content appears to" 810 echo "be missing. Do not use 'git archive' or GitHub download links" 811 echo "to acquire QEMU source archives. Non-GIT builds are only" 812 echo "supported with source archives linked from:" 813 echo 814 echo " https://www.qemu.org/download/#source" 815 echo 816 echo "Developers working with GIT can use scripts/archive-source.sh" 817 echo "if they need to create valid source archives." 818 fi 819 echo 820 exit 1 821fi 822 823default_target_list="" 824mak_wilds="" 825 826if [ -n "$host_arch" ] && [ -d "$source_path/common-user/host/$host_arch" ]; then 827 if [ "$linux_user" != no ]; then 828 if [ "$host_os" = linux ]; then 829 linux_user=yes 830 elif [ "$linux_user" = yes ]; then 831 error_exit "linux-user not supported on this architecture" 832 fi 833 if [ "$linux_user" = "yes" ]; then 834 mak_wilds="${mak_wilds} $source_path/configs/targets/*-linux-user.mak" 835 fi 836 fi 837 if [ "$bsd_user" != no ]; then 838 if [ "$bsd_user" = "" ]; then 839 test $host_os = freebsd && bsd_user=yes 840 fi 841 if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$host_os" ]; then 842 error_exit "bsd-user not supported on this host OS" 843 fi 844 if [ "$bsd_user" = "yes" ]; then 845 mak_wilds="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak" 846 fi 847 fi 848else 849 if [ "$linux_user" = yes ] || [ "$bsd_user" = yes ]; then 850 error_exit "user mode emulation not supported on this architecture" 851 fi 852fi 853if [ "$system" = "yes" ]; then 854 mak_wilds="${mak_wilds} $source_path/configs/targets/*-softmmu.mak" 855fi 856 857for config in $mak_wilds; do 858 target="$(basename "$config" .mak)" 859 if echo "$target_list_exclude" | grep -vq "$target"; then 860 default_target_list="${default_target_list} $target" 861 fi 862done 863 864if test x"$show_help" = x"yes" ; then 865cat << EOF 866 867Usage: configure [options] 868Options: [defaults in brackets after descriptions] 869 870Standard options: 871 --help print this message 872 --target-list=LIST set target list (default: build all) 873$(echo Available targets: $default_target_list | \ 874 fold -s -w 53 | sed -e 's/^/ /') 875 --target-list-exclude=LIST exclude a set of targets from the default target-list 876 877Advanced options (experts only): 878 -Dmesonoptname=val passthrough option to meson unmodified 879 --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix] 880 --cc=CC use C compiler CC [$cc] 881 --host-cc=CC when cross compiling, use C compiler CC for code run 882 at build time [$host_cc] 883 --cxx=CXX use C++ compiler CXX [$cxx] 884 --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] 885 --rustc=RUSTC use Rust compiler RUSTC [$rustc] 886 --extra-cflags=CFLAGS append extra C compiler flags CFLAGS 887 --extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS 888 --extra-objcflags=OBJCFLAGS append extra Objective C compiler flags OBJCFLAGS 889 --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS 890 --cross-cc-ARCH=CC use compiler when building ARCH guest test cases 891 --cross-cc-cflags-ARCH= use compiler flags when building ARCH guest tests 892 --cross-prefix-ARCH=PREFIX cross compiler prefix when building ARCH guest test cases 893 --python=PYTHON use specified python [$python] 894 --ninja=NINJA use specified ninja [$ninja] 895 --static enable static build [$static] 896 --rust-target-triple=TRIPLE compilation target for Rust code [autodetect] 897 --without-default-features default all --enable-* options to "disabled" 898 --without-default-devices do not include any device that is not needed to 899 start the emulator (only use if you are including 900 desired devices in configs/devices/) 901 --with-devices-ARCH=NAME override default configs/devices 902 --enable-debug enable common debug build options 903 --cpu=CPU Build for host CPU [$cpu] 904 --disable-containers don't use containers for cross-building 905 --container-engine=TYPE which container engine to use [$container_engine] 906 --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] 907EOF 908 meson_options_help 909cat << EOF 910 system all system emulation targets 911 user supported user emulation targets 912 linux-user all linux usermode emulation targets 913 bsd-user all BSD usermode emulation targets 914 pie Position Independent Executables 915 916NOTE: The object files are built at the place where configure is launched 917EOF 918exit 0 919fi 920 921# Now that we are sure that the user did not only want to print the --help 922# information, we should double-check that the C compiler really works: 923write_c_skeleton 924if ! compile_object ; then 925 error_exit "C compiler \"$cc\" either does not exist or does not work." 926fi 927 928# Remove old dependency files to make sure that they get properly regenerated 929rm -f ./*/config-devices.mak.d 930 931if test -z "$python" 932then 933 # If first_python is set, there was a binary somewhere even though 934 # it was not suitable. Use it for the error message. 935 if test -n "$first_python"; then 936 error_exit "Cannot use '$first_python', Python >= 3.8 is required." \ 937 "Use --python=/path/to/python to specify a supported Python." 938 else 939 error_exit "Python not found. Use --python=/path/to/python" 940 fi 941fi 942 943if ! check_py_version "$python"; then 944 error_exit "Cannot use '$python', Python >= 3.8 is required." \ 945 "Use --python=/path/to/python to specify a supported Python." \ 946 "Maybe try:" \ 947 " openSUSE Leap 15.3+: zypper install python39" \ 948 " CentOS 8: dnf install python38" 949fi 950 951# Resolve PATH 952python="$(command -v "$python")" 953 954# Create a Python virtual environment using our configured python. 955# The stdout of this script will be the location of a symlink that 956# points to the configured Python. 957# Entry point scripts for pip, meson, and sphinx are generated if those 958# packages are present. 959 960# Defaults assumed for now: 961# - venv is cleared if it exists already; 962# - venv is allowed to use system packages; 963# - all setup can be performed offline; 964# - missing packages may be fetched from PyPI, 965# unless --disable-download is passed. 966# - pip is not installed into the venv when possible, 967# but ensurepip is called as a fallback when necessary. 968 969echo "python determined to be '$python'" 970echo "python version: $($python --version)" 971 972python="$($python -B "${source_path}/python/scripts/mkvenv.py" create pyvenv)" 973if test "$?" -ne 0 ; then 974 error_exit "python venv creation failed" 975fi 976 977# Suppress writing compiled files 978python="$python -B" 979mkvenv="$python ${source_path}/python/scripts/mkvenv.py" 980 981# Finish preparing the virtual environment using vendored .whl files 982 983$mkvenv ensuregroup --dir "${source_path}/python/wheels" \ 984 ${source_path}/pythondeps.toml meson || exit 1 985 986# At this point, we expect Meson to be installed and available. 987# We expect mkvenv or pip to have created pyvenv/bin/meson for us. 988# We ignore PATH completely here: we want to use the venv's Meson 989# *exclusively*. 990 991meson="$(cd pyvenv/bin; pwd)/meson" 992 993# Conditionally ensure Sphinx is installed. 994 995mkvenv_online_flag="" 996if test "$download" = "enabled" ; then 997 mkvenv_online_flag=" --online" 998fi 999 1000if test "$docs" != "disabled" ; then 1001 if ! $mkvenv ensuregroup \ 1002 $(test "$docs" = "enabled" && echo "$mkvenv_online_flag") \ 1003 ${source_path}/pythondeps.toml docs; 1004 then 1005 if test "$docs" = "enabled" ; then 1006 exit 1 1007 fi 1008 echo "Sphinx not found/usable, disabling docs." 1009 docs=disabled 1010 else 1011 docs=enabled 1012 fi 1013fi 1014 1015# Probe for ninja 1016 1017if test -z "$ninja"; then 1018 for c in ninja ninja-build samu; do 1019 if has $c; then 1020 ninja=$(command -v "$c") 1021 break 1022 fi 1023 done 1024 if test -z "$ninja"; then 1025 error_exit "Cannot find Ninja" 1026 fi 1027fi 1028 1029if test "$host_os" = "bogus"; then 1030 # Now that we know that we're not printing the help and that 1031 # the compiler works (so the results of the check_defines we used 1032 # to identify the OS are reliable), if we didn't recognize the 1033 # host OS we should stop now. 1034 error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')" 1035fi 1036 1037# test for any invalid configuration combinations 1038if test "$host_os" = "windows" && ! has "$dlltool"; then 1039 if test "$plugins" = "yes"; then 1040 error_exit "TCG plugins requires dlltool to build on Windows platforms" 1041 fi 1042 plugins="no" 1043fi 1044if test "$tcg" = "disabled" ; then 1045 if test "$plugins" = "yes"; then 1046 error_exit "Can't enable plugins on non-TCG builds" 1047 fi 1048 plugins="no" 1049fi 1050if test "$static" = "yes" ; then 1051 if test "$plugins" = "yes"; then 1052 error_exit "static and plugins are mutually incompatible" 1053 fi 1054 plugins="no" 1055fi 1056if test "$plugins" != "no"; then 1057 if has_meson_option "-Dtcg_interpreter=true"; then 1058 plugins="no" 1059 else 1060 plugins=yes 1061 fi 1062fi 1063 1064cat > $TMPC << EOF 1065 1066#ifdef __linux__ 1067# define THREAD __thread 1068#else 1069# define THREAD 1070#endif 1071static THREAD int tls_var; 1072int main(void) { return tls_var; } 1073EOF 1074 1075if test "$host_os" = windows || test "$host_os" = haiku; then 1076 if test "$pie" = "yes"; then 1077 error_exit "PIE not available due to missing OS support" 1078 fi 1079 pie=no 1080fi 1081 1082if test "$pie" != "no"; then 1083 if test "$static" = "yes"; then 1084 pie_ldflags=-static-pie 1085 else 1086 pie_ldflags=-pie 1087 fi 1088 if compile_prog "-Werror -fPIE -DPIE" "$pie_ldflags"; then 1089 pie="yes" 1090 elif test "$pie" = "yes"; then 1091 error_exit "-static-pie not available due to missing toolchain support" 1092 else 1093 echo "Disabling PIE due to missing toolchain support" 1094 pie="no" 1095 fi 1096fi 1097 1098########################################## 1099 1100if test -z "${target_list+xxx}" ; then 1101 default_targets=yes 1102 for target in $default_target_list; do 1103 target_list="$target_list $target" 1104 done 1105 target_list="${target_list# }" 1106else 1107 default_targets=no 1108 target_list=$(echo "$target_list" | sed -e 's/,/ /g') 1109 for target in $target_list; do 1110 # Check that we recognised the target name; this allows a more 1111 # friendly error message than if we let it fall through. 1112 case " $default_target_list " in 1113 *" $target "*) 1114 ;; 1115 *) 1116 error_exit "Unknown target name '$target'" 1117 ;; 1118 esac 1119 done 1120fi 1121 1122if test "$tcg" = "auto"; then 1123 if test -z "$target_list"; then 1124 tcg="disabled" 1125 else 1126 tcg="enabled" 1127 fi 1128fi 1129 1130######################################### 1131# gdb test 1132 1133if test -n "$gdb_bin"; then 1134 gdb_version_string=$($gdb_bin --version | head -n 1) 1135 # Extract last field in the version string 1136 gdb_version=${gdb_version_string##* } 1137 if version_ge $gdb_version 9.1; then 1138 gdb_arches=$($python "$source_path/scripts/probe-gdb-support.py" $gdb_bin) 1139 else 1140 gdb_bin="" 1141 fi 1142fi 1143 1144########################################## 1145# big/little endian test 1146cat > $TMPC << EOF 1147#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 1148# error LITTLE 1149#endif 1150int main(void) { return 0; } 1151EOF 1152 1153if ! compile_prog ; then 1154 bigendian="no" 1155else 1156 cat > $TMPC << EOF 1157#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 1158# error BIG 1159#endif 1160int main(void) { return 0; } 1161EOF 1162 1163 if ! compile_prog ; then 1164 bigendian="yes" 1165 else 1166 echo big/little test failed 1167 exit 1 1168 fi 1169fi 1170 1171########################################## 1172# detect rust triple 1173 1174if test "$rust" != disabled && has "$rustc" && $rustc -vV > "${TMPDIR1}/${TMPB}.out"; then 1175 rust_host_triple=$(sed -n 's/^host: //p' "${TMPDIR1}/${TMPB}.out") 1176else 1177 if test "$rust" = enabled; then 1178 error_exit "could not execute rustc binary \"$rustc\"" 1179 fi 1180 rust=disabled 1181fi 1182if test "$rust" != disabled && test -z "$rust_target_triple"; then 1183 # arch and os generally matches between meson and rust 1184 rust_arch=$host_arch 1185 rust_os=$host_os 1186 rust_machine=unknown 1187 rust_osvariant= 1188 1189 # tweak rust_os if needed; also, machine and variant depend on the OS 1190 android=no 1191 case "$host_os" in 1192 darwin) 1193 # e.g. aarch64-apple-darwin 1194 rust_machine=apple 1195 ;; 1196 1197 linux) 1198 # detect android/glibc/musl 1199 if check_define __ANDROID__; then 1200 rust_osvariant=android 1201 android=yes 1202 else 1203 cat > $TMPC << EOF 1204#define _GNU_SOURCE 1205#include <features.h> 1206#ifndef __USE_GNU 1207error using musl 1208#endif 1209EOF 1210 if compile_object; then 1211 rust_osvariant=gnu 1212 else 1213 rust_osvariant=musl 1214 fi 1215 fi 1216 1217 case "$cpu" in 1218 arm) 1219 # e.g. arm-unknown-linux-gnueabi, arm-unknown-linux-gnueabihf 1220 write_c_skeleton 1221 compile_object 1222 if $READELF -A $TMPO | grep Tag_API_VFP_args: > /dev/null; then 1223 rust_osvariant=${rust_osvariant}eabihf 1224 else 1225 rust_osvariant=${rust_osvariant}eabi 1226 fi 1227 ;; 1228 1229 mips64) 1230 # e.g. mips64-unknown-linux-gnuabi64 1231 rust_osvariant=${rust_osvariant}abi64 1232 ;; 1233 esac 1234 ;; 1235 1236 netbsd) 1237 # e.g. arm-unknown-netbsd-eabihf 1238 test "$host_arch" = arm && rust_osvariant=eabihf 1239 ;; 1240 1241 sunos) 1242 rust_machine=pc 1243 rust_os=solaris 1244 ;; 1245 1246 windows) 1247 # e.g. aarch64-pc-windows-gnullvm, x86_64-pc-windows-gnu (MSVC not supported) 1248 rust_machine=pc 1249 if test "$host_arch" = aarch64; then 1250 rust_osvariant=gnullvm 1251 else 1252 rust_osvariant=gnu 1253 fi 1254 ;; 1255 esac 1256 1257 # now tweak the architecture part, possibly based on pre-canonicalization --cpu 1258 case "$host_arch" in 1259 arm) 1260 # preserve ISA version (armv7 etc.) from $raw_cpu if passed via --cpu 1261 rust_arch=$raw_cpu 1262 test "$rust_arch" = arm && test "$rust_os" != linux && rust_arch=armv7 1263 ;; 1264 1265 mips) 1266 # preserve ISA version (mipsisa64r6 etc.) and include endianness 1267 rust_arch=${raw_cpu%el} 1268 test "$bigendian" = no && rust_arch=${rust_arch}el 1269 ;; 1270 1271 riscv32|riscv64) 1272 # e.g. riscv64gc-unknown-linux-gnu, but riscv64-linux-android 1273 test "$android" = no && rust_arch=${rust_arch}gc 1274 ;; 1275 1276 sparc64) 1277 if test "$rust_os" = solaris; then 1278 rust_arch=sparcv9 1279 rust_machine=sun 1280 fi 1281 ;; 1282 1283 x86_64) 1284 # e.g. x86_64-unknown-linux-gnux32 1285 test "$raw_cpu" = x32 && rust_osvariant=${rust_osvariant}x32 1286 ;; 1287 esac 1288 1289 if test "$android" = yes; then 1290 # e.g. aarch64-linux-android 1291 rust_target_triple=$rust_arch-$rust_os-$rust_osvariant 1292 else 1293 rust_target_triple=$rust_arch-$rust_machine-$rust_os${rust_osvariant:+-$rust_osvariant} 1294 fi 1295fi 1296 1297########################################## 1298# functions to probe cross compilers 1299 1300container="no" 1301runc="" 1302if test $use_containers = "yes" && (has "docker" || has "podman"); then 1303 case $($python "$source_path"/tests/docker/docker.py --engine "$container_engine" probe) in 1304 *docker) container=docker ;; 1305 podman) container=podman ;; 1306 no) container=no ;; 1307 esac 1308 if test "$container" != "no"; then 1309 docker_py="$python $source_path/tests/docker/docker.py --engine $container" 1310 runc=$container 1311 fi 1312fi 1313 1314# cross compilers defaults, can be overridden with --cross-cc-ARCH 1315: ${cross_prefix_aarch64="aarch64-linux-gnu-"} 1316: ${cross_prefix_aarch64_be="$cross_prefix_aarch64"} 1317: ${cross_prefix_alpha="alpha-linux-gnu-"} 1318: ${cross_prefix_arm="arm-linux-gnueabihf-"} 1319: ${cross_prefix_armeb="$cross_prefix_arm"} 1320: ${cross_prefix_hexagon="hexagon-unknown-linux-musl-"} 1321: ${cross_prefix_loongarch64="loongarch64-unknown-linux-gnu-"} 1322: ${cross_prefix_hppa="hppa-linux-gnu-"} 1323: ${cross_prefix_i386="i686-linux-gnu-"} 1324: ${cross_prefix_m68k="m68k-linux-gnu-"} 1325: ${cross_prefix_microblaze="microblaze-linux-musl-"} 1326: ${cross_prefix_mips64el="mips64el-linux-gnuabi64-"} 1327: ${cross_prefix_mips64="mips64-linux-gnuabi64-"} 1328: ${cross_prefix_mipsel="mipsel-linux-gnu-"} 1329: ${cross_prefix_mips="mips-linux-gnu-"} 1330: ${cross_prefix_ppc="powerpc-linux-gnu-"} 1331: ${cross_prefix_ppc64="powerpc64-linux-gnu-"} 1332: ${cross_prefix_ppc64le="$cross_prefix_ppc64"} 1333: ${cross_prefix_riscv64="riscv64-linux-gnu-"} 1334: ${cross_prefix_s390x="s390x-linux-gnu-"} 1335: ${cross_prefix_sh4="sh4-linux-gnu-"} 1336: ${cross_prefix_sparc64="sparc64-linux-gnu-"} 1337: ${cross_prefix_sparc="$cross_prefix_sparc64"} 1338: ${cross_prefix_tricore="tricore-"} 1339: ${cross_prefix_x86_64="x86_64-linux-gnu-"} 1340 1341: ${cross_cc_aarch64_be="$cross_cc_aarch64"} 1342: ${cross_cc_cflags_aarch64_be="-mbig-endian"} 1343: ${cross_cc_armeb="$cross_cc_arm"} 1344: ${cross_cc_cflags_armeb="-mbig-endian"} 1345: ${cross_cc_hexagon="hexagon-unknown-linux-musl-clang"} 1346: ${cross_cc_cflags_hexagon="-mv73 -O2 -static"} 1347: ${cross_cc_cflags_i386="-m32"} 1348: ${cross_cc_cflags_ppc="-m32 -mbig-endian"} 1349: ${cross_cc_cflags_ppc64="-m64 -mbig-endian"} 1350: ${cross_cc_ppc64le="$cross_cc_ppc64"} 1351: ${cross_cc_cflags_ppc64le="-m64 -mlittle-endian"} 1352: ${cross_cc_cflags_sparc64="-m64 -mcpu=ultrasparc"} 1353: ${cross_cc_sparc="$cross_cc_sparc64"} 1354: ${cross_cc_cflags_sparc="-m32 -mcpu=supersparc"} 1355: ${cross_cc_cflags_x86_64="-m64 -mcx16"} 1356 1357compute_target_variable() { 1358 eval "$2=" 1359 if eval test -n "\"\${cross_prefix_$1}\""; then 1360 if eval has "\"\${cross_prefix_$1}\$3\""; then 1361 eval "$2=\"\${cross_prefix_$1}\$3\"" 1362 fi 1363 fi 1364} 1365 1366have_target() { 1367 for i; do 1368 case " $target_list " in 1369 *" $i "*) return 0;; 1370 *) ;; 1371 esac 1372 done 1373 return 1 1374} 1375 1376# probe_target_compiler TARGET 1377# 1378# Look for a compiler for the given target, either native or cross. 1379# Set variables target_* if a compiler is found, and container_cross_* 1380# if a Docker-based cross-compiler image is known for the target. 1381# Set got_cross_cc to yes/no depending on whether a non-container-based 1382# compiler was found. 1383# 1384# If TARGET is a user-mode emulation target, also set build_static to 1385# "y" if static linking is possible. 1386# 1387probe_target_compiler() { 1388 # reset all output variables 1389 got_cross_cc=no 1390 container_image= 1391 container_hosts= 1392 container_cross_prefix= 1393 container_cross_cc= 1394 container_cross_ar= 1395 container_cross_as= 1396 container_cross_ld= 1397 container_cross_nm= 1398 container_cross_objcopy= 1399 container_cross_ranlib= 1400 container_cross_strip= 1401 1402 target_arch=${1%%-*} 1403 case $target_arch in 1404 aarch64) container_hosts="x86_64 aarch64" ;; 1405 aarch64_be) container_hosts="x86_64 aarch64" ;; 1406 alpha) container_hosts=x86_64 ;; 1407 arm) container_hosts="x86_64 aarch64" ;; 1408 hexagon) container_hosts=x86_64 ;; 1409 hppa) container_hosts=x86_64 ;; 1410 i386) container_hosts=x86_64 ;; 1411 loongarch64) container_hosts=x86_64 ;; 1412 m68k) container_hosts=x86_64 ;; 1413 microblaze) container_hosts=x86_64 ;; 1414 mips64el) container_hosts=x86_64 ;; 1415 mips64) container_hosts=x86_64 ;; 1416 mipsel) container_hosts=x86_64 ;; 1417 mips) container_hosts=x86_64 ;; 1418 ppc) container_hosts=x86_64 ;; 1419 ppc64|ppc64le) container_hosts=x86_64 ;; 1420 riscv64) container_hosts=x86_64 ;; 1421 s390x) container_hosts=x86_64 ;; 1422 sh4) container_hosts=x86_64 ;; 1423 sparc64) container_hosts=x86_64 ;; 1424 tricore) container_hosts=x86_64 ;; 1425 x86_64) container_hosts="aarch64 ppc64le x86_64" ;; 1426 xtensa*) container_hosts=x86_64 ;; 1427 esac 1428 1429 for host in $container_hosts; do 1430 test "$container" != no || continue 1431 test "$host" = "$cpu" || continue 1432 case $target_arch in 1433 # debian-all-test-cross architectures 1434 1435 aarch64_be) 1436 container_image=debian-all-test-cross 1437 container_cross_prefix=aarch64-linux-gnu- 1438 ;; 1439 hppa|m68k|mips|riscv64|sparc64) 1440 container_image=debian-all-test-cross 1441 ;; 1442 mips64) 1443 container_image=debian-all-test-cross 1444 container_cross_prefix=mips64-linux-gnuabi64- 1445 ;; 1446 ppc|ppc64|ppc64le) 1447 container_image=debian-all-test-cross 1448 container_cross_prefix=powerpc${target_arch#ppc}-linux-gnu- 1449 ;; 1450 1451 # debian-legacy-test-cross architectures (need Debian 11) 1452 # - libc6.1-dev-alpha-cross: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054412 1453 # - sh4-linux-user: binaries don't run with bookworm compiler 1454 1455 alpha|sh4) 1456 container_image=debian-legacy-test-cross 1457 ;; 1458 1459 # architectures with individual containers 1460 1461 aarch64) 1462 # We don't have any bigendian build tools so we only use this for AArch64 1463 container_image=debian-arm64-cross 1464 ;; 1465 arm) 1466 # We don't have any bigendian build tools so we only use this for ARM 1467 container_image=debian-armhf-cross 1468 container_cross_prefix=arm-linux-gnueabihf- 1469 ;; 1470 hexagon) 1471 container_cross_prefix=hexagon-unknown-linux-musl- 1472 container_cross_cc=${container_cross_prefix}clang 1473 ;; 1474 i386) 1475 container_image=debian-i686-cross 1476 container_cross_prefix=i686-linux-gnu- 1477 ;; 1478 loongarch64) 1479 container_image=debian-loongarch-cross 1480 container_cross_prefix=loongarch64-unknown-linux-gnu- 1481 ;; 1482 microblaze) 1483 container_cross_prefix=microblaze-linux-musl- 1484 ;; 1485 mips64el) 1486 container_image=debian-all-test-cross 1487 container_cross_prefix=mips64el-linux-gnuabi64- 1488 ;; 1489 tricore) 1490 container_image=debian-tricore-cross 1491 container_cross_prefix=tricore- 1492 ;; 1493 x86_64) 1494 container_image=debian-amd64-cross 1495 ;; 1496 xtensa*) 1497 container_image=debian-xtensa-cross 1498 1499 # default to the dc232b cpu 1500 container_cross_prefix=/opt/2020.07/xtensa-dc232b-elf/bin/xtensa-dc232b-elf- 1501 ;; 1502 esac 1503 # Debian and GNU architecture names usually match 1504 : ${container_image:=debian-$target_arch-cross} 1505 : ${container_cross_prefix:=$target_arch-linux-gnu-} 1506 : ${container_cross_cc:=${container_cross_prefix}gcc} 1507 : ${container_cross_ar:=${container_cross_prefix}ar} 1508 : ${container_cross_as:=${container_cross_prefix}as} 1509 : ${container_cross_ld:=${container_cross_prefix}ld} 1510 : ${container_cross_nm:=${container_cross_prefix}nm} 1511 : ${container_cross_objcopy:=${container_cross_prefix}objcopy} 1512 : ${container_cross_ranlib:=${container_cross_prefix}ranlib} 1513 : ${container_cross_strip:=${container_cross_prefix}strip} 1514 done 1515 1516 try=cross 1517 # For softmmu/roms also look for a bi-endian or multilib-enabled host compiler 1518 if [ "${1%softmmu}" != "$1" ] || test "$target_arch" = "$cpu"; then 1519 case "$target_arch:$cpu" in 1520 aarch64_be:aarch64 | \ 1521 armeb:arm | \ 1522 i386:x86_64 | \ 1523 mips*:mips64 | \ 1524 ppc*:ppc64 | \ 1525 sparc:sparc64 | \ 1526 "$cpu:$cpu") 1527 try='native cross' ;; 1528 esac 1529 fi 1530 eval "target_cflags=\${cross_cc_cflags_$target_arch}" 1531 for thistry in $try; do 1532 case $thistry in 1533 native) 1534 target_cc=$cc 1535 target_ccas=$ccas 1536 target_ar=$ar 1537 target_as=$as 1538 target_ld=$ld 1539 target_nm=$nm 1540 target_objcopy=$objcopy 1541 target_ranlib=$ranlib 1542 target_strip=$strip 1543 ;; 1544 cross) 1545 target_cc= 1546 if eval test -n "\"\${cross_cc_$target_arch}\""; then 1547 if eval has "\"\${cross_cc_$target_arch}\""; then 1548 eval "target_cc=\"\${cross_cc_$target_arch}\"" 1549 fi 1550 else 1551 compute_target_variable $target_arch target_cc gcc 1552 fi 1553 target_ccas=$target_cc 1554 compute_target_variable $target_arch target_ar ar 1555 compute_target_variable $target_arch target_as as 1556 compute_target_variable $target_arch target_ld ld 1557 compute_target_variable $target_arch target_nm nm 1558 compute_target_variable $target_arch target_objcopy objcopy 1559 compute_target_variable $target_arch target_ranlib ranlib 1560 compute_target_variable $target_arch target_strip strip 1561 ;; 1562 esac 1563 1564 if test -n "$target_cc"; then 1565 case $target_arch in 1566 i386|x86_64) 1567 if $target_cc --version | grep -qi "clang"; then 1568 continue 1569 fi 1570 ;; 1571 esac 1572 elif test -n "$target_as" && test -n "$target_ld"; then 1573 # Special handling for assembler only targets 1574 case $target in 1575 tricore-softmmu) 1576 build_static= 1577 got_cross_cc=yes 1578 break 1579 ;; 1580 *) 1581 continue 1582 ;; 1583 esac 1584 else 1585 continue 1586 fi 1587 1588 write_c_skeleton 1589 case $1 in 1590 *-softmmu) 1591 if do_compiler "$target_cc" $target_cflags -o $TMPO -c $TMPC && 1592 do_compiler "$target_cc" $target_cflags -r -nostdlib -o "${TMPDIR1}/${TMPB}2.o" "$TMPO" -lgcc; then 1593 got_cross_cc=yes 1594 break 1595 fi 1596 ;; 1597 *) 1598 if do_compiler "$target_cc" $target_cflags -o $TMPE $TMPC -static ; then 1599 build_static=y 1600 got_cross_cc=yes 1601 break 1602 fi 1603 if do_compiler "$target_cc" $target_cflags -o $TMPE $TMPC ; then 1604 build_static= 1605 got_cross_cc=yes 1606 break 1607 fi 1608 ;; 1609 esac 1610 done 1611 if test $got_cross_cc != yes; then 1612 build_static= 1613 target_cc= 1614 target_ccas= 1615 target_ar= 1616 target_as= 1617 target_ld= 1618 target_nm= 1619 target_objcopy= 1620 target_ranlib= 1621 target_strip= 1622 fi 1623 test -n "$target_cc" 1624} 1625 1626write_target_makefile() { 1627 echo "EXTRA_CFLAGS=$target_cflags" 1628 if test -z "$target_cc" && test -z "$target_as"; then 1629 test -z "$container_image" && error_exit "Internal error: could not find cross compiler for $1?" 1630 echo "$1: docker-image-$container_image" >> Makefile.prereqs 1631 if test -n "$container_cross_cc"; then 1632 echo "CC=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --" 1633 echo "CCAS=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --" 1634 fi 1635 echo "AR=$docker_py cc --cc $container_cross_ar -i qemu/$container_image -s $source_path --" 1636 echo "AS=$docker_py cc --cc $container_cross_as -i qemu/$container_image -s $source_path --" 1637 echo "LD=$docker_py cc --cc $container_cross_ld -i qemu/$container_image -s $source_path --" 1638 echo "NM=$docker_py cc --cc $container_cross_nm -i qemu/$container_image -s $source_path --" 1639 echo "OBJCOPY=$docker_py cc --cc $container_cross_objcopy -i qemu/$container_image -s $source_path --" 1640 echo "RANLIB=$docker_py cc --cc $container_cross_ranlib -i qemu/$container_image -s $source_path --" 1641 echo "STRIP=$docker_py cc --cc $container_cross_strip -i qemu/$container_image -s $source_path --" 1642 else 1643 if test -n "$target_cc"; then 1644 echo "CC=$target_cc" 1645 echo "CCAS=$target_ccas" 1646 fi 1647 if test -n "$target_ar"; then 1648 echo "AR=$target_ar" 1649 fi 1650 if test -n "$target_as"; then 1651 echo "AS=$target_as" 1652 fi 1653 if test -n "$target_ld"; then 1654 echo "LD=$target_ld" 1655 fi 1656 if test -n "$target_nm"; then 1657 echo "NM=$target_nm" 1658 fi 1659 if test -n "$target_objcopy"; then 1660 echo "OBJCOPY=$target_objcopy" 1661 fi 1662 if test -n "$target_ranlib"; then 1663 echo "RANLIB=$target_ranlib" 1664 fi 1665 if test -n "$target_strip"; then 1666 echo "STRIP=$target_strip" 1667 fi 1668 fi 1669} 1670 1671####################################### 1672# cross-compiled firmware targets 1673 1674# Set up build tree symlinks that point back into the source tree 1675# (these can be both files and directories). 1676# Caution: avoid adding files or directories here using wildcards. This 1677# will result in problems later if a new file matching the wildcard is 1678# added to the source tree -- nothing will cause configure to be rerun 1679# so the build tree will be missing the link back to the new file, and 1680# tests might fail. Prefer to keep the relevant files in their own 1681# directory and symlink the directory instead. 1682LINKS="Makefile" 1683LINKS="$LINKS docs/config" 1684LINKS="$LINKS pc-bios/optionrom/Makefile" 1685LINKS="$LINKS pc-bios/s390-ccw/Makefile" 1686LINKS="$LINKS pc-bios/vof/Makefile" 1687LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit 1688LINKS="$LINKS tests/avocado tests/data" 1689LINKS="$LINKS tests/qemu-iotests/check tests/qemu-iotests/Makefile" 1690LINKS="$LINKS python" 1691for f in $LINKS ; do 1692 if [ -e "$source_path/$f" ]; then 1693 symlink "$source_path/$f" "$f" 1694 fi 1695done 1696 1697# use included Linux headers for KVM architectures 1698if test "$host_os" = "linux" && test -n "$linux_arch"; then 1699 symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm 1700fi 1701 1702echo "# Automatically generated by configure - do not modify" > Makefile.prereqs 1703 1704# Mac OS X ships with a broken assembler 1705if have_target i386-softmmu x86_64-softmmu && \ 1706 test "$host_os" != "darwin" && test "$host_os" != "sunos" && \ 1707 test "$host_os" != "haiku" && \ 1708 probe_target_compiler i386-softmmu; then 1709 subdirs="$subdirs pc-bios/optionrom" 1710 config_mak=pc-bios/optionrom/config.mak 1711 echo "# Automatically generated by configure - do not modify" > $config_mak 1712 echo "TOPSRC_DIR=$source_path" >> $config_mak 1713 write_target_makefile >> $config_mak 1714fi 1715 1716if have_target ppc-softmmu ppc64-softmmu && \ 1717 probe_target_compiler ppc-softmmu; then 1718 subdirs="$subdirs pc-bios/vof" 1719 config_mak=pc-bios/vof/config.mak 1720 echo "# Automatically generated by configure - do not modify" > $config_mak 1721 echo "SRC_DIR=$source_path/pc-bios/vof" >> $config_mak 1722 write_target_makefile >> $config_mak 1723fi 1724 1725# Only build s390-ccw bios if the compiler has -march=z900 or -march=z10 1726# (which is the lowest architecture level that Clang supports) 1727if have_target s390x-softmmu && probe_target_compiler s390x-softmmu && \ 1728 GIT=git "$source_path/scripts/git-submodule.sh" "$git_submodules_action" roms/SLOF >> config.log 2>&1; then 1729 write_c_skeleton 1730 do_compiler "$target_cc" $target_cc_cflags -march=z900 -o $TMPO -c $TMPC 1731 has_z900=$? 1732 if [ $has_z900 = 0 ] || do_compiler "$target_cc" $target_cc_cflags -march=z10 -msoft-float -Werror -o $TMPO -c $TMPC; then 1733 if [ $has_z900 != 0 ]; then 1734 echo "WARNING: Your compiler does not support the z900!" 1735 echo " The s390-ccw bios will only work with guest CPUs >= z10." 1736 fi 1737 subdirs="$subdirs pc-bios/s390-ccw" 1738 config_mak=pc-bios/s390-ccw/config-host.mak 1739 echo "# Automatically generated by configure - do not modify" > $config_mak 1740 echo "SRC_PATH=$source_path/pc-bios/s390-ccw" >> $config_mak 1741 echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_mak 1742 write_target_makefile >> $config_mak 1743 fi 1744fi 1745 1746####################################### 1747# generate config-host.mak 1748 1749config_host_mak="config-host.mak" 1750 1751echo "# Automatically generated by configure - do not modify" > $config_host_mak 1752echo >> $config_host_mak 1753 1754echo all: >> $config_host_mak 1755 1756echo "SRC_PATH=$source_path" >> $config_host_mak 1757echo "TARGET_DIRS=$target_list" >> $config_host_mak 1758echo "GDB=$gdb_bin" >> $config_host_mak 1759if test "$container" != no; then 1760 echo "RUNC=$runc" >> $config_host_mak 1761fi 1762echo "SUBDIRS=$subdirs" >> $config_host_mak 1763if test "$rust" != disabled; then 1764 echo "RUST_TARGET_TRIPLE=$rust_target_triple" >> $config_host_mak 1765fi 1766echo "PYTHON=$python" >> $config_host_mak 1767echo "MKVENV_ENSUREGROUP=$mkvenv ensuregroup $mkvenv_online_flag" >> $config_host_mak 1768echo "GENISOIMAGE=$genisoimage" >> $config_host_mak 1769echo "MESON=$meson" >> $config_host_mak 1770echo "NINJA=$ninja" >> $config_host_mak 1771echo "EXESUF=$EXESUF" >> $config_host_mak 1772if test "$default_targets" = "yes"; then 1773 echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak 1774fi 1775 1776# tests/tcg configuration 1777mkdir -p tests/tcg 1778echo "# Automatically generated by configure - do not modify" > tests/tcg/$config_host_mak 1779echo "SRC_PATH=$source_path" >> tests/tcg/$config_host_mak 1780if test "$plugins" = "yes" ; then 1781 echo "CONFIG_PLUGIN=y" >> tests/tcg/$config_host_mak 1782fi 1783 1784tcg_tests_targets= 1785for target in $target_list; do 1786 arch=${target%%-*} 1787 1788 case $target in 1789 xtensa*-linux-user) 1790 # the toolchain is not complete with headers, only build system tests 1791 continue 1792 ;; 1793 *-softmmu) 1794 test -f "$source_path/tests/tcg/$arch/Makefile.softmmu-target" || continue 1795 qemu="qemu-system-$arch" 1796 ;; 1797 *-linux-user|*-bsd-user) 1798 qemu="qemu-$arch" 1799 ;; 1800 esac 1801 1802 if probe_target_compiler $target || test -n "$container_image"; then 1803 test -n "$container_image" && build_static=y 1804 mkdir -p "tests/tcg/$target" 1805 config_target_mak=tests/tcg/$target/config-target.mak 1806 ln -sf "$source_path/tests/tcg/Makefile.target" "tests/tcg/$target/Makefile" 1807 echo "# Automatically generated by configure - do not modify" > "$config_target_mak" 1808 echo "TARGET_NAME=$arch" >> "$config_target_mak" 1809 echo "TARGET=$target" >> "$config_target_mak" 1810 write_target_makefile "build-tcg-tests-$target" >> "$config_target_mak" 1811 echo "BUILD_STATIC=$build_static" >> "$config_target_mak" 1812 echo "QEMU=$PWD/$qemu" >> "$config_target_mak" 1813 1814 # will GDB work with these binaries? 1815 if test "${gdb_arches#*$arch}" != "$gdb_arches"; then 1816 echo "GDB=$gdb_bin" >> $config_target_mak 1817 fi 1818 1819 if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge $gdb_version 15.1; then 1820 echo "GDB_HAS_MTE=y" >> $config_target_mak 1821 fi 1822 1823 if test "${gdb_arches#*aarch64}" != "$gdb_arches" && version_ge $gdb_version 16.0; then 1824 # GDB has to support MTE in baremetal to allow debugging MTE in QEMU system mode 1825 echo "GDB_SUPPORTS_MTE_IN_BAREMETAL=y" >> $config_target_mak 1826 fi 1827 1828 echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> Makefile.prereqs 1829 tcg_tests_targets="$tcg_tests_targets $target" 1830 fi 1831done 1832 1833if test "$tcg" = "enabled"; then 1834 echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> $config_host_mak 1835fi 1836 1837if test "$skip_meson" = no; then 1838 cross="config-meson.cross.new" 1839 meson_quote() { 1840 test $# = 0 && return 1841 echo "'$(echo $* | sed "s/ /','/g")'" 1842 } 1843 1844 echo "# Automatically generated by configure - do not modify" > $cross 1845 echo "[properties]" >> $cross 1846 1847 # unroll any custom device configs 1848 for a in $device_archs; do 1849 eval "c=\$devices_${a}" 1850 echo "${a}-softmmu = '$c'" >> $cross 1851 done 1852 1853 echo "[built-in options]" >> $cross 1854 echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross 1855 echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross 1856 test -n "$objcc" && echo "objc_args = [$(meson_quote $OBJCFLAGS $EXTRA_OBJCFLAGS)]" >> $cross 1857 echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXTRA_LDFLAGS)]" >> $cross 1858 echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross 1859 1860 # Only enable by default for git builds and on select OSes 1861 echo "# environment defaults, can still be overridden on " >> $cross 1862 echo "# the command line" >> $cross 1863 if test -e "$source_path/.git" && \ 1864 { test "$host_os" = linux || test "$host_os" = "windows"; }; then 1865 echo 'werror = true' >> $cross 1866 fi 1867 echo "[project options]" >> $cross 1868 if test "$SMBD" != ''; then 1869 echo "smbd = $(meson_quote "$SMBD")" >> $cross 1870 fi 1871 if test "${QEMU_GA_MANUFACTURER}" != ''; then 1872 echo "qemu_ga_manufacturer = $(meson_quote "${QEMU_GA_MANUFACTURER}")" >> $cross 1873 fi 1874 if test "${QEMU_GA_DISTRO}" != ''; then 1875 echo "qemu_ga_distro = $(meson_quote "${QEMU_GA_DISTRO}")" >> $cross 1876 fi 1877 if test "${QEMU_GA_VERSION}" != ''; then 1878 echo "qemu_ga_version = $(meson_quote "${QEMU_GA_VERSION}")" >> $cross 1879 fi 1880 1881 echo >> $cross 1882 echo "[binaries]" >> $cross 1883 echo "c = [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross 1884 test -n "$cxx" && echo "cpp = [$(meson_quote $cxx $CPU_CFLAGS)]" >> $cross 1885 test -n "$objcc" && echo "objc = [$(meson_quote $objcc $CPU_CFLAGS)]" >> $cross 1886 if test "$rust" != disabled; then 1887 if test "$rust_host_triple" != "$rust_target_triple"; then 1888 echo "rust = [$(meson_quote $rustc --target "$rust_target_triple")]" >> $cross 1889 else 1890 echo "rust = [$(meson_quote $rustc)]" >> $cross 1891 fi 1892 fi 1893 echo "ar = [$(meson_quote $ar)]" >> $cross 1894 echo "dlltool = [$(meson_quote $dlltool)]" >> $cross 1895 echo "nm = [$(meson_quote $nm)]" >> $cross 1896 echo "pkgconfig = [$(meson_quote $pkg_config)]" >> $cross 1897 echo "pkg-config = [$(meson_quote $pkg_config)]" >> $cross 1898 echo "ranlib = [$(meson_quote $ranlib)]" >> $cross 1899 echo "readelf = [$(meson_quote $readelf)]" >> $cross 1900 if has $sdl2_config; then 1901 echo "sdl2-config = [$(meson_quote $sdl2_config)]" >> $cross 1902 fi 1903 echo "strip = [$(meson_quote $strip)]" >> $cross 1904 echo "widl = [$(meson_quote $widl)]" >> $cross 1905 echo "windres = [$(meson_quote $windres)]" >> $cross 1906 echo "windmc = [$(meson_quote $windmc)]" >> $cross 1907 if test "$cross_compile" = "yes"; then 1908 echo "[host_machine]" >> $cross 1909 echo "system = '$host_os'" >> $cross 1910 case "$cpu" in 1911 i386) 1912 echo "cpu_family = 'x86'" >> $cross 1913 ;; 1914 *) 1915 echo "cpu_family = '$cpu'" >> $cross 1916 ;; 1917 esac 1918 echo "cpu = '$cpu'" >> $cross 1919 if test "$bigendian" = "yes" ; then 1920 echo "endian = 'big'" >> $cross 1921 else 1922 echo "endian = 'little'" >> $cross 1923 fi 1924 1925 native="config-meson.native.new" 1926 echo "# Automatically generated by configure - do not modify" > $native 1927 echo "[binaries]" >> $native 1928 echo "c = [$(meson_quote $host_cc)]" >> $native 1929 if test "$rust" != disabled; then 1930 echo "rust = [$(meson_quote $rustc)]" >> $cross 1931 fi 1932 mv $native config-meson.native 1933 meson_option_add --native-file 1934 meson_option_add config-meson.native 1935 fi 1936 mv $cross config-meson.cross 1937 meson_add_machine_file config-meson.cross 1938 if test -f "$source_path/configs/meson/$host_os.txt"; then 1939 meson_add_machine_file $source_path/configs/meson/$host_os.txt 1940 fi 1941 1942 rm -rf meson-private meson-info meson-logs 1943 1944 test "$download" = "disabled" && meson_option_add "--wrap-mode=nodownload" 1945 test "$default_feature" = no && meson_option_add -Dauto_features=disabled 1946 test "$static" = yes && meson_option_add -Dprefer_static=true 1947 test "$pie" = no && meson_option_add -Db_pie=false 1948 1949 # QEMU options 1950 test "$rust" != "disabled" && meson_option_add "-Drust=$rust" 1951 test "$cfi" != false && meson_option_add "-Dcfi=$cfi" "-Db_lto=$cfi" 1952 test "$docs" != auto && meson_option_add "-Ddocs=$docs" 1953 test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE" 1954 test "$plugins" = yes && meson_option_add "-Dplugins=true" 1955 test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg" 1956 run_meson() { 1957 NINJA=$ninja $meson setup "$@" "$PWD" "$source_path" 1958 } 1959 eval run_meson $meson_options 1960 if test "$?" -ne 0 ; then 1961 error_exit "meson setup failed" 1962 fi 1963 echo "$meson" > build.ninja.stamp 1964else 1965 if test -f meson-private/cmd_line.txt; then 1966 # Adjust old command line options that were removed 1967 # sed -i is not portable 1968 perl -i -ne ' 1969 /^sphinx_build/ && next; 1970 print;' meson-private/cmd_line.txt 1971 fi 1972fi 1973 1974# Save the configure command line for later reuse. 1975cat <<EOD >config.status 1976#!/bin/sh 1977# Generated by configure. 1978# Run this file to recreate the current configuration. 1979# Compiler output produced by configure, useful for debugging 1980# configure, is in config.log if it exists. 1981EOD 1982 1983preserve_env() { 1984 envname=$1 1985 1986 eval envval=\$$envname 1987 1988 if test -n "$envval" 1989 then 1990 echo "$envname='$envval'" >> config.status 1991 echo "export $envname" >> config.status 1992 else 1993 echo "unset $envname" >> config.status 1994 fi 1995} 1996 1997# Preserve various env variables that influence what 1998# features/build target configure will detect 1999preserve_env AR 2000preserve_env AS 2001preserve_env CC 2002preserve_env CFLAGS 2003preserve_env CXX 2004preserve_env CXXFLAGS 2005preserve_env DLLTOOL 2006preserve_env LD 2007preserve_env LDFLAGS 2008preserve_env LD_LIBRARY_PATH 2009preserve_env NM 2010preserve_env OBJCFLAGS 2011preserve_env OBJCOPY 2012preserve_env PATH 2013preserve_env PKG_CONFIG 2014preserve_env PKG_CONFIG_LIBDIR 2015preserve_env PKG_CONFIG_PATH 2016preserve_env PYTHON 2017preserve_env QEMU_GA_MANUFACTURER 2018preserve_env QEMU_GA_DISTRO 2019preserve_env QEMU_GA_VERSION 2020preserve_env SDL2_CONFIG 2021preserve_env SMBD 2022preserve_env STRIP 2023preserve_env WIDL 2024preserve_env WINDRES 2025preserve_env WINDMC 2026 2027printf "exec" >>config.status 2028for i in "$0" "$@"; do 2029 test "$i" = --skip-meson || printf " %s" "$(quote_sh "$i")" >>config.status 2030done 2031echo ' "$@"' >>config.status 2032chmod +x config.status 2033 2034rm -r "$TMPDIR1" 2035 2036if test "$rust" != disabled; then 2037 echo 2038 echo 'INFO: Rust bindings generation with `bindgen` might fail in some cases where' 2039 echo 'the detected `libclang` does not match the expected `clang` version/target. In' 2040 echo 'this case you must pass the path to `clang` and `libclang` to your build' 2041 echo 'command invocation using the environment variables CLANG_PATH and LIBCLANG_PATH' 2042fi 2043