70
67
nooptflags += --disable-vis
70
# build a static version on every architecture in the 'debian' Libav package
73
# shared is generic, i.e. without arch specific opcodes
74
# /!\ order matters, you want to list the shared flavor *last* so that the
75
# binaries from this flavor overwrite the ones from the optional optimized
76
# flavor(s) and from the static flavor
73
79
$(info Building FLAVORS=$(FLAVORS))
81
# Conditionally enable certain features depending on
82
# the corresponding header file being installed or not
76
84
$(shell test -r $(1) && echo --enable-$(2) )
79
# variant that also require --enable-version3
87
# variant that also requires --enable-version3
80
88
define cond_enable_v3
81
89
$(shell test -r $(1) && echo --enable-$(2) --enable-version3 )
84
# variant that also require --enable-nonfree
92
# variant that also requires --enable-nonfree
85
93
define cond_enable_nf
86
94
$(shell test -r $(1) && echo --enable-$(2) --enable-nonfree )
89
# Configuration flags causing the libs to be GPL tainted
90
gpl_confflags += --enable-gpl
91
gpl_confflags += --enable-postproc
92
gpl_confflags += --enable-swscale
93
gpl_confflags += --enable-x11grab
95
97
# Common configuration flags
96
confflags += --extra-version='$(DEB_VERSION)'
97
98
confflags += --arch='$(DEB_HOST_ARCH_CPU)'
98
confflags += --prefix=/usr
99
confflags += --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
100
confflags += --enable-vdpau
101
confflags += --enable-bzlib
102
confflags += --enable-gnutls
103
confflags += --enable-libcdio
104
confflags += --enable-libgsm
105
confflags += --enable-libschroedinger
106
confflags += --enable-libspeex
107
confflags += --enable-libtheora
108
confflags += --enable-libvorbis
109
99
confflags += --enable-pthreads
110
confflags += --enable-zlib
111
confflags += --enable-libvpx
112
100
confflags += --enable-runtime-cpudetect
113
confflags += --enable-libfreetype
101
confflags += --extra-version='$(DEB_VERSION)'
102
confflags += --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
103
confflags += --prefix=/usr
104
confflags += $(shell test -x /usr/bin/yasm || echo --disable-yasm )
114
106
ifeq ($(DEB_HOST_ARCH),armel)
115
107
# this is required on Ubuntu lucid as it defaults to thumb2 and Libav has
116
108
# plenty of incompatible assembly; not sure how to detect that properly
121
113
confflags += --enable-pic
124
confflags += $(extra_common_confflags)
126
# vaapi is not available on s390 and on the hurd
116
# Additional features
117
confflags += $(call cond_enable,/usr/include/bzlib.h,bzlib)
118
confflags += $(call cond_enable,/usr/include/dc1394/dc1394.h,libdc1394)
119
confflags += $(call cond_enable,/usr/include/dirac/libdirac_decoder/dirac_parser.h,libdirac)
120
confflags += $(call cond_enable,/usr/include/freetype2/freetype/freetype.h,libfreetype)
121
confflags += $(call cond_enable,/usr/include/frei0r.h,frei0r)
122
confflags += $(call cond_enable,/usr/include/gnutls/gnutls.h,gnutls)
123
confflags += $(call cond_enable,/usr/include/gsm/gsm.h,libgsm)
124
confflags += $(call cond_enable,/usr/include/lame/lame.h,libmp3lame)
125
confflags += $(call cond_enable,/usr/include/librtmp/http.h,librtmp)
126
confflags += $(call cond_enable,/usr/include/opencv/cv.hpp,libopencv)
127
confflags += $(call cond_enable,/usr/include/openjpeg.h,libopenjpeg)
128
confflags += $(call cond_enable,/usr/include/pulse/simple.h,libpulse)
129
confflags += $(call cond_enable,/usr/include/schroedinger-1.0/schroedinger/schro.h,libschroedinger)
130
confflags += $(call cond_enable,/usr/include/speex/speex.h,libspeex)
131
confflags += $(call cond_enable,/usr/include/theora/theoraenc.h,libtheora)
127
132
confflags += $(call cond_enable,/usr/include/va/va.h,vaapi)
129
# pulse is not available on the hurd
130
confflags += $(call cond_enable,/usr/include/pulse/simple.h,libpulse)
132
# this part below is intended for the 'Libav' package in ubuntu/multiverse
133
gpl_confflags += $(call cond_enable,/usr/include/dirac/libdirac_decoder/dirac_parser.h,libdirac)
134
gpl_confflags += $(call cond_enable,/usr/include/lame/lame.h,libmp3lame)
135
gpl_confflags += $(call cond_enable,/usr/include/librtmp/http.h,librtmp)
133
confflags += $(call cond_enable,/usr/include/vdpau/vdpau.h,vdpau)
134
confflags += $(call cond_enable,/usr/include/vorbis/vorbisenc.h,libvorbis)
135
confflags += $(call cond_enable,/usr/include/vpx/vpx_encoder.h,libvpx)
136
confflags += $(call cond_enable,/usr/include/zlib.h,zlib)
138
# Configuration flags causing the libs to be GPL tainted
139
gpl_confflags += --enable-gpl
140
gpl_confflags += --enable-postproc
141
gpl_confflags += --enable-swscale
142
gpl_confflags += $(call cond_enable,/usr/include/cdio/paranoia.h,libcdio)
143
gpl_confflags += $(call cond_enable,/usr/include/X11/extensions/XShm.h,x11grab)
136
144
gpl_confflags += $(call cond_enable,/usr/include/x264.h,libx264)
137
145
gpl_confflags += $(call cond_enable,/usr/include/xvid.h,libxvid)
138
gpl_confflags += $(call cond_enable,/usr/include/frei0r.h,frei0r)
139
gpl_confflags += $(call cond_enable,/usr/include/opencv/cv.h,libopencv)
141
confflags += $(call cond_enable,/usr/include/openjpeg.h,libopenjpeg)
143
# Features that require GPL v3
146
# comment out following line for LGPL versions of the libraries
147
confflags += $(gpl_confflags)
149
# Features that require (L)GPL v3
144
150
v3_confflags += $(call cond_enable_v3,/usr/include/opencore-amrnb/interf_dec.h,libopencore-amrnb)
145
151
v3_confflags += $(call cond_enable_v3,/usr/include/opencore-amrwb/dec_if.h,libopencore-amrwb)
146
152
v3_confflags += $(call cond_enable_v3,/usr/include/vo-aacenc/voAAC.h,libvo-aacenc)
147
153
v3_confflags += $(call cond_enable_v3,/usr/include/vo-amrwbenc/enc_if.h,libvo-amrwbenc)
149
# FAAC is considered non-free upstream
155
# FAAC is considered non-free
150
156
confflags += $(call cond_enable_nf,/usr/include/faac.h,libfaac)
152
# comment out following line for LGPL versions of the libraries
153
confflags += $(gpl_confflags)
154
confflags += $(v3_confflags)
156
# Enable IEEE 1394 (FireWire) support on Linux only
157
ifneq (,$(findstring linux,$(DEB_HOST_GNU_TYPE)))
158
confflags += --enable-libdc1394
159
lib1394-dev += libraw1394-dev, libdc1394-22-dev
162
158
# Enable hardened build flags through dpkg-buildflags
163
159
CFLAGS := $(filter-out -g -O2,$(shell dpkg-buildflags --get CFLAGS))
164
160
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)