Refresh x264 patch and use pthread for x264 in win32
[vlc.git] / extras / contrib / src / Patches / x264-svn-win32.patch
1 Index: configure
2 ===================================================================
3 --- configure   (revision 612)
4 +++ configure   (working copy)
5 @@ -55,8 +55,8 @@
6  shared="no"
7  
8  CC="${CC-gcc}"
9 -CFLAGS="-Wall -I. -D__X264__"
10 -LDFLAGS=""
11 +CFLAGS="$CFLAGS -Wall -I. -D__X264__"
12 +LDFLAGS="$LDFLAGS"
13  HAVE_GETOPT_LONG=1
14  
15  AS="nasm"
16 @@ -64,8 +64,101 @@
17  
18  EXE=""
19  
20 +AR="ar"
21 +AROPTS="rc"
22 +RANLIB="ranlib"
23 +
24  MACHINE="$(./config.guess)"
25  
26 +# parse options
27 +
28 +for opt do
29 +    optarg="${opt#*=}"
30 +    case "$opt" in
31 +       --crosscompile=*)
32 +            CROSS="$optarg"
33 +            CC="$CROSS-gcc"
34 +            AR="$CROSS-ar"
35 +            RANLIB="$CROSS-ranlib"
36 +            MACHINE="`echo $CROSS | sed -e 's/-/-x-/g'`"
37 +           ;;
38 +        --prefix=*)
39 +            prefix="$optarg"
40 +            ;;
41 +        --exec-prefix=*)
42 +            exec_prefix="$optarg"
43 +            ;;
44 +        --bindir=*)
45 +            bindir="$optarg"
46 +            ;;
47 +        --libdir=*)
48 +            libdir="$optarg"
49 +            ;;
50 +        --includedir=*)
51 +            includedir="$optarg"
52 +            ;;
53 +        --enable-avis-input)
54 +            avis_input="yes"
55 +            ;;
56 +        --disable-avis-input)
57 +            avis_input="no"
58 +            ;;
59 +        --enable-mp4-output)
60 +            mp4_output="yes"
61 +            ;;
62 +        --disable-mp4-output)
63 +            mp4_output="no"
64 +            ;;
65 +        --extra-asflags=*)
66 +            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
67 +            ;;
68 +        --extra-cflags=*)
69 +            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
70 +            ;;
71 +        --extra-ldflags=*)
72 +            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
73 +            ;;
74 +        --enable-pthread)
75 +            pthread="yes"
76 +            ;;
77 +        --disable-pthread)
78 +            pthread="no"
79 +            ;;
80 +        --enable-debug)
81 +            debug="yes"
82 +            ;;
83 +        --enable-gprof)
84 +            CFLAGS="$CFLAGS -pg"
85 +            LDFLAGS="$LDFLAGS -pg"
86 +            gprof="yes"
87 +            ;;
88 +        --enable-pic)
89 +            pic="yes"
90 +            ;;
91 +        --enable-gtk)
92 +            gtk="yes"
93 +            ;;
94 +        --disable-gtk)
95 +            gtk="no"
96 +            ;;
97 +        --enable-shared)
98 +            shared="yes"
99 +            if [ $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" ] ; then
100 +                pic="yes"
101 +            fi
102 +            ;;
103 +        --enable-visualize)
104 +            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
105 +            CFLAGS="$CFLAGS -DVISUALIZE=1"
106 +            vis="yes"
107 +            ;;
108 +        *)
109 +            echo "Unknown option $opt, ignored"
110 +            ;;
111 +    esac
112 +done
113 +
114 +
115  case "${MACHINE#*-*-}" in
116    beos*)
117      SYS="BEOS"
118 @@ -183,88 +276,6 @@
119  esac
120  
121  CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
122 -
123 -# parse options
124 -
125 -for opt do
126 -    optarg="${opt#*=}"
127 -    case "$opt" in
128 -        --prefix=*)
129 -            prefix="$optarg"
130 -            ;;
131 -        --exec-prefix=*)
132 -            exec_prefix="$optarg"
133 -            ;;
134 -        --bindir=*)
135 -            bindir="$optarg"
136 -            ;;
137 -        --libdir=*)
138 -            libdir="$optarg"
139 -            ;;
140 -        --includedir=*)
141 -            includedir="$optarg"
142 -            ;;
143 -        --enable-avis-input)
144 -            avis_input="yes"
145 -            ;;
146 -        --disable-avis-input)
147 -            avis_input="no"
148 -            ;;
149 -        --enable-mp4-output)
150 -            mp4_output="yes"
151 -            ;;
152 -        --disable-mp4-output)
153 -            mp4_output="no"
154 -            ;;
155 -        --extra-asflags=*)
156 -            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
157 -            ;;
158 -        --extra-cflags=*)
159 -            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
160 -            ;;
161 -        --extra-ldflags=*)
162 -            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
163 -            ;;
164 -        --enable-pthread)
165 -            pthread="auto" # can't skip detection, since it differs by OS
166 -            ;;
167 -        --disable-pthread)
168 -            pthread="no"
169 -            ;;
170 -        --enable-debug)
171 -            debug="yes"
172 -            ;;
173 -        --enable-gprof)
174 -            CFLAGS="$CFLAGS -pg"
175 -            LDFLAGS="$LDFLAGS -pg"
176 -            gprof="yes"
177 -            ;;
178 -        --enable-pic)
179 -            pic="yes"
180 -            ;;
181 -        --enable-gtk)
182 -            gtk="yes"
183 -            ;;
184 -        --disable-gtk)
185 -            gtk="no"
186 -            ;;
187 -        --enable-shared)
188 -            shared="yes"
189 -            if [ $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" ] ; then
190 -                pic="yes"
191 -            fi
192 -            ;;
193 -        --enable-visualize)
194 -            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
195 -            CFLAGS="$CFLAGS -DVISUALIZE=1"
196 -            vis="yes"
197 -            ;;
198 -        *)
199 -            echo "Unknown option $opt, ignored"
200 -            ;;
201 -    esac
202 -done
203 -
204  # autodetect options that weren't forced nor disabled
205  
206  libpthread=""
207 @@ -363,6 +374,9 @@
208  ASFLAGS=$ASFLAGS
209  GTK=$gtk
210  EXE=$EXE
211 +AR=$AR 
212 +AROPTS=$AROPTS 
213 +RANLIB=$RANLIB 
214  VIS=$vis
215  HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
216  DEVNULL=$DEVNULL
217 Index: Makefile
218 ===================================================================
219 --- Makefile    (revision 590)
220 +++ Makefile    (working copy)
221 @@ -66,8 +66,8 @@
222  default: $(DEP) x264$(EXE)
223  
224  libx264.a: .depend $(OBJS) $(OBJASM)
225 -       ar rc libx264.a $(OBJS) $(OBJASM)
226 -       ranlib libx264.a
227 +       $(AR) rc libx264.a $(OBJS) $(OBJASM)
228 +       $(RANLIB) libx264.a
229  
230  $(SONAME): .depend $(OBJS) $(OBJASM)
231         $(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME) $(LDFLAGS)
232 @@ -138,14 +138,14 @@
233         rm -f config.mak config.h x264.pc
234         $(MAKE) -C gtk distclean
235  
236 -install: x264 $(SONAME)
237 +install: x264$(EXE)
238         install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
239         install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig
240         install -m 644 x264.h $(DESTDIR)$(includedir)
241         install -m 644 libx264.a $(DESTDIR)$(libdir)
242         install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
243 -       install x264 $(DESTDIR)$(bindir)
244 -       ranlib $(DESTDIR)$(libdir)/libx264.a
245 +       install x264$(EXE) $(DESTDIR)$(bindir)
246 +       $(RANLIB) $(DESTDIR)$(libdir)/libx264.a
247         $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.so)
248         $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))
249