markus-perl / ffmpeg-build-script

The FFmpeg build script provides an easy way to build a static FFmpeg on OSX and Linux with non-free codecs included.
MIT License
1.05k stars 334 forks source link

Static build of libogg not recognized by configure file of libvorbis #99

Open TommyJerryMairo opened 3 years ago

TommyJerryMairo commented 3 years ago

I've encountered a weird error when./build-ffmpeg --build:

configure: error: Ogg >= 1.0 required !

It seems there might be a dependency or build order issue. Or the configure file of libvorbis doesn't recognized the static build of libogg. Full log comes below:

tjm@Builder_xstvd:ffmpeg-build-script$ ./build-ffmpeg --build
ffmpeg-build-script v1.28
=========================

Using 64 make jobs simultaneously.

building pkg-config
=======================
Downloading https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz as pkg-config-0.29.2.tar.gz
... Done
Extracted pkg-config-0.29.2.tar.gz
$ ./configure --silent --prefix=/home/tjm/ffmpeg-build-script/workspace --with-pc-path=/home/tjm/ffmpeg-build-script/workspace/lib/pkgconfig --with-internal-glib
$ make -j 64
$ make install

building lv2
=======================
Downloading https://lv2plug.in/spec/lv2-1.18.2.tar.bz2 as lv2-1.18.2.tar.bz2
... Done
Extracted lv2-1.18.2.tar.bz2
$ ./waf configure --prefix=/home/tjm/ffmpeg-build-script/workspace --lv2-user
$ ./waf
$ ./waf install

building waflib
=======================
Downloading https://gitlab.com/drobilla/autowaf/-/archive/b600c928b221a001faeab7bd92786d0b25714bc8/autowaf-b600c928b221a001faeab7bd92786d0b25714bc8.tar.gz as autowaf.tar.gz
... Done
Extracted autowaf.tar.gz

building serd
=======================
Downloading https://gitlab.com/drobilla/serd/-/archive/v0.30.10/serd-v0.30.10.tar.gz as serd-v0.30.10.tar.gz
... Done
Extracted serd-v0.30.10.tar.gz
$ cp -r /home/tjm/ffmpeg-build-script/packages/autowaf/ansiterm.py /home/tjm/ffmpeg-build-script/packages/autowaf/Build.py /home/tjm/ffmpeg-build-script/packages/autowaf/ConfigSet.py /home/tjm/ffmpeg-build-script/packages/autowaf/Configure.py /home/tjm/ffmpeg-build-script/packages/autowaf/Context.py /home/tjm/ffmpeg-build-script/packages/autowaf/COPYING /home/tjm/ffmpeg-build-script/packages/autowaf/Errors.py /home/tjm/ffmpeg-build-script/packages/autowaf/extras /home/tjm/ffmpeg-build-script/packages/autowaf/fixpy2.py /home/tjm/ffmpeg-build-script/packages/autowaf/__init__.py /home/tjm/ffmpeg-build-script/packages/autowaf/Logs.py /home/tjm/ffmpeg-build-script/packages/autowaf/Node.py /home/tjm/ffmpeg-build-script/packages/autowaf/Options.py /home/tjm/ffmpeg-build-script/packages/autowaf/processor.py /home/tjm/ffmpeg-build-script/packages/autowaf/README.md /home/tjm/ffmpeg-build-script/packages/autowaf/Runner.py /home/tjm/ffmpeg-build-script/packages/autowaf/Scripting.py /home/tjm/ffmpeg-build-script/packages/autowaf/TaskGen.py /home/tjm/ffmpeg-build-script/packages/autowaf/Task.py /home/tjm/ffmpeg-build-script/packages/autowaf/Tools /home/tjm/ffmpeg-build-script/packages/autowaf/Utils.py /home/tjm/ffmpeg-build-script/packages/autowaf/waf /home/tjm/ffmpeg-build-script/packages/serd-v0.30.10/waflib/
$ ./waf configure --prefix=/home/tjm/ffmpeg-build-script/workspace --static --no-shared --no-posix
$ ./waf
$ ./waf install

building pcre
=======================
Downloading https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz as pcre-8.44.tar.gz
... Done
Extracted pcre-8.44.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --disable-shared --enable-static
$ make -j 64
$ make install

building sord
=======================
Downloading https://gitlab.com/drobilla/sord/-/archive/v0.16.8/sord-v0.16.8.tar.gz as sord-v0.16.8.tar.gz
... Done
Extracted sord-v0.16.8.tar.gz
$ cp -r /home/tjm/ffmpeg-build-script/packages/autowaf/ansiterm.py /home/tjm/ffmpeg-build-script/packages/autowaf/Build.py /home/tjm/ffmpeg-build-script/packages/autowaf/ConfigSet.py /home/tjm/ffmpeg-build-script/packages/autowaf/Configure.py /home/tjm/ffmpeg-build-script/packages/autowaf/Context.py /home/tjm/ffmpeg-build-script/packages/autowaf/COPYING /home/tjm/ffmpeg-build-script/packages/autowaf/Errors.py /home/tjm/ffmpeg-build-script/packages/autowaf/extras /home/tjm/ffmpeg-build-script/packages/autowaf/fixpy2.py /home/tjm/ffmpeg-build-script/packages/autowaf/__init__.py /home/tjm/ffmpeg-build-script/packages/autowaf/Logs.py /home/tjm/ffmpeg-build-script/packages/autowaf/Node.py /home/tjm/ffmpeg-build-script/packages/autowaf/Options.py /home/tjm/ffmpeg-build-script/packages/autowaf/processor.py /home/tjm/ffmpeg-build-script/packages/autowaf/README.md /home/tjm/ffmpeg-build-script/packages/autowaf/Runner.py /home/tjm/ffmpeg-build-script/packages/autowaf/Scripting.py /home/tjm/ffmpeg-build-script/packages/autowaf/TaskGen.py /home/tjm/ffmpeg-build-script/packages/autowaf/Task.py /home/tjm/ffmpeg-build-script/packages/autowaf/Tools /home/tjm/ffmpeg-build-script/packages/autowaf/Utils.py /home/tjm/ffmpeg-build-script/packages/autowaf/waf /home/tjm/ffmpeg-build-script/packages/sord-v0.16.8/waflib/
$ ./waf configure --prefix=/home/tjm/ffmpeg-build-script/workspace CFLAGS=-I/home/tjm/ffmpeg-build-script/workspace/include --static --no-shared --no-utils
$ ./waf CFLAGS=-I/home/tjm/ffmpeg-build-script/workspace/include
$ ./waf install

building sratom
=======================
Downloading https://gitlab.com/lv2/sratom/-/archive/v0.6.8/sratom-v0.6.8.tar.gz as sratom-v0.6.8.tar.gz
... Done
Extracted sratom-v0.6.8.tar.gz
$ cp -r /home/tjm/ffmpeg-build-script/packages/autowaf/ansiterm.py /home/tjm/ffmpeg-build-script/packages/autowaf/Build.py /home/tjm/ffmpeg-build-script/packages/autowaf/ConfigSet.py /home/tjm/ffmpeg-build-script/packages/autowaf/Configure.py /home/tjm/ffmpeg-build-script/packages/autowaf/Context.py /home/tjm/ffmpeg-build-script/packages/autowaf/COPYING /home/tjm/ffmpeg-build-script/packages/autowaf/Errors.py /home/tjm/ffmpeg-build-script/packages/autowaf/extras /home/tjm/ffmpeg-build-script/packages/autowaf/fixpy2.py /home/tjm/ffmpeg-build-script/packages/autowaf/__init__.py /home/tjm/ffmpeg-build-script/packages/autowaf/Logs.py /home/tjm/ffmpeg-build-script/packages/autowaf/Node.py /home/tjm/ffmpeg-build-script/packages/autowaf/Options.py /home/tjm/ffmpeg-build-script/packages/autowaf/processor.py /home/tjm/ffmpeg-build-script/packages/autowaf/README.md /home/tjm/ffmpeg-build-script/packages/autowaf/Runner.py /home/tjm/ffmpeg-build-script/packages/autowaf/Scripting.py /home/tjm/ffmpeg-build-script/packages/autowaf/TaskGen.py /home/tjm/ffmpeg-build-script/packages/autowaf/Task.py /home/tjm/ffmpeg-build-script/packages/autowaf/Tools /home/tjm/ffmpeg-build-script/packages/autowaf/Utils.py /home/tjm/ffmpeg-build-script/packages/autowaf/waf /home/tjm/ffmpeg-build-script/packages/sratom-v0.6.8/waflib/
$ ./waf configure --prefix=/home/tjm/ffmpeg-build-script/workspace --static --no-shared
$ ./waf
$ ./waf install

building lilv
=======================
Downloading https://gitlab.com/lv2/lilv/-/archive/v0.24.12/lilv-v0.24.12.tar.gz as lilv-v0.24.12.tar.gz
... Done
Extracted lilv-v0.24.12.tar.gz
$ cp -r /home/tjm/ffmpeg-build-script/packages/autowaf/ansiterm.py /home/tjm/ffmpeg-build-script/packages/autowaf/Build.py /home/tjm/ffmpeg-build-script/packages/autowaf/ConfigSet.py /home/tjm/ffmpeg-build-script/packages/autowaf/Configure.py /home/tjm/ffmpeg-build-script/packages/autowaf/Context.py /home/tjm/ffmpeg-build-script/packages/autowaf/COPYING /home/tjm/ffmpeg-build-script/packages/autowaf/Errors.py /home/tjm/ffmpeg-build-script/packages/autowaf/extras /home/tjm/ffmpeg-build-script/packages/autowaf/fixpy2.py /home/tjm/ffmpeg-build-script/packages/autowaf/__init__.py /home/tjm/ffmpeg-build-script/packages/autowaf/Logs.py /home/tjm/ffmpeg-build-script/packages/autowaf/Node.py /home/tjm/ffmpeg-build-script/packages/autowaf/Options.py /home/tjm/ffmpeg-build-script/packages/autowaf/processor.py /home/tjm/ffmpeg-build-script/packages/autowaf/README.md /home/tjm/ffmpeg-build-script/packages/autowaf/Runner.py /home/tjm/ffmpeg-build-script/packages/autowaf/Scripting.py /home/tjm/ffmpeg-build-script/packages/autowaf/TaskGen.py /home/tjm/ffmpeg-build-script/packages/autowaf/Task.py /home/tjm/ffmpeg-build-script/packages/autowaf/Tools /home/tjm/ffmpeg-build-script/packages/autowaf/Utils.py /home/tjm/ffmpeg-build-script/packages/autowaf/waf /home/tjm/ffmpeg-build-script/packages/lilv-v0.24.12/waflib/
$ ./waf configure --prefix=/home/tjm/ffmpeg-build-script/workspace --static --no-shared --no-utils
$ ./waf
$ ./waf install

building yasm
=======================
Downloading https://github.com/yasm/yasm/releases/download/v1.3.0/yasm-1.3.0.tar.gz as yasm-1.3.0.tar.gz
... Done
Extracted yasm-1.3.0.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace
$ make -j 64
$ make install

building nasm
=======================
Downloading https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.xz as nasm-2.15.05.tar.xz
... Done
Extracted nasm-2.15.05.tar.xz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --disable-shared --enable-static
$ make -j 64
$ make install

building zlib
=======================
Downloading https://www.zlib.net/zlib-1.2.11.tar.gz as zlib-1.2.11.tar.gz
... Done
Extracted zlib-1.2.11.tar.gz
$ ./configure --static --prefix=/home/tjm/ffmpeg-build-script/workspace
$ make -j 64
$ make install

building cmake
=======================
Downloading https://cmake.org/files/LatestRelease/cmake-3.21.0.tar.gz as cmake-3.21.0.tar.gz
... Done
Extracted cmake-3.21.0.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --parallel=64 -- -DCMAKE_USE_OPENSSL=OFF
$ make -j 64
$ make install

building svtav1
=======================
Downloading https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/master/SVT-AV1-master.tar.gz as SVT-AV1-master.tar.gz
... Done
Extracted SVT-AV1-master.tar.gz
$ cmake -DCMAKE_INSTALL_PREFIX=/home/tjm/ffmpeg-build-script/workspace -DENABLE_SHARED=off -DBUILD_SHARED_LIBS=OFF ../.. -GUnix Makefiles -DCMAKE_BUILD_TYPE=Release
$ make -j 64
$ make install
$ cp SvtAv1Enc.pc /home/tjm/ffmpeg-build-script/workspace/lib/pkgconfig/
$ cp SvtAv1Dec.pc /home/tjm/ffmpeg-build-script/workspace/lib/pkgconfig/

building libvpx
=======================
Downloading https://github.com/webmproject/libvpx/archive/refs/tags/v1.10.0.tar.gz as libvpx-1.10.0.tar.gz
... Done
Extracted libvpx-1.10.0.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --disable-unit-tests --disable-shared --as=yasm --enable-vp9-highbitdepth
$ make -j 64
$ make install

building av1
=======================
Downloading https://aomedia.googlesource.com/aom/+archive/c0f14141bd71414b004dccd66d48b27570299fa3.tar.gz as av1.tar.gz
... Done
Extracted av1.tar.gz
$ cmake -DENABLE_TESTS=0 -DCMAKE_INSTALL_PREFIX=/home/tjm/ffmpeg-build-script/workspace -DCMAKE_INSTALL_LIBDIR=lib /home/tjm/ffmpeg-build-script/packages/av1
$ make -j 64
$ make install

building opencore
=======================
Downloading https://deac-riga.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz as opencore-amr-0.1.5.tar.gz
... Done
Extracted opencore-amr-0.1.5.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --disable-shared --enable-static
$ make -j 64
$ make install

building lame
=======================
Downloading https://netcologne.dl.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz as lame-3.100.tar.gz
... Done
Extracted lame-3.100.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --disable-shared --enable-static
$ make -j 64
$ make install

building opus
=======================
Downloading https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz as opus-1.3.1.tar.gz
... Done
Extracted opus-1.3.1.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --disable-shared --enable-static
$ make -j 64
$ make install

building libogg
=======================
Downloading https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.3.tar.gz as libogg-1.3.3.tar.gz
... Done
Extracted libogg-1.3.3.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --disable-shared --enable-static
$ make -j 64
$ make install

building libvorbis
=======================
Downloading https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.6.tar.gz as libvorbis-1.3.6.tar.gz
... Done
Extracted libvorbis-1.3.6.tar.gz
$ ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --with-ogg-libraries=/home/tjm/ffmpeg-build-script/workspace/lib --with-ogg-includes=/home/tjm/ffmpeg-build-script/workspace/include/ --enable-static --disable-shared --disable-oggtest
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for inline... inline
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/x86_64-suse-linux/bin/ld
checking if the linker (/usr/x86_64-suse-linux/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-suse-linux/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-suse-linux/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking GCC version... 7
checking if gcc accepts -Wdeclaration-after-statement... yes
checking for memory.h... (cached) yes
checking for cos in -lm... yes
checking for pthread_create in -lpthread... yes
checking for pkg-config... /home/tjm/ffmpeg-build-script/workspace/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for OGG... no
checking for Ogg... yes
checking for oggpack_writealign... no
configure: error: Ogg >= 1.0 required !

Failed to Execute ./configure --prefix=/home/tjm/ffmpeg-build-script/workspace --with-ogg-libraries=/home/tjm/ffmpeg-build-script/workspace/lib --with-ogg-includes=/home/tjm/ffmpeg-build-script/workspace/include/ --enable-static --disable-shared --disable-oggtest
TommyJerryMairo commented 3 years ago

The builder environment is openSUSE Leap 15.2:

NAME="openSUSE Leap"
VERSION="15.2"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.2"
PRETTY_NAME="openSUSE Leap 15.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/
TommyJerryMairo commented 3 years ago

The builder runs on Intel Xeon E5-2698 v3:

processor   : 63
vendor_id   : GenuineIntel
cpu family  : 6
model       : 63
model name  : Intel(R) Xeon(R) CPU E5-2698 v3 @ 2.30GHz
stepping    : 2
microcode   : 0x46
cpu MHz     : 1200.852
cache size  : 40960 KB
physical id : 1
siblings    : 32
core id     : 15
cpu cores   : 16
apicid      : 63
initial apicid  : 63
fpu     : yes
fpu_exception   : yes
cpuid level : 15
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips    : 4596.22
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
TommyJerryMairo commented 3 years ago

Both libogg.a and libogg.la are in place:

tjm@Builder_xstvd:ffmpeg-build-script$ ls workspace/lib64/libogg.*
workspace/lib64/libogg.a  workspace/lib64/libogg.la*
TommyJerryMairo commented 3 years ago

This issue is caused by using workspace/lib in configure command line options, where the actual install path is workspace/lib64. I suggest the script creates a soft link of workspace/lib with name workspace/lib64