]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/x264-svn-win32.patch
Update x264 patch
[vlc] / extras / contrib / src / Patches / x264-svn-win32.patch
1 --- Makefile    (rĂ©vision 380)
2 +++ Makefile    (copie de travail)
3 @@ -63,8 +63,8 @@
4  default: $(DEP) x264$(EXE)
5  
6  libx264.a: .depend $(OBJS) $(OBJASM)
7 -       ar rc libx264.a $(OBJS) $(OBJASM)
8 -       ranlib libx264.a
9 +       $(AR) rc libx264.a $(OBJS) $(OBJASM)
10 +       $(RANLIB) libx264.a
11  
12  x264$(EXE): libx264.a x264.o matroska.o
13         $(CC) -o $@ x264.o matroska.o libx264.a $(LDFLAGS)
14 @@ -128,14 +128,14 @@
15  distclean: clean
16         rm -f config.mak vfw/build/cygwin/config.mak x264.pc
17  
18 -install: x264
19 +install: x264$(EXE)
20         install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
21         install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig
22         install -m 644 x264.h $(DESTDIR)$(includedir)
23         install -m 644 libx264.a $(DESTDIR)$(libdir)
24         install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
25 -       install x264 $(DESTDIR)$(bindir)
26 -       ranlib $(DESTDIR)$(libdir)/libx264.a
27 +       install x264$(EXE) $(DESTDIR)$(bindir)
28 +       $(RANLIB) $(DESTDIR)$(libdir)/libx264.a
29  
30  uninstall:
31         rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a
32 --- configure   (rĂ©vision 385)
33 +++ configure   (copie de travail)
34 @@ -7,6 +7,7 @@
35  echo "available options:"
36  echo ""
37  echo "  --help                   print this message"
38 +echo "  --crosscompile=ARCH      crosscompile for ARCH"
39  echo "  --enable-avis-input      enables avisynth input (win32 only)"
40  echo "  --enable-mp4-output      enables mp4 output (using gpac)"
41  echo "  --enable-vfw             compiles the VfW frontend"
42 @@ -58,47 +59,143 @@
43  
44  EXE=""
45  
46 -UNAMES="`uname -s`"
47 +AR="ar"
48 +AROPTS="rc"
49 +RANLIB="ranlib"
50 +
51 +UNAMES="`uname -s |tr A-Z a-z`"
52 +UNAMEM="`uname -m |tr A-Z a-z`"
53 +
54 +# parse options
55 +
56 +for opt do
57 +    optarg="${opt#*=}"
58 +    case "$opt" in
59 +       --crosscompile=*)
60 +           CROSS="$optarg"
61 +           CC="$CROSS-gcc"
62 +           AR="$CROSS-ar"
63 +           RANLIB="$CROSS-ranlib"
64 +           UNAMES="`echo $CROSS | cut -d- -f2`"
65 +           UNAMEM="`echo $CROSS | cut -d- -f1`"
66 +           ;;
67 +       --prefix=*)
68 +           prefix="$optarg"
69 +           ;;
70 +       --exec-prefix=*)
71 +           eprefix="$optarg"
72 +           ;;
73 +       --bindir=*)
74 +           bindir="$optarg"
75 +           ;;
76 +       --libdir=*)
77 +           libdir="$optarg"
78 +           ;;
79 +       --includedir=*)
80 +           includedir="$optarg"
81 +           ;;
82 +        --enable-avis-input)
83 +            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
84 +                CFLAGS="$CFLAGS -DAVIS_INPUT"
85 +                LDFLAGS="$LDFLAGS -lvfw32"
86 +                avis_input="yes"
87 +            fi
88 +            ;;
89 +        --enable-mp4-output)
90 +            CFLAGS="$CFLAGS -DMP4_OUTPUT"
91 +            LDFLAGS="$LDFLAGS -lgpac_static"
92 +            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
93 +                LDFLAGS="$LDFLAGS -lwinmm"
94 +            fi
95 +            mp4_output="yes"
96 +            ;;
97 +        --extra-asflags=*)
98 +            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
99 +            ;;
100 +        --extra-cflags=*)
101 +            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
102 +            VFW_CFLAGS="${opt#--extra-cflags=}"
103 +            ;;
104 +        --extra-ldflags=*)
105 +            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
106 +            VFW_LDFLAGS="${opt#--extra-ldflags=}"
107 +            ;;
108 +        --enable-pthread)
109 +            CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
110 +            pthread="yes"
111 +            case $SYS in
112 +              MINGW|CYGWIN|BEOS)
113 +                ;;
114 +              *)
115 +                LDFLAGS="$LDFLAGS -lpthread"
116 +                ;;
117 +            esac
118 +            ;;
119 +        --enable-debug)
120 +            CFLAGS="$CFLAGS -g"
121 +            debug="yes"
122 +            ;;
123 +        --enable-gprof)
124 +            CFLAGS="$CFLAGS -pg"
125 +            LDFLAGS="$LDFLAGS -pg"
126 +            gprof="yes"
127 +            ;;
128 +        --enable-pic)
129 +            CFLAGS="$CFLAGS -fPIC"
130 +            ASFLAGS="$ASFLAGS -D__PIC__"
131 +            pic="yes"
132 +            ;;
133 +        --enable-vfw)
134 +            vfw="yes"
135 +            ;;
136 +        --enable-visualize)
137 +            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
138 +            CFLAGS="$CFLAGS -DVISUALIZE=1"
139 +            vis="yes"
140 +            ;;
141 +        *)
142 +            echo "Unknown option $opt, ignored"
143 +            ;;
144 +    esac
145 +done
146 +
147 +
148  case "$UNAMES" in
149 -  BeOS)
150 +  beos)
151      SYS="BEOS"
152      CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
153      ;;
154 -  Darwin)
155 +  darwin)
156      SYS="MACOSX"
157      CFLAGS="$CFLAGS -falign-loops=16"
158      LDFLAGS="$LDFLAGS -lm -lmx"
159      ;;
160 -  FreeBSD)
161 +  freebsd)
162      SYS="FREEBSD"
163      LDFLAGS="$LDFLAGS -lm"
164      ;;
165 -  NetBSD)
166 +  netbsd)
167      SYS="NETBSD"
168      LDFLAGS="$LDFLAGS -lm"
169      ;;
170 -  Linux)
171 +  linux)
172      SYS="LINUX"
173      CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
174      LDFLAGS="$LDFLAGS -lm"
175      ;;
176 -  CYGWIN*)
177 +  cygwin*)
178      SYS="CYGWIN"
179      CFLAGS="$CFLAGS -mno-cygwin"
180      LDFLAGS="$LDFLAGS -mno-cygwin"
181      ASFLAGS="-f win32 -DPREFIX"
182      EXE=".exe"
183 -    DEVNULL="NUL"
184 -    vfw="yes"
185      ;;
186 -  MINGW*)
187 +  mingw*)
188      SYS="MINGW"
189      ASFLAGS="-f win32 -DPREFIX"
190      EXE=".exe"
191 -    DEVNULL="NUL"
192 -    vfw="yes"
193      ;;
194 -  SunOS)
195 +  sunos)
196      SYS="SunOS"
197      CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
198      LDFLAGS="$LDFLAGS -lm"
199 @@ -110,9 +202,8 @@
200      ;;
201  esac
202  
203 -UNAMEM="`uname -m`"
204  case "$UNAMEM" in
205 -  i386|i486|i586|i686|BePC)
206 +  i386|i486|i586|i686|bepc)
207      ARCH="X86"
208      CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
209      ;;
210 @@ -122,7 +213,7 @@
211      AS="yasm"
212      ASFLAGS="-f elf -m amd64"
213      ;;
214 -  "Power Macintosh"|ppc)
215 +  "power macintosh"|ppc)
216      ARCH="PPC"
217      if [ $SYS = MACOSX ]
218      then
219 @@ -144,9 +235,6 @@
220    ia64)
221      ARCH="IA64"
222      ;;
223 -  alpha)
224 -    ARCH="ALPHA"
225 -    ;;
226    mips|mipsel)
227      ARCH="MIPS"
228      ;;
229 @@ -180,134 +273,6 @@
230
231  CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
232
233 -# parse options
234 -
235 -for opt do
236 -    optarg="${opt#*=}"
237 -    case "$opt" in
238 -        --prefix=*)
239 -            prefix="$optarg"
240 -            ;;
241 -        --exec-prefix=*)
242 -            exec_prefix="$optarg"
243 -            ;;
244 -        --bindir=*)
245 -            bindir="$optarg"
246 -            ;;
247 -        --libdir=*)
248 -            libdir="$optarg"
249 -            ;;
250 -        --includedir=*)
251 -            includedir="$optarg"
252 -            ;;
253 -        --enable-avis-input)
254 -            avis_input="yes"
255 -            ;;
256 -        --disable-avis-input)
257 -            avis_input="no"
258 -            ;;
259 -        --enable-mp4-output)
260 -            mp4_output="yes"
261 -            ;;
262 -        --disable-mp4-output)
263 -            mp4_output="no"
264 -            ;;
265 -        --extra-asflags=*)
266 -            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
267 -            ;;
268 -        --extra-cflags=*)
269 -            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
270 -            VFW_CFLAGS="${opt#--extra-cflags=}"
271 -            ;;
272 -        --extra-ldflags=*)
273 -            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
274 -            VFW_LDFLAGS="${opt#--extra-ldflags=}"
275 -            ;;
276 -        --enable-pthread)
277 -            pthread="yes"
278 -            ;;
279 -        --disable-pthread)
280 -            pthread="no"
281 -            ;;
282 -        --enable-debug)
283 -            CFLAGS="$CFLAGS -g"
284 -            debug="yes"
285 -            ;;
286 -        --enable-gprof)
287 -            CFLAGS="$CFLAGS -pg"
288 -            LDFLAGS="$LDFLAGS -pg"
289 -            gprof="yes"
290 -            ;;
291 -        --enable-pic)
292 -            CFLAGS="$CFLAGS -fPIC"
293 -            ASFLAGS="$ASFLAGS -D__PIC__"
294 -            pic="yes"
295 -            ;;
296 -        --enable-vfw)
297 -            vfw="yes"
298 -            ;;
299 -        --disable-vfw)
300 -            vfw="no"
301 -            ;;
302 -        --enable-visualize)
303 -            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
304 -            CFLAGS="$CFLAGS -DVISUALIZE=1"
305 -            vis="yes"
306 -            ;;
307 -        *)
308 -            echo "Unknown option $opt, ignored"
309 -            ;;
310 -    esac
311 -done
312 -
313 -# autodetect options that weren't forced nor disabled
314 -
315 -if test "$pthread" = "auto" ; then
316 -    case $SYS in
317 -        MINGW|CYGWIN|BEOS)
318 -            pthread="yes"
319 -            ;;
320 -        *)
321 -            pthread="no"
322 -            cc_check pthread.h -lpthread && pthread="yes"
323 -            ;;
324 -    esac
325 -fi
326 -if test "$pthread" = "yes" ; then
327 -    CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
328 -    case $SYS in
329 -        MINGW|CYGWIN|BEOS)
330 -            ;;
331 -        *) LDFLAGS="$LDFLAGS -lpthread"
332 -            ;;
333 -    esac
334 -fi
335 -
336 -MP4_LDFLAGS="-lgpac_static"
337 -if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
338 -    MP4_LDFLAGS="$MP4_LDFLAGS -lwinmm"
339 -fi
340 -if [ "$mp4_output" = "auto" ] ; then
341 -    mp4_output="no"
342 -    cc_check gpac/isomedia.h "$MP4_LDFLAGS" && mp4_output="yes"
343 -fi
344 -if [ "$mp4_output" = "yes" ] ; then
345 -    echo "#define MP4_OUTPUT" >> config.h
346 -    LDFLAGS="$LDFLAGS $MP4_LDFLAGS"
347 -fi
348 -
349 -if [ "$avis_input" = "auto" ] ; then
350 -    if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
351 -        avis_input="yes"
352 -    else
353 -        avis_input="no";
354 -    fi
355 -fi
356 -if [ "$avis_input" = "yes" ] ; then
357 -    echo "#define AVIS_INPUT" >> config.h
358 -    LDFLAGS="$LDFLAGS -lvfw32"
359 -fi
360 -
361  if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
362      CFLAGS="$CFLAGS -s -fomit-frame-pointer"
363      LDFLAGS="$LDFLAGS -s"
364 @@ -317,6 +282,9 @@
365  ASFLAGS=$ASFLAGS
366  VFW=$vfw
367  EXE=$EXE
368 +AR=$AR
369 +AROPTS=$AROPTS
370 +RANLIB=$RANLIB
371  VIS=$vis
372  HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
373  DEVNULL=$DEVNULL