OSDN Git Service

Merge from avformat branch
[handbrake-jp/handbrake-jp-git.git] / contrib / Jamfile
1 SubDir TOP contrib ;
2
3 # Use curl on Mac OS X since it's always installed, and assume wget
4 # is installed for all other systems
5 if $(OS) = MACOSX
6 {
7     WGET = curl -o ;
8 }
9 else
10 {
11     WGET = wget -O ;
12 }
13
14 # Wget rule: downloads $(<) from the link in $(>)
15 rule Wget
16 {
17     Depends $(<) : $(>) ;
18 }
19 actions Wget
20 {
21     $(RM) $(<) &&
22     $(WGET) $(<) `cat $(>)` &&
23     ( touch $(<) || true )
24 }
25
26 # liba52
27 rule LibA52
28 {
29     Depends $(<) : $(>) ;
30     Depends lib  : $(<) ;
31 }
32 actions LibA52
33 {
34     cd `dirname $(>)` && CONTRIB=`pwd` &&
35     rm -rf a52dec && tar xzf a52dec.tar.gz && cd a52dec &&
36     ./configure --prefix=$CONTRIB && make && make install &&
37     strip -S $CONTRIB/lib/liba52.a
38 }
39 Wget   $(SUBDIR)/a52dec.tar.gz : $(SUBDIR)/version_a52dec.txt ;
40 LibA52 $(SUBDIR)/lib/liba52.a  : $(SUBDIR)/a52dec.tar.gz ;
41
42 # libavcodec
43 rule LibAvCodec
44 {
45     FFMPEG_PATCH = "patch -p1 < ../patch-ffmpeg.patch" ;
46     if $(OS) = MACOSX && $(OSPLAT) = X86
47     {
48        FFMPEG_OPTIONS  = --enable-memalign-hack ;
49        FFMPEG_PATCH   += " && patch -p1 < ../patch-ffmpeg-macintel.patch" ;
50     }
51     Depends $(<) : $(>) ;
52     Depends lib  : $(<) ;
53 }
54 actions LibAvCodec
55 {
56     cd `dirname $(>)` && CONTRIB=`pwd` &&
57     rm -rf ffmpeg-20060326 && tar xzf ffmpeg.tar.gz &&
58     cd ffmpeg-20060326 && $(FFMPEG_PATCH) &&
59     ./configure --prefix=$CONTRIB $(FFMPEG_OPTIONS) --enable-gpl --disable-audio-beos &&
60     make lib && make install-libs install-headers &&
61     strip -S $CONTRIB/lib/libavcodec.a
62 }
63 Wget       $(SUBDIR)/ffmpeg.tar.gz    : $(SUBDIR)/version_ffmpeg.txt ;
64 LibAvCodec $(SUBDIR)/lib/libavcodec.a : $(SUBDIR)/ffmpeg.tar.gz ;
65
66 rule LibAvUtil
67 {
68     Depends $(<) : $(>) ;
69     Depends lib  : $(<) ;
70 }
71 actions LibAvUtil
72 {
73     strip -S $(<)
74 }
75 LibAvUtil $(SUBDIR)/lib/libavutil.a : $(SUBDIR)/lib/libavcodec.a ;
76
77 rule LibAvFormat
78 {
79     Depends $(<) : $(>) ;
80     Depends lib  : $(<) ;
81 }
82 actions LibAvFormat
83 {
84     strip -S $(<)
85 }
86 LibAvUtil $(SUBDIR)/lib/libavformat.a : $(SUBDIR)/lib/libavcodec.a ;
87
88 # libdvdcss
89 # We need libdvdcss.so for libdvdread's configure to work...
90 rule LibDvdCss
91 {
92     Depends $(<) : $(>) ;
93     Depends lib  : $(<) ;
94 }
95 actions LibDvdCss
96 {
97     cd `dirname $(>)` && CONTRIB=`pwd` &&
98     rm -rf libdvdcss && tar xzf libdvdcss.tar.gz && cd libdvdcss &&
99     ./configure --prefix=$CONTRIB && make && make install &&
100     strip -S $CONTRIB/lib/libdvdcss.a
101 }
102 Wget      $(SUBDIR)/libdvdcss.tar.gz : $(SUBDIR)/version_libdvdcss.txt ;
103 LibDvdCss $(SUBDIR)/lib/libdvdcss.a  : $(SUBDIR)/libdvdcss.tar.gz ;
104
105 # libdvdread
106 rule LibDvdRead
107 {
108     Depends $(<) : $(>) ;
109     Depends lib  : $(<) ;
110 }
111 actions LibDvdRead
112 {
113     cd `dirname $(>)` && CONTRIB=`pwd` &&
114     rm -rf libdvdread && tar xzf libdvdread.tar.gz && cd libdvdread &&
115     ./configure --prefix=$CONTRIB --disable-shared --with-libdvdcss=$CONTRIB &&
116     make && make install &&
117     strip -S $CONTRIB/lib/libdvdread.a
118 }
119 Wget       $(SUBDIR)/libdvdread.tar.gz : $(SUBDIR)/version_libdvdread.txt ;
120 LibDvdRead $(SUBDIR)/lib/libdvdread.a  : $(SUBDIR)/libdvdread.tar.gz ;
121
122 # libfaac
123 rule LibFaac
124 {
125     Depends $(<) : $(>) ;
126     Depends lib  : $(<) ;
127 }
128 actions LibFaac
129 {
130     cd `dirname $(>)` && CONTRIB=`pwd` &&
131     rm -rf faac && tar xzf faac.tar.gz && cd faac &&
132     ./configure --prefix=$CONTRIB --disable-shared &&
133     make && make install &&
134     strip -S $CONTRIB/lib/libfaac.a
135 }
136 Wget    $(SUBDIR)/faac.tar.gz   : $(SUBDIR)/version_faac.txt ;
137 LibFaac $(SUBDIR)/lib/libfaac.a : $(SUBDIR)/faac.tar.gz ;
138
139 # libmp3lame
140 rule LibMp3Lame
141 {
142     Depends $(<) : $(>) ;
143     Depends lib  : $(<) ;
144 }
145 actions LibMp3Lame
146 {
147     cd `dirname $(>)` && CONTRIB=`pwd` &&
148     rm -rf lame && tar xzf lame.tar.gz && cd lame &&
149     ./configure --prefix=$CONTRIB --disable-shared &&
150     make && make install &&
151     strip -S $CONTRIB/lib/libmp3lame.a
152 }
153 Wget       $(SUBDIR)/lame.tar.gz      : $(SUBDIR)/version_lame.txt ;
154 LibMp3Lame $(SUBDIR)/lib/libmp3lame.a : $(SUBDIR)/lame.tar.gz ;
155
156 # libmpeg2
157 rule LibMpeg2
158 {
159     Depends $(<) : $(>) ;
160     Depends lib  : $(<) ;
161 }
162 actions LibMpeg2
163 {
164     cd `dirname $(>)` && CONTRIB=`pwd` &&
165     rm -rf mpeg2dec && tar xzf mpeg2dec.tar.gz && cd mpeg2dec &&
166     ./configure --prefix=$CONTRIB --disable-shared &&
167     make && make install &&
168     strip -S $CONTRIB/lib/libmpeg2.a
169 }
170 Wget     $(SUBDIR)/mpeg2dec.tar.gz : $(SUBDIR)/version_mpeg2dec.txt ;
171 LibMpeg2 $(SUBDIR)/lib/libmpeg2.a  : $(SUBDIR)/mpeg2dec.tar.gz ;
172
173 # libogg
174 rule LibOgg
175 {
176     Depends $(<) : $(>) ;
177     Depends lib  : $(<) ;
178 }
179 actions LibOgg
180 {
181     cd `dirname $(>)` && CONTRIB=`pwd` &&
182     rm -rf libogg && tar xzf libogg.tar.gz && cd libogg &&
183     ./configure --prefix=$CONTRIB --disable-shared &&
184     make && make install &&
185     strip -S $CONTRIB/lib/libogg.a
186 }
187 Wget   $(SUBDIR)/libogg.tar.gz : $(SUBDIR)/version_libogg.txt ;
188 LibOgg $(SUBDIR)/lib/libogg.a  : $(SUBDIR)/libogg.tar.gz ;
189
190 # libsamplerate
191 rule LibSampleRate
192 {
193     Depends $(<) : $(>) ;
194     Depends lib  : $(<) ;
195 }
196 actions LibSampleRate
197 {
198     cd `dirname $(>)` && CONTRIB=`pwd` &&
199     rm -rf libsamplerate && tar xzf libsamplerate.tar.gz && cd libsamplerate &&
200     ./configure --prefix=$CONTRIB --disable-shared &&
201     make && make install &&
202     strip -S $CONTRIB/lib/libsamplerate.a
203 }
204 Wget          $(SUBDIR)/libsamplerate.tar.gz : $(SUBDIR)/version_libsamplerate.txt ;
205 LibSampleRate $(SUBDIR)/lib/libsamplerate.a  : $(SUBDIR)/libsamplerate.tar.gz ;
206
207 # libvorbis
208 rule LibVorbis
209 {
210     Depends $(<) : $(>) ;
211     Depends lib  : $(<) ;
212 }
213 actions LibVorbis
214 {
215     cd `dirname $(>)` && CONTRIB=`pwd` &&
216     rm -rf libvorbis && tar xzf libvorbis.tar.gz && cd libvorbis &&
217     ./configure --prefix=$CONTRIB --with-ogg=$CONTRIB --disable-shared &&
218     make && make install &&
219     strip -S $CONTRIB/lib/libvorbis.a
220 }
221 Wget      $(SUBDIR)/libvorbis.tar.gz : $(SUBDIR)/version_libvorbis.txt ;
222 LibVorbis $(SUBDIR)/lib/libvorbis.a  : $(SUBDIR)/libvorbis.tar.gz ;
223
224 rule LibVorbisEnc
225 {
226     Depends $(<) : $(>) ;
227     Depends lib  : $(<) ;
228 }
229 actions LibVorbisEnc
230 {
231     strip -S $(<)
232 }
233 LibVorbisEnc $(SUBDIR)/lib/libvorbisenc.a : $(SUBDIR)/lib/libvorbis.a ;
234
235 # libx264
236 rule LibX264
237 {
238     Depends $(<) : $(>) ;
239     Depends lib  : $(<) ;
240 }
241 actions LibX264
242 {
243     cd `dirname $(>)` && CONTRIB=`pwd` &&
244     rm -rf x264 && tar xzf x264.tar.gz && cd x264 &&
245     ./configure --prefix=$CONTRIB --enable-pthread && make &&
246     make install &&
247     strip -S $CONTRIB/lib/libx264.a
248 }
249 Wget    $(SUBDIR)/x264.tar.gz   : $(SUBDIR)/version_x264.txt ;
250 LibX264 $(SUBDIR)/lib/libx264.a : $(SUBDIR)/x264.tar.gz ;
251
252 # libxvidcore
253 rule LibXvidCore
254 {
255     Depends $(<) : $(>) ;
256     Depends lib  : $(<) ;
257 }
258 actions LibXvidCore
259 {
260     cd `dirname $(>)` && CONTRIB=`pwd` &&
261     rm -rf xvidcore && tar xzf xvidcore.tar.gz &&
262     cd xvidcore && patch -p1 < ../xvidcore.patch &&
263     cd build/generic/ && ./configure && make libxvidcore.a &&
264     cp ./=build/libxvidcore.a $CONTRIB/lib/ &&
265     cp ../../src/xvid.h $CONTRIB/include/ &&
266     strip -S $CONTRIB/lib/libxvidcore.a
267 }
268 Wget        $(SUBDIR)/xvidcore.tar.gz   : $(SUBDIR)/version_xvidcore.txt ;
269 LibXvidCore $(SUBDIR)/lib/libxvidcore.a : $(SUBDIR)/xvidcore.tar.gz ;