|
| 1 | +#!/bin/bash -e |
| 2 | + |
| 3 | +. ../../include/depinfo.sh |
| 4 | +. ../../include/path.sh |
| 5 | + |
| 6 | +if [ "$1" == "build" ]; then |
| 7 | + true |
| 8 | +elif [ "$1" == "clean" ]; then |
| 9 | + rm -rf _build$ndk_suffix |
| 10 | + exit 0 |
| 11 | +else |
| 12 | + exit 255 |
| 13 | +fi |
| 14 | + |
| 15 | +mkdir -p _build$ndk_suffix |
| 16 | +cd _build$ndk_suffix |
| 17 | + |
| 18 | +cpu=armv7-a |
| 19 | +[[ "$ndk_triple" == "aarch64"* ]] && cpu=armv8-a |
| 20 | +[[ "$ndk_triple" == "x86_64"* ]] && cpu=generic |
| 21 | +[[ "$ndk_triple" == "i686"* ]] && cpu="i686 --disable-asm" |
| 22 | + |
| 23 | +cpuflags= |
| 24 | +[[ "$ndk_triple" == "arm"* ]] && cpuflags="$cpuflags -mfpu=neon -mcpu=cortex-a8" |
| 25 | + |
| 26 | +../configure \ |
| 27 | + --target-os=android --enable-cross-compile --cross-prefix=$ndk_triple- --ar=$AR --cc=$CC --ranlib=$RANLIB \ |
| 28 | + --arch=${ndk_triple%%-*} --cpu=$cpu --pkg-config=pkg-config \ |
| 29 | + --extra-cflags="-I$prefix_dir/include $cpuflags" --extra-ldflags="-L$prefix_dir/lib" \ |
| 30 | + --pkg-config-flags="--static" \ |
| 31 | + \ |
| 32 | + --disable-nonfree \ |
| 33 | + --enable-version3 \ |
| 34 | + --enable-static \ |
| 35 | + --disable-shared \ |
| 36 | + --disable-vulkan \ |
| 37 | + --disable-iconv \ |
| 38 | + --disable-stripping \ |
| 39 | + --pkg-config-flags=--static \ |
| 40 | + \ |
| 41 | + --enable-decoders \ |
| 42 | + --enable-encoders \ |
| 43 | + --enable-libvorbis \ |
| 44 | + --enable-libvpx \ |
| 45 | + --enable-gpl \ |
| 46 | + --enable-libx264 \ |
| 47 | + --enable-muxers \ |
| 48 | + --enable-demuxers \ |
| 49 | + --enable-parsers \ |
| 50 | + \ |
| 51 | + --disable-protocols \ |
| 52 | + --disable-devices \ |
| 53 | + --disable-doc \ |
| 54 | + --disable-avdevice \ |
| 55 | + --disable-postproc \ |
| 56 | + --disable-programs \ |
| 57 | + --disable-gray \ |
| 58 | + --disable-swscale-alpha \ |
| 59 | + \ |
| 60 | + --enable-jni \ |
| 61 | + --enable-bsfs \ |
| 62 | + --enable-mediacodec \ |
| 63 | + \ |
| 64 | + --disable-dxva2 \ |
| 65 | + --disable-vaapi \ |
| 66 | + --disable-vdpau \ |
| 67 | + --disable-bzlib \ |
| 68 | + --disable-linux-perf \ |
| 69 | + --disable-videotoolbox \ |
| 70 | + --disable-audiotoolbox \ |
| 71 | + \ |
| 72 | + --enable-small \ |
| 73 | + --enable-hwaccels \ |
| 74 | + --enable-optimizations \ |
| 75 | + --enable-runtime-cpudetect \ |
| 76 | + \ |
| 77 | + --enable-mbedtls \ |
| 78 | + \ |
| 79 | + --enable-libdav1d \ |
| 80 | + \ |
| 81 | + --enable-libxml2 \ |
| 82 | + \ |
| 83 | + --enable-avutil \ |
| 84 | + --enable-avcodec \ |
| 85 | + --enable-avfilter \ |
| 86 | + --enable-avformat \ |
| 87 | + --enable-swscale \ |
| 88 | + --enable-swresample \ |
| 89 | + \ |
| 90 | + \ |
| 91 | + \ |
| 92 | + --enable-filters \ |
| 93 | + \ |
| 94 | + --enable-protocol=async \ |
| 95 | + --enable-protocol=cache \ |
| 96 | + --enable-protocol=crypto \ |
| 97 | + --enable-protocol=data \ |
| 98 | + --enable-protocol=ffrtmphttp \ |
| 99 | + --enable-protocol=file \ |
| 100 | + --enable-protocol=ftp \ |
| 101 | + --enable-protocol=hls \ |
| 102 | + --enable-protocol=http \ |
| 103 | + --enable-protocol=httpproxy \ |
| 104 | + --enable-protocol=https \ |
| 105 | + --enable-protocol=pipe \ |
| 106 | + --enable-protocol=rtmp \ |
| 107 | + --enable-protocol=rtmps \ |
| 108 | + --enable-protocol=rtmpt \ |
| 109 | + --enable-protocol=rtmpts \ |
| 110 | + --enable-protocol=rtp \ |
| 111 | + --enable-protocol=subfile \ |
| 112 | + --enable-protocol=tcp \ |
| 113 | + --enable-protocol=tls \ |
| 114 | + --enable-protocol=srt \ |
| 115 | + \ |
| 116 | + --enable-network \ |
| 117 | + |
| 118 | +make -j$cores |
| 119 | +make DESTDIR="$prefix_dir" install |
| 120 | + |
| 121 | +ln -sf "$prefix_dir"/lib/libswresample.so "$native_dir" |
| 122 | +ln -sf "$prefix_dir"/lib/libpostproc.so "$native_dir" |
| 123 | +ln -sf "$prefix_dir"/lib/libavutil.so "$native_dir" |
| 124 | +ln -sf "$prefix_dir"/lib/libavcodec.so "$native_dir" |
| 125 | +ln -sf "$prefix_dir"/lib/libavformat.so "$native_dir" |
| 126 | +ln -sf "$prefix_dir"/lib/libswscale.so "$native_dir" |
| 127 | +ln -sf "$prefix_dir"/lib/libavfilter.so "$native_dir" |
| 128 | +ln -sf "$prefix_dir"/lib/libavdevice.so "$native_dir" |
0 commit comments