├── .vscode └── settings.json ├── .gitignore ├── jni ├── Application.mk └── Android.mk ├── cleanup.sh ├── utils ├── package.sh ├── print_elf.sh ├── test-all.sh └── fix_ffmpeg.sh ├── README.md ├── LICENSE ├── .github └── workflows │ └── build-android.yml └── COPYING.LGPLv3 /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "chat.tools.autoApprove": true 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .idea/ 3 | tmp/ 4 | jni/ 5 | obj/ 6 | libs/ 7 | ffmpeg/ 8 | x264/ 9 | /ffmpeg-* -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | # APP_ABI := all 2 | # APP_ABI := x86 3 | APP_ABI := armeabi-v7a arm64-v8a x86_64 x86 4 | 5 | APP_PLATFORM := android-22 6 | 7 | APP_OPTIM := release 8 | 9 | ifeq ($(ENABLE_16KB_PAGE_SIZE),true) 10 | APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true 11 | endif 12 | 13 | -------------------------------------------------------------------------------- /cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | THIS_DIR=$( 5 | cd $(dirname "$0") 6 | pwd 7 | ) 8 | cd $THIS_DIR 9 | echo "Cleaning up the build environment..." 10 | 11 | git clean -fdx 12 | git clean -ffdx build_script 13 | 14 | if [[ -d ffmpeg ]]; then 15 | cd ffmpeg 16 | git clean -ffdx 17 | cd .. 18 | fi 19 | 20 | if [[ -d x264 ]]; then 21 | cd x264 22 | git clean -ffdx 23 | cd .. 24 | fi 25 | -------------------------------------------------------------------------------- /utils/package.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | for FFMPEG_NAME in $(echo ffmpeg-* | tr ' ' '\n'); do 8 | echo "### Checking $FFMPEG_NAME" 9 | if [[ -d "$FFMPEG_NAME" ]]; then 10 | if command -v 7z >/dev/null 2>&1; then 11 | 7z a "${FFMPEG_NAME}.zip" "$FFMPEG_NAME" 12 | 7z a "${FFMPEG_NAME}.7z" "$FFMPEG_NAME" 13 | fi 14 | tar -cJf "${FFMPEG_NAME}.tar.xz" "$FFMPEG_NAME" 15 | fi 16 | done 17 | -------------------------------------------------------------------------------- /utils/print_elf.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ ! -d "$NDK" ]]; then 4 | echo "NDK directory not found: $NDK" 5 | exit 1 6 | fi 7 | 8 | READ_ELF=$(find "$NDK" -iname "*readelf*" | head -n 1) 9 | 10 | if [[ ! -f "${READ_ELF}" ]]; then 11 | echo "readelf not found in NDK toolchain" 12 | exit 1 13 | fi 14 | 15 | cd "$(dirname "$0")/.." 16 | 17 | find libs -type f -name "*.so" | while read -r file; do 18 | if [[ -f "$file" ]]; then 19 | echo "Processing $file" 20 | "${READ_ELF}" -l "$file" | grep "LOAD" 21 | else 22 | echo "File not found: $file" 23 | fi 24 | done 25 | -------------------------------------------------------------------------------- /utils/test-all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | ./cleanup.sh 8 | 9 | # Build ffmpeg 3.4.8 10 | ./build_android.sh --ffmpeg 3.4.8 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d 11 | # Build ffmpeg 3.4.8 + 16kb page size 12 | ./build_android.sh --ffmpeg 3.4.8 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb 13 | 14 | git clean -ffdx build/ffmpeg 15 | 16 | # Build ffmpeg 4.4.4 17 | ./build_android.sh --ffmpeg 4.4.4 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d 18 | # Build ffmpeg 4.4.4 + 16kb page size 19 | ./build_android.sh --ffmpeg 4.4.4 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb 20 | 21 | git clean -ffdx build/ffmpeg 22 | 23 | # Build ffmpeg 5.0 24 | ./build_android.sh --ffmpeg 5.0 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d 25 | # Build ffmpeg 5.0 + 16kb page size 26 | ./build_android.sh --ffmpeg 5.0 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb 27 | 28 | echo "All builds completed successfully." 29 | 30 | ./utils/package.sh 31 | -------------------------------------------------------------------------------- /utils/fix_ffmpeg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | cd "$(dirname "$0")/.." 6 | 7 | if [[ -f ffmpeg/libavcodec/aaccoder.c ]]; then 8 | # Check if `#undef B0` already exists, if so, exit directly 9 | if grep -q '#undef B0' ffmpeg/libavcodec/aaccoder.c; then 10 | echo "Already patched, skipping." 11 | exit 0 12 | fi 13 | 14 | cp ffmpeg/libavcodec/aaccoder.c ffmpeg/libavcodec/aaccoder.c.bak 15 | 16 | # Find the last `#include` statement 17 | last_include_line=$(grep -n '#include' ffmpeg/libavcodec/aaccoder.c | tail -n 1 | cut -d: -f1) 18 | # Copy the first $last_include_line lines 19 | head -n $last_include_line ffmpeg/libavcodec/aaccoder.c.bak >ffmpeg/libavcodec/aaccoder.c 20 | # Add multiple lines after the last `#include` statement 21 | 22 | echo "#ifdef B0" >>ffmpeg/libavcodec/aaccoder.c 23 | echo "#undef B0" >>ffmpeg/libavcodec/aaccoder.c 24 | echo "#endif" >>ffmpeg/libavcodec/aaccoder.c 25 | echo "#ifdef B1" >>ffmpeg/libavcodec/aaccoder.c 26 | echo "#undef B1" >>ffmpeg/libavcodec/aaccoder.c 27 | echo "#endif" >>ffmpeg/libavcodec/aaccoder.c 28 | 29 | # Append the rest of the backup file to the end 30 | tail -n +$((last_include_line + 1)) ffmpeg/libavcodec/aaccoder.c.bak >>ffmpeg/libavcodec/aaccoder.c 31 | 32 | cd ffmpeg/libavcodec 33 | export GIT_PAGER=cat 34 | git diff aaccoder.c 35 | echo "Patched ffmpeg/libavcodec/aaccoder.c successfully." 36 | else 37 | echo "ffmpeg/libavcodec/aaccoder.c not found, skipping patch." 38 | exit 1 39 | fi 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FFmpeg-Android 2 | 3 | Support building FFmpeg for Android with x264. 4 | 5 | | FFmpeg | x264 | Android NDK | Tested Platform | 6 | | ------ | ---- | ----------- | ------ | 7 | | 3.4.8 | 31e19f92f00c7003fa115047ce50978bc98c3a0d | ndk22,ndk25,ndk26,ndk27,ndk28 | macOS/Ubuntu | 8 | | 4.4.4 | 31e19f92f00c7003fa115047ce50978bc98c3a0d | ndk22,ndk25,ndk26,ndk27,ndk28 | macOS/Ubuntu | 9 | | 5.0 | 31e19f92f00c7003fa115047ce50978bc98c3a0d | ndk25,ndk26,ndk27,ndk28 | macOS/Ubuntu | 10 | 11 | > For newer versions of FFmpeg, the configure script parameters have changed and require separate adaptation. 12 | 13 | ## Build Options 14 | 15 | The packaging methods included in this repository aim to minimize the package size while ensuring performance, with asm and NEON enabled. For specific build options, refer to the build scripts in the `build_script` directory. 16 | 17 | ## Build 18 | 19 | ### Prepare 20 | 21 | - Install git 22 | - Install Android NDK (tested with ndk22, ndk25, ndk26, ndk27, ndk28), __do not use `NDK23`!__ 23 | - Tested with all NDK versions on `macOS` and `Ubuntu 20.04+` 24 | - Install yasm, nasm (via `brew install nasm yasm` or `apt install nasm yasm -y`...) 25 | 26 | ### Perform build 27 | 28 | 1. `$ export NDK=/path/to/your/android-ndk` 29 | 2. `$ ./build_android.sh` 30 | - Use `./build_android.sh --ffmpeg 4.4.4 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d` to build the specific version 31 | 3. `$ cd jni && $NDK/ndk-build` 32 | 4. The `libffmpeg.so` is in the folder `libs` 33 | 34 | ### Tested build versions 35 | 36 | ```bash 37 | # Build ffmpeg 3.4.8 38 | ./build_android.sh --ffmpeg 3.4.8 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d 39 | # Build ffmpeg 3.4.8 + 16kb page size 40 | ./build_android.sh --ffmpeg 3.4.8 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb 41 | ``` 42 | 43 | ```bash 44 | # Build ffmpeg 4.4.4 45 | ./build_android.sh --ffmpeg 4.4.4 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d 46 | # Build ffmpeg 4.4.4 + 16kb page size 47 | ./build_android.sh --ffmpeg 4.4.4 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb 48 | ``` 49 | 50 | ```bash 51 | # Build ffmpeg 5.0 52 | ./build_android.sh --ffmpeg 5.0 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d 53 | # Build ffmpeg 5.0 + 16kb page size 54 | ./build_android.sh --ffmpeg 5.0 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb 55 | ``` 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | FFmpeg: 2 | ------- 3 | 4 | Most files in FFmpeg are under the GNU Lesser General Public License version 2.1 5 | or later (LGPL v2.1+). Read the file COPYING.LGPLv2.1 for details. Some other 6 | files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to 7 | FFmpeg. 8 | 9 | Some optional parts of FFmpeg are licensed under the GNU General Public License 10 | version 2 or later (GPL v2+). See the file COPYING.GPLv2 for details. None of 11 | these parts are used by default, you have to explicitly pass --enable-gpl to 12 | configure to activate them. In this case, FFmpeg's license changes to GPL v2+. 13 | 14 | Specifically, the GPL parts of FFmpeg are 15 | 16 | - libpostproc 17 | - optional x86 optimizations in the files 18 | libavcodec/x86/idct_mmx.c 19 | - the X11 grabber in libavdevice/x11grab.c 20 | 21 | There are a handful of files under other licensing terms, namely: 22 | 23 | * The files libavcodec/jfdctfst.c, libavcodec/jfdctint_template.c and 24 | libavcodec/jrevdct.c are taken from libjpeg, see the top of the files for 25 | licensing details. Specifically note that you must credit the IJG in the 26 | documentation accompanying your program if you only distribute executables. 27 | You must also indicate any changes including additions and deletions to 28 | those three files in the documentation. 29 | 30 | Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then 31 | the configure parameter --enable-version3 will activate this licensing option 32 | for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts, 33 | COPYING.GPLv3 to learn the exact legal terms that apply in this case. 34 | 35 | 36 | external libraries: 37 | ------------------- 38 | 39 | Some external libraries, e.g. libx264, are under GPL and can be used in 40 | conjunction with FFmpeg. They require --enable-gpl to be passed to configure 41 | as well. 42 | 43 | The OpenCORE external libraries are under the Apache License 2.0. That license 44 | is incompatible with the LGPL v2.1 and the GPL v2, but not with version 3 of 45 | those licenses. So to combine the OpenCORE libraries with FFmpeg, the license 46 | version needs to be upgraded by passing --enable-version3 to configure. 47 | 48 | The nonfree external libraries libfaac and libaacplus can be hooked up in FFmpeg. 49 | You need to pass --enable-nonfree to configure to enable it. Employ this option 50 | with care as FFmpeg then becomes nonfree and unredistributable. 51 | -------------------------------------------------------------------------------- /.github/workflows/build-android.yml: -------------------------------------------------------------------------------- 1 | name: Build Android FFmpeg 2 | 3 | on: 4 | push: 5 | tags: [ 'v*' ] 6 | pull_request: 7 | branches: [ master ] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v4 17 | with: 18 | submodules: recursive 19 | 20 | - name: Set up JDK 11 21 | uses: actions/setup-java@v4 22 | with: 23 | java-version: '11' 24 | distribution: 'temurin' 25 | 26 | - name: Setup Android NDK 27 | uses: nttld/setup-ndk@v1 28 | with: 29 | ndk-version: r26c 30 | add-to-path: false 31 | 32 | - name: Set NDK environment variable 33 | run: | 34 | echo "NDK=$ANDROID_NDK_ROOT" >> $GITHUB_ENV 35 | echo "Android NDK location: $ANDROID_NDK_ROOT" 36 | 37 | - name: Install build dependencies 38 | run: | 39 | sudo apt-get update 40 | sudo apt-get install -y build-essential git yasm nasm pkg-config 41 | 42 | - name: Make build script executable 43 | run: chmod +x build_android.sh 44 | 45 | - name: Build Android FFmpeg 46 | run: ./build_android.sh && ./build_android.sh --16kb 47 | 48 | - name: Check build outputs 49 | id: check_outputs 50 | run: | 51 | echo "Checking for FFmpeg build outputs..." 52 | ls -la ffmpeg-* || echo "No ffmpeg-* directories found" 53 | 54 | # Find standard build (without -16kb suffix) 55 | STANDARD_BUILD=$(ls -d ffmpeg-* 2>/dev/null | grep -v "\-16kb$" | head -n1 || echo "") 56 | SIXTEENKB_BUILD=$(ls -d ffmpeg-*-16kb 2>/dev/null | head -n1 || echo "") 57 | 58 | echo "standard_build=$STANDARD_BUILD" >> $GITHUB_OUTPUT 59 | echo "sixteenkb_build=$SIXTEENKB_BUILD" >> $GITHUB_OUTPUT 60 | 61 | echo "Standard build: $STANDARD_BUILD" 62 | echo "16KB build: $SIXTEENKB_BUILD" 63 | 64 | - name: Upload FFmpeg standard build 65 | uses: actions/upload-artifact@v4 66 | with: 67 | name: ${{ steps.check_outputs.outputs.standard_build }} 68 | path: ${{ steps.check_outputs.outputs.standard_build }}/ 69 | retention-days: 7 70 | if: steps.check_outputs.outputs.standard_build != '' 71 | 72 | - name: Upload FFmpeg 16KB build 73 | uses: actions/upload-artifact@v4 74 | with: 75 | name: ${{ steps.check_outputs.outputs.sixteenkb_build }} 76 | path: ${{ steps.check_outputs.outputs.sixteenkb_build }}/ 77 | retention-days: 7 78 | if: steps.check_outputs.outputs.sixteenkb_build != '' 79 | 80 | - name: Show build results 81 | run: | 82 | echo "Build completed successfully!" 83 | ls -la ffmpeg-*/ 84 | find libs/ -name "*.so" -exec ls -la {} \; 85 | -------------------------------------------------------------------------------- /jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | BUILD_ROOT_DIR=$(LOCAL_PATH)/../build 4 | FFMPEG_DIR=$(BUILD_ROOT_DIR)/ffmpeg/$(TARGET_ARCH_ABI)/lib 5 | X264_DIR=$(BUILD_ROOT_DIR)/x264/$(TARGET_ARCH_ABI)/lib 6 | 7 | #include $(call all-subdir-makefiles) 8 | 9 | #static version of libavcodec 10 | include $(CLEAR_VARS) 11 | LOCAL_MODULE:= libavcodec_static 12 | LOCAL_SRC_FILES:= $(FFMPEG_DIR)/libavcodec.a 13 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 14 | include $(PREBUILT_STATIC_LIBRARY) 15 | 16 | #static version of libavformat 17 | include $(CLEAR_VARS) 18 | LOCAL_MODULE:= libavformat_static 19 | LOCAL_SRC_FILES:= $(FFMPEG_DIR)/libavformat.a 20 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 21 | include $(PREBUILT_STATIC_LIBRARY) 22 | 23 | #static version of libswscale 24 | include $(CLEAR_VARS) 25 | LOCAL_MODULE:= libswscale_static 26 | LOCAL_SRC_FILES:= $(FFMPEG_DIR)/libswscale.a 27 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 28 | include $(PREBUILT_STATIC_LIBRARY) 29 | 30 | #static version of libavutil 31 | include $(CLEAR_VARS) 32 | LOCAL_MODULE:= libavutil_static 33 | LOCAL_SRC_FILES:= $(FFMPEG_DIR)/libavutil.a 34 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 35 | include $(PREBUILT_STATIC_LIBRARY) 36 | 37 | #static version of libavdevice 38 | #include $(CLEAR_VARS) 39 | #LOCAL_MODULE:= libavdevice_static 40 | #LOCAL_SRC_FILES:= lib/libavdevice.a 41 | #LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 42 | #include $(PREBUILT_STATIC_LIBRARY) 43 | 44 | #static version of libavfilter 45 | #include $(CLEAR_VARS) 46 | #LOCAL_MODULE:= libavfilter_static 47 | #LOCAL_SRC_FILES:= lib/libavfilter.a 48 | #LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 49 | #include $(PREBUILT_STATIC_LIBRARY) 50 | 51 | #static version of libswresample 52 | include $(CLEAR_VARS) 53 | LOCAL_MODULE:= libswresample_static 54 | LOCAL_SRC_FILES:= $(FFMPEG_DIR)/libswresample.a 55 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 56 | include $(PREBUILT_STATIC_LIBRARY) 57 | 58 | #static version of libpostproc 59 | include $(CLEAR_VARS) 60 | LOCAL_MODULE:= libpostproc_static 61 | LOCAL_SRC_FILES:= $(FFMPEG_DIR)/libpostproc.a 62 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 63 | include $(PREBUILT_STATIC_LIBRARY) 64 | 65 | #static version of libx264 66 | include $(CLEAR_VARS) 67 | LOCAL_MODULE:= libx264_static 68 | LOCAL_SRC_FILES:= $(X264_DIR)/libx264.a 69 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 70 | include $(PREBUILT_STATIC_LIBRARY) 71 | 72 | include $(CLEAR_VARS) 73 | 74 | LOCAL_MODULE := ffmpeg 75 | 76 | LOCAL_CFLAGS := -fPIC -O3 77 | LOCAL_LDLIBS := -llog -lz -Wl,-Bsymbolic -fPIC -fPIE 78 | 79 | ifeq ($(ENABLE_16KB_PAGE_SIZE),true) 80 | LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384" 81 | endif 82 | 83 | 84 | ifeq ($(TARGET_ARCH_ABI), x86) 85 | LOCAL_LDLIBS := $(LOCAL_LDLIBS) -z notext 86 | endif 87 | 88 | LOCAL_WHOLE_STATIC_LIBRARIES := libavformat_static \ 89 | libavcodec_static \ 90 | libavutil_static \ 91 | libpostproc_static \ 92 | libswscale_static \ 93 | libswresample_static \ 94 | libx264_static \ 95 | 96 | include $(BUILD_SHARED_LIBRARY) 97 | -------------------------------------------------------------------------------- /COPYING.LGPLv3: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | --------------------------------------------------------------------------------