22
22
# Ubuntu ld adds -Bsymbolic-functions by default, but that prevents FFmpeg from building.
23
23
export DEB_LDFLAGS_MAINT_STRIP=-Wl,-Bsymbolic-functions
25
# Enable as many features as possible, as long as the result is still GPLv2+ (and not only GPLv3+).
26
# Therefore the following flags (and build-dependencies) are not added:
27
# --enable-libopencore_amrnb (libopencore-amrnb-dev)
28
# --enable-libopencore_amrwb (libopencore-amrwb-dev)
29
# --enable-libvo_aacenc (libvo-aacenc-dev)
30
# --enable-libvo_amrwbenc (libvo-amrwbenc-dev)
31
# --enable-libsmbclient (libsmbclient-dev)
25
# Package name for the extra flavor.
26
EXTRA_PKG := $(shell sed -nr 's/^Package:[[:space:]]*(.*extra[0-9]+)[[:space:]]*$$/\1/p' debian/control)
29
# Enable as many features as possible, as long as the result is still GPLv2+ (a GPLv3+ variant is built as libavcodec-extra flavor).
30
# The following flags (and build-dependencies) are not added, because they would require a libavformat-extra flavor:
31
# --enable-libsmbclient (libsmbclient-dev [!hurd-i386 !m68k !sparc64])
32
32
# The following flags are not added, because the necessary libraries are not in Debian:
33
33
# --enable-decklink
34
34
# --enable-libcelt (see #676592: removed from Debian as abandoned upstream, replaced by opus)
102
# With these enabled, resulting binaries are effectively licensed as GPLv3+.
103
CONFIG_extra = --enable-version3 \
109
--disable-avresample \
112
--enable-libopencore_amrnb \
113
--enable-libopencore_amrwb \
114
--enable-libvo_aacenc \
115
--enable-libvo_amrwbenc
101
117
# Disable optimizations if requested.
102
118
ifneq (,$(filter $(DEB_BUILD_OPTIONS),noopt))
103
119
CONFIG += --disable-optimizations
114
130
CONFIG += --enable-libzmq
117
# Some libraries are not available on x32.
118
ifneq ($(DEB_HOST_ARCH),x32)
119
CONFIG += --enable-frei0r \
133
# libssh is not available on sparc due to #790067.
134
ifneq ($(DEB_HOST_ARCH),sparc)
135
CONFIG += --enable-libssh
123
# Some libraries are not available on sparc64.
138
# Some libraries are not available/unusable (#792921) on sparc64.
124
139
ifneq ($(DEB_HOST_ARCH),sparc64)
125
140
CONFIG += --enable-libsoxr \
128
# added temporarily to debug SIGBUS errors in the fate tests on sparc64
129
CONFIG += --target-exec="gdb --batch -ex r -ex 'bt full' -ex q --args"
132
144
# OpenCV is not available on some architectures.
133
ifeq (,$(filter $(DEB_HOST_ARCH),alpha sh4 sparc64 x32))
145
ifeq (,$(filter $(DEB_HOST_ARCH),alpha sh4 sparc64))
134
146
CONFIG += --enable-libopencv
137
# X265 is not (yet) available on some architectures.
138
ifeq (,$(filter $(DEB_HOST_ARCH),sparc64 x32))
149
# Recent x265 is not available on alpha due to #789807.
150
ifeq (,$(filter $(DEB_HOST_ARCH),alpha))
139
151
CONFIG += --enable-libx265
150
162
# Build an altivec flavor of the libraries on powerpc.
151
163
# This works around the problem that runtime cpu detection on powerpc currently does not work,
152
164
# because, if altivec is enabled, all files are build with '-maltivec' so that the compiler inserts altivec instructions, wherever it likes.
153
CONFIG_altivec = --enable-altivec --disable-doc
165
CONFIG_altivec = --enable-altivec \
168
CONFIG_altivec-extra = $(CONFIG_altivec) $(CONFIG_extra)
169
FLAVORS += altivec altivec-extra
157
172
# Disable assembly optimizations on x32, because they don't work (yet).
210
225
echo " *** standard ***"
211
226
make tools/qt-faststart
212
227
dh_auto_build -a || (cat config.log && exit 1)
228
# Copy built object files to avoid building them again for the extra flavor.
213
229
for flavor in $(FLAVORS); do \
214
230
echo " *** $$flavor ***"; \
231
if echo "$$flavor" | grep -q "extra"; then \
232
subdir=`echo "$$flavor" | grep "-" | sed 's_\(.*\)-.*_debian/\1/_'`; \
233
for dir in `cd ./$$subdir; find libavcodec libavutil libswresample -type d`; do \
234
mkdir -p debian/"$$flavor"/"$$dir"; \
235
echo "$$subdir$$dir"/*.o | grep -q '*' || cp "$$subdir$$dir"/*.o debian/"$$flavor"/"$$dir"; \
237
rm debian/"$$flavor"/libavcodec/allcodecs.o; \
215
239
dh_auto_build -a --sourcedirectory=debian/"$$flavor" || (cat debian/"$$flavor"/config.log && exit 1); \
218
# Set the library path for the dynamic linker, because the test otherwise don't find the libraries.
242
# Set the library path for the dynamic linker, because the tests otherwise don't find the libraries.
219
243
override_dh_auto_test:
220
244
export LD_LIBRARY_PATH="libavcodec:libavdevice:libavfilter:libavformat:libavresample:libavutil:libpostproc:libswresample:libswscale"; dh_auto_test -- -k
222
246
override_dh_auto_install:
224
248
ifeq ($(DEB_HOST_ARCH),powerpc)
225
install -d debian/tmp/usr/lib/powerpc-linux-gnu/altivec
226
install -m 644 debian/altivec/*/*.so.* debian/tmp/usr/lib/powerpc-linux-gnu/altivec
249
install -d debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/altivec
250
install -m 644 debian/altivec/*/*.so.* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/altivec
252
dh_auto_install --sourcedirectory=debian/extra --destdir=debian/tmp/extra
253
ifeq ($(DEB_HOST_ARCH),powerpc)
254
install -d debian/tmp/extra/usr/lib/$(DEB_HOST_MULTIARCH)/altivec
255
install -m 644 debian/altivec/*/*.so.* debian/tmp/extra/usr/lib/$(DEB_HOST_MULTIARCH)/altivec
228
257
# Create symbolic links from the standard library lib*.so symlinks, pkg-config files and static libraries to the suffixed ones.
229
258
for lib in `find debian/ -name lib*-ffmpeg.so; find debian/ -name lib*.pc; find debian/ -name lib*.a`; do \