Repository: conan-io/conan-center-index

Issue:
[package] ffmpeg/4.4.3: configure hangs when building for Android with NDK >= 24
### Description

When building ffmpeg 4.4.3 for Android, its `configure` step hangs. In Terminal window I see that `grep` is being executed at the moment, but `grep`'s process consumes 0% CPU. Waited for about 10 minutes before terminating.

Never had such issue when building for macOS and iOS. Also no such issue with NDK 22 targeting armv7.

### Package and Environment Details

* Package Name/Version: **ffmpeg/4.4.3**
* Operating System+version: macOS 12.6.2
* Compiler+version: **clang 14**
* Conan version: **conan 1.57.0**
* Python version: **Python 3.10.9**

### Conan profile

Configuration (profile_host):
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.libcxx=c++_shared
compiler.version=14
os=Android
os.api_level=21
[options]
with_ffmpeg=False
[build_requires]
*: android-ndk/r24
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmaketoolchain:system_processor=aarch64

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=14
os=Macos
os_build=Macos
[options]
[build_requires]
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja

### Steps to reproduce

```
conan install ffmpeg/4.4.3@ \
  -o "ffmpeg/*:avdevice=False" \
  -o "ffmpeg/*:avfilter=False" \
  -o "ffmpeg/*:postproc=False" \
  -o "ffmpeg/*:swresample=False" \
  -o "ffmpeg/*:with_freetype=False" \
  -o "ffmpeg/*:with_libfdk_aac=False" \
  -o "ffmpeg/*:with_libmp3lame=False" \
  -o "ffmpeg/*:with_libvpx=False" \
  -o "ffmpeg/*:with_libwebp=False" \
  -o "ffmpeg/*:with_libx264=False" \
  -o "ffmpeg/*:with_libx265=False" \
  -o "ffmpeg/*:with_openh264=False" \
  -o "ffmpeg/*:with_openjpeg=False" \
  -o "ffmpeg/*:with_opus=False" \
  -o "ffmpeg/*:with_programs=False" \
  -o "ffmpeg/*:with_ssl=False" \
  -o "ffmpeg/*:with_vorbis=False"
```

### Logs

<details><summary>Click to expand log</summary>

```
ffmpeg/4.4.3: Applying build-requirement: android-ndk/r24
ffmpeg/4.4.3: Applying build-requirement: pkgconf/1.9.3
ffmpeg/4.4.3: WARN: Build folder is dirty, removing it: /Users/kambala/dev/vcmi/conan-deps-android-64/.conan/data/ffmpeg/4.4.3/_/_/build/ad386662099a8969bfa273ac81ec551556cf45a4
ffmpeg/4.4.3: Copying sources to build folder
ffmpeg/4.4.3: Building your package in /Users/kambala/dev/vcmi/conan-deps-android-64/.conan/data/ffmpeg/4.4.3/_/_/build/ad386662099a8969bfa273ac81ec551556cf45a4
ffmpeg/4.4.3: Generator pkg_config created liblzma.pc
ffmpeg/4.4.3: Generator pkg_config created bzip2.pc
ffmpeg/4.4.3: Generator pkg_config created libiconv.pc
ffmpeg/4.4.3: Generator pkg_config created zlib.pc
ffmpeg/4.4.3: Aggregating env generators
ffmpeg/4.4.3: Calling build()
ffmpeg/4.4.3: Calling:
 > source_subfolder/configure '--pkg-config-flags=--static' '--disable-doc' '--enable-cross-compile' '--enable-asm' '--disable-shared' '--enable-static' '--enable-pic' '--disable-avdevice' '--enable-avcodec' '--enable-avformat' '--disable-swresample' '--enable-swscale' '--disable-postproc' '--disable-avfilter' '--enable-bzlib' '--enable-zlib' '--enable-lzma' '--enable-iconv' '--disable-libopenjpeg' '--disable-libopenh264' '--disable-libvorbis' '--disable-libopus' '--disable-libzmq' '--disable-sdl2' '--disable-libx264' '--disable-libx265' '--disable-libvpx' '--disable-libmp3lame' '--disable-libfdk-aac' '--disable-libwebp' '--disable-openssl' '--disable-alsa' '--disable-libpulse' '--disable-vaapi' '--disable-vdpau' '--disable-libxcb' '--disable-libxcb-shm' '--disable-libxcb-shape' '--disable-libxcb-xfixes' '--disable-appkit' '--disable-avfoundation' '--disable-coreimage' '--disable-audiotoolbox' '--disable-videotoolbox' '--disable-securetransport' '--disable-cuda' '--disable-cuvid' '--disable-nonfree' '--disable-gpl' '--disable-vulkan' '--arch=aarch64' '--disable-programs' '--as=/Users/kambala/dev/vcmi/conan-deps-android-64/.conan/data/android-ndk/r24/_/_/package/06d313f2ce6737a31e5d7ccd4d516d2ac742276a/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-as' '--cc=/Users/kambala/dev/vcmi/conan-deps-android-64/.conan/data/android-ndk/r24/_/_/package/06d313f2ce6737a31e5d7ccd4d516d2ac742276a/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang' '--cxx=/Users/kambala/dev/vcmi/conan-deps-android-64/.conan/data/android-ndk/r24/_/_/package/06d313f2ce6737a31e5d7ccd4d516d2ac742276a/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang++' '--target-os=android' '--extra-cflags=' '--extra-ldflags=' '--prefix=/Users/kambala/dev/vcmi/conan-deps-android-64/.conan/data/ffmpeg/4.4.3/_/_/package/ad386662099a8969bfa273ac81ec551556cf45a4' '--bindir=${prefix}/bin' '--libdir=${prefix}/lib'
```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py
--- a/recipes/ffmpeg/all/conanfile.py
+++ b/recipes/ffmpeg/all/conanfile.py
@@ -536,10 +536,10 @@ def opt_append_disable_if_set(args, what, v):
             ])
         if not self.options.with_programs:
             args.append("--disable-programs")
-        # since ffmpeg"s build system ignores toolchain variables 
+        # since ffmpeg's build system ignores toolchain variables 
         if tools.get_env("AR"):
             args.append("--ar={}".format(tools.get_env("AR")))
-        if tools.get_env("AS"):
+        if tools.get_env("AS") and self.options.with_asm:
             args.append("--as={}".format(tools.get_env("AS")))
         if tools.get_env("CC"):
             args.append("--cc={}".format(tools.get_env("CC")))


Test patch: