~ubuntu-branches/ubuntu/raring/libav-extra/raring-proposed

« back to all changes in this revision

Viewing changes to debian/confflags

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-08-10 19:53:56 UTC
  • Revision ID: package-import@ubuntu.com-20120810195356-a1uekkc1qcfhc9u3
Tags: 6:0.8.3.6ubuntu1
* Merge from 'libav' package in main.
  - build against dirac, libopenjpeg, x264, mp3lame, librtmp and xvidcore,
    opencv, opencore (for AMR wb&nb and vo-aacenc)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- mode: makefile -*-
2
2
# vim:syntax=make
3
3
 
4
 
# build a static version on every architecture in the 'debian' Libav package
5
 
FLAVORS := static
6
 
 
7
 
# shared is generic, i.e. without arch specific opcodes
8
 
FLAVORS += shared
9
 
 
10
4
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
11
5
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12
6
export DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
20
14
    CROSS :=  $(DEB_HOST_GNU_TYPE)-
21
15
endif
22
16
 
 
17
# list of flavors we want to build
 
18
FLAVORS :=
 
19
 
23
20
# this outputs 0 or 1 depending on whether a macro appears in the *default* cpp
24
21
# -dM -P output; this is used to test the toolchain *default* configuration
25
22
check_cpp = $(shell $(CROSS)cpp -dM -P /dev/null | grep -q '^\#define $(1)' && echo 1 || echo 0)
70
67
    nooptflags += --disable-vis
71
68
endif
72
69
 
 
70
# build a static version on every architecture in the 'debian' Libav package
 
71
FLAVORS += static
 
72
 
 
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
 
77
FLAVORS += shared
 
78
 
73
79
$(info Building FLAVORS=$(FLAVORS))
74
80
 
 
81
# Conditionally enable certain features depending on
 
82
# the corresponding header file being installed or not
75
83
define cond_enable
76
84
        $(shell test -r $(1) && echo --enable-$(2) )
77
85
endef
78
86
 
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 )
82
90
endef
83
91
 
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 )
87
95
endef
88
96
 
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
94
 
 
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 )
 
105
 
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
122
114
endif
123
115
 
124
 
confflags += $(extra_common_confflags)
125
 
 
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)
128
 
 
129
 
# pulse is not available on the hurd
130
 
confflags += $(call cond_enable,/usr/include/pulse/simple.h,libpulse)
131
 
 
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)
 
137
 
 
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)
140
 
 
141
 
confflags += $(call cond_enable,/usr/include/openjpeg.h,libopenjpeg)
142
 
 
143
 
# Features that require GPL v3
 
146
# comment out following line for LGPL versions of the libraries
 
147
confflags += $(gpl_confflags)
 
148
 
 
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)
148
154
 
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)
151
157
 
152
 
# comment out following line for LGPL versions of the libraries
153
 
confflags += $(gpl_confflags)
154
 
confflags += $(v3_confflags)
155
 
 
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
160
 
endif
161
 
 
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)