Index: configure
===================================================================
--- configure	(revision 672)
+++ configure	(working copy)
@@ -339,13 +339,13 @@
             pthread="yes"
             ;;
         MINGW|CYGWIN)
-            if cc_check pthread.h -lpthread "pthread_create(0,0,0,0);" ; then
+            if cc_check pthread.h -lpthread "pthread_create(0,0,0,0); pthread_num_processors_np();" ; then
                 pthread="yes"
                 libpthread="-lpthread"
-            elif cc_check pthread.h -lpthreadGC2 "pthread_create(0,0,0,0);" ; then
+            elif cc_check pthread.h -lpthreadGC2 "pthread_create(0,0,0,0); pthread_num_processors_np();" ; then
                 pthread="yes"
                 libpthread="-lpthreadGC2"
-            elif cc_check pthread.h "-lpthreadGC2 -lwsock32 -DPTW32_STATIC_LIB" "pthread_create(0,0,0,0);" ; then
+            elif cc_check pthread.h "-lpthreadGC2 -lwsock32 -DPTW32_STATIC_LIB" "pthread_create(0,0,0,0); pthread_num_processors_np();" ; then
                 pthread="yes"
                 libpthread="-lpthreadGC2 -lwsock32"
                 CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
@@ -428,6 +428,10 @@
 ASFLAGS=$ASFLAGS
 GTK=$gtk
 EXE=$EXE
+AR=$AR
+STRIP=$STRIP
+AROPTS=$AROPTS
+RANLIB=$RANLIB
 VIS=$vis
 HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
 DEVNULL=$DEVNULL
Index: Makefile
===================================================================
--- Makefile	(revision 672)
+++ Makefile	(working copy)
@@ -73,8 +73,8 @@
 default: $(DEP) x264$(EXE)
 
 libx264.a: .depend $(OBJS) $(OBJASM)
-	ar rc libx264.a $(OBJS) $(OBJASM)
-	ranlib libx264.a
+	$(AR) rc libx264.a $(OBJS) $(OBJASM)
+	$(RANLIB) libx264.a
 
 $(SONAME): .depend $(OBJS) $(OBJASM)
 	$(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME) $(LDFLAGS)
@@ -93,7 +93,7 @@
 %.o: %.asm
 	$(AS) $(ASFLAGS) -o $@ $<
 # delete local/anonymous symbols, so they don't show up in oprofile
-	-@ strip -x $@
+	-@ $(STRIP) -x $@
 
 .depend: config.mak
 	rm -f .depend
@@ -146,14 +146,14 @@
 	rm -rf test/
 	$(MAKE) -C gtk distclean
 
-install: x264 $(SONAME)
+install: x264$(EXE)
 	install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
 	install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig
 	install -m 644 x264.h $(DESTDIR)$(includedir)
 	install -m 644 libx264.a $(DESTDIR)$(libdir)
 	install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
-	install x264 $(DESTDIR)$(bindir)
-	ranlib $(DESTDIR)$(libdir)/libx264.a
+	install x264$(EXE) $(DESTDIR)$(bindir)
+	$(RANLIB) $(DESTDIR)$(libdir)/libx264.a
 	$(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.so)
 	$(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))
 
