Bladeren bron

configure: cross-compiling without cross_prefix

The iOS toolchain does not use the host prefix naming convention. We add a
new option `--enable-cross-compile` that forces cross-compile even without
a cross_prefix.
osy 4 jaren geleden
bovenliggende
commit
6994bb30cd
1 gewijzigde bestanden met toevoegingen van 12 en 1 verwijderingen
  1. 12 1
      configure

+ 12 - 1
configure

@@ -234,6 +234,7 @@ cpu=""
 iasl="iasl"
 iasl="iasl"
 interp_prefix="/usr/gnemul/qemu-%M"
 interp_prefix="/usr/gnemul/qemu-%M"
 static="no"
 static="no"
+cross_compile="no"
 cross_prefix=""
 cross_prefix=""
 audio_drv_list=""
 audio_drv_list=""
 block_drv_rw_whitelist=""
 block_drv_rw_whitelist=""
@@ -457,6 +458,11 @@ for opt do
   optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
   optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
   case "$opt" in
   case "$opt" in
   --cross-prefix=*) cross_prefix="$optarg"
   --cross-prefix=*) cross_prefix="$optarg"
+                    cross_compile="yes"
+  ;;
+  --enable-cross-compile) cross_compile="yes"
+  ;;
+  --disable-cross-compile) cross_compile="no"
   ;;
   ;;
   --cc=*) CC="$optarg"
   --cc=*) CC="$optarg"
   ;;
   ;;
@@ -879,6 +885,10 @@ for opt do
   ;;
   ;;
   --cross-prefix=*)
   --cross-prefix=*)
   ;;
   ;;
+  --enable-cross-compile)
+  ;;
+  --disable-cross-compile)
+  ;;
   --cc=*)
   --cc=*)
   ;;
   ;;
   --host-cc=*) host_cc="$optarg"
   --host-cc=*) host_cc="$optarg"
@@ -1688,6 +1698,7 @@ Advanced options (experts only):
   --efi-aarch64=PATH       PATH of efi file to use for aarch64 VMs.
   --efi-aarch64=PATH       PATH of efi file to use for aarch64 VMs.
   --with-suffix=SUFFIX     suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
   --with-suffix=SUFFIX     suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
   --with-pkgversion=VERS   use specified string as sub-version of the package
   --with-pkgversion=VERS   use specified string as sub-version of the package
+  --enable-cross-compile   enable cross compiling (set automatically if $cross_prefix is set)
   --enable-debug           enable common debug build options
   --enable-debug           enable common debug build options
   --enable-sanitizers      enable default sanitizers
   --enable-sanitizers      enable default sanitizers
   --enable-tsan            enable thread sanitizer
   --enable-tsan            enable thread sanitizer
@@ -7023,7 +7034,7 @@ if has $sdl2_config; then
 fi
 fi
 echo "strip = [$(meson_quote $strip)]" >> $cross
 echo "strip = [$(meson_quote $strip)]" >> $cross
 echo "windres = [$(meson_quote $windres)]" >> $cross
 echo "windres = [$(meson_quote $windres)]" >> $cross
-if test -n "$cross_prefix"; then
+if test "$cross_compile" = "yes"; then
     cross_arg="--cross-file config-meson.cross"
     cross_arg="--cross-file config-meson.cross"
     echo "[host_machine]" >> $cross
     echo "[host_machine]" >> $cross
     if test "$mingw32" = "yes" ; then
     if test "$mingw32" = "yes" ; then