---- Makefile	(révision 380)
-+++ Makefile	(copie de travail)
-@@ -63,8 +63,8 @@
+Index: configure
+===================================================================
+--- configure	(revision 473)
++++ configure	(working copy)
+@@ -7,6 +7,7 @@
+ echo "available options:"
+ echo ""
+ echo "  --help                   print this message"
++echo "  --crosscompile=ARCH      crosscompile for ARCH"
+ echo "  --enable-avis-input      enables avisynth input (win32 only)"
+ echo "  --enable-mp4-output      enables mp4 output (using gpac)"
+ echo "  --enable-vfw             compiles the VfW frontend"
+@@ -64,43 +65,143 @@
+ 
+ EXE=""
+ 
+-UNAMES="`uname -s`"
++AR="ar"
++AROPTS="rc"
++RANLIB="ranlib"
++
++UNAMES="`uname -s |tr A-Z a-z`"
++UNAMEM="`uname -m |tr A-Z a-z`"
++
++# parse options
++
++for opt do
++    optarg="${opt#*=}"
++    case "$opt" in
++       --crosscompile=*)
++           CROSS="$optarg"
++           CC="$CROSS-gcc"
++           AR="$CROSS-ar"
++           RANLIB="$CROSS-ranlib"
++           UNAMES="`echo $CROSS | cut -d- -f2`"
++           UNAMEM="`echo $CROSS | cut -d- -f1`"
++           ;;
++       --prefix=*)
++           prefix="$optarg"
++           ;;
++       --exec-prefix=*)
++           eprefix="$optarg"
++           ;;
++       --bindir=*)
++           bindir="$optarg"
++           ;;
++       --libdir=*)
++           libdir="$optarg"
++           ;;
++       --includedir=*)
++           includedir="$optarg"
++           ;;
++        --enable-avis-input)
++            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
++                CFLAGS="$CFLAGS -DAVIS_INPUT"
++                LDFLAGS="$LDFLAGS -lvfw32"
++                avis_input="yes"
++            fi
++            ;;
++        --enable-mp4-output)
++            CFLAGS="$CFLAGS -DMP4_OUTPUT"
++            LDFLAGS="$LDFLAGS -lgpac_static"
++            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
++                LDFLAGS="$LDFLAGS -lwinmm"
++            fi
++            mp4_output="yes"
++            ;;
++        --extra-asflags=*)
++            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
++            ;;
++        --extra-cflags=*)
++            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
++            VFW_CFLAGS="${opt#--extra-cflags=}"
++            ;;
++        --extra-ldflags=*)
++            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
++            VFW_LDFLAGS="${opt#--extra-ldflags=}"
++            ;;
++        --enable-pthread)
++            CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
++            pthread="yes"
++            case $SYS in
++              MINGW|CYGWIN|BEOS)
++                ;;
++              *)
++                LDFLAGS="$LDFLAGS -lpthread"
++                ;;
++            esac
++            ;;
++        --enable-debug)
++            CFLAGS="$CFLAGS -g"
++            debug="yes"
++            ;;
++        --enable-gprof)
++            CFLAGS="$CFLAGS -pg"
++            LDFLAGS="$LDFLAGS -pg"
++            gprof="yes"
++            ;;
++        --enable-pic)
++            CFLAGS="$CFLAGS -fPIC"
++            ASFLAGS="$ASFLAGS -D__PIC__"
++            pic="yes"
++            ;;
++        --enable-vfw)
++            vfw="yes"
++            ;;
++        --enable-visualize)
++            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
++            CFLAGS="$CFLAGS -DVISUALIZE=1"
++            vis="yes"
++            ;;
++        *)
++            echo "Unknown option $opt, ignored"
++            ;;
++    esac
++done
++
++
+ case "$UNAMES" in
+-  BeOS)
++  beos)
+     SYS="BEOS"
+     CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
+     ;;
+-  Darwin)
++  darwin)
+     SYS="MACOSX"
+     CFLAGS="$CFLAGS -falign-loops=16"
+     LDFLAGS="$LDFLAGS -lm -lmx"
+     ;;
+-  FreeBSD)
++  freebsd)
+     SYS="FREEBSD"
+     LDFLAGS="$LDFLAGS -lm"
+     ;;
+-  NetBSD)
++  netbsd)
+     SYS="NETBSD"
+     LDFLAGS="$LDFLAGS -lm"
+     ;;
+-  Linux)
++  linux)
+     SYS="LINUX"
+     CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
+     LDFLAGS="$LDFLAGS -lm"
+     ;;
+-  CYGWIN*)
++  cygwin*)
+     SYS="CYGWIN"
+     CFLAGS="$CFLAGS -mno-cygwin"
+     LDFLAGS="$LDFLAGS -mno-cygwin"
+     EXE=".exe"
+     DEVNULL="NUL"
+     ;;
+-  MINGW*)
++  mingw*)
+     SYS="MINGW"
+     EXE=".exe"
+     DEVNULL="NUL"
+     ;;
+-  SunOS)
++  sunos)
+     SYS="SunOS"
+     CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
+     LDFLAGS="$LDFLAGS -lm"
+@@ -112,9 +213,8 @@
+     ;;
+ esac
+ 
+-UNAMEM="`uname -m`"
+ case "$UNAMEM" in
+-  i386|i486|i586|i686|BePC)
++  i386|i486|i586|i686|bepc)
+     ARCH="X86"
+     CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
+     AS="nasm"
+@@ -135,7 +235,7 @@
+     AS="yasm"
+     ASFLAGS="-f elf -m amd64"
+     ;;
+-  "Power Macintosh"|ppc)
++  "power macintosh"|ppc)
+     ARCH="PPC"
+     if [ $SYS = MACOSX ]
+     then
+@@ -183,90 +283,7 @@
+ 
+ CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
+ 
+-# parse options
+ 
+-for opt do
+-    optarg="${opt#*=}"
+-    case "$opt" in
+-        --prefix=*)
+-            prefix="$optarg"
+-            ;;
+-        --exec-prefix=*)
+-            exec_prefix="$optarg"
+-            ;;
+-        --bindir=*)
+-            bindir="$optarg"
+-            ;;
+-        --libdir=*)
+-            libdir="$optarg"
+-            ;;
+-        --includedir=*)
+-            includedir="$optarg"
+-            ;;
+-        --enable-avis-input)
+-            avis_input="yes"
+-            ;;
+-        --disable-avis-input)
+-            avis_input="no"
+-            ;;
+-        --enable-mp4-output)
+-            mp4_output="yes"
+-            ;;
+-        --disable-mp4-output)
+-            mp4_output="no"
+-            ;;
+-        --extra-asflags=*)
+-            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
+-            ;;
+-        --extra-cflags=*)
+-            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
+-            VFW_CFLAGS="${opt#--extra-cflags=}"
+-            ;;
+-        --extra-ldflags=*)
+-            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
+-            VFW_LDFLAGS="${opt#--extra-ldflags=}"
+-            ;;
+-        --enable-pthread)
+-            pthread="yes"
+-            ;;
+-        --disable-pthread)
+-            pthread="no"
+-            ;;
+-        --enable-debug)
+-            CFLAGS="$CFLAGS -g"
+-            debug="yes"
+-            ;;
+-        --enable-gprof)
+-            CFLAGS="$CFLAGS -pg"
+-            LDFLAGS="$LDFLAGS -pg"
+-            gprof="yes"
+-            ;;
+-        --enable-pic)
+-            pic="yes"
+-            ;;
+-        --enable-vfw)
+-            vfw="yes"
+-            ;;
+-        --disable-vfw)
+-            vfw="no"
+-            ;;
+-        --enable-shared)
+-            shared="yes"
+-            if [ $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" ] ; then
+-                pic="yes"
+-            fi
+-            ;;
+-        --enable-visualize)
+-            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+-            CFLAGS="$CFLAGS -DVISUALIZE=1"
+-            vis="yes"
+-            ;;
+-        *)
+-            echo "Unknown option $opt, ignored"
+-            ;;
+-    esac
+-done
+-
+ # autodetect options that weren't forced nor disabled
+ 
+ if test "$pthread" = "auto" ; then
+@@ -351,6 +368,9 @@
+ ASFLAGS=$ASFLAGS
+ VFW=$vfw
+ EXE=$EXE
++AR=$AR
++AROPTS=$AROPTS
++RANLIB=$RANLIB
+ VIS=$vis
+ HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
+ DEVNULL=$DEVNULL
+Index: Makefile
+===================================================================
+--- Makefile	(revision 473)
++++ Makefile	(working copy)
+@@ -64,8 +64,8 @@
  default: $(DEP) x264$(EXE)
  
  libx264.a: .depend $(OBJS) $(OBJASM)

-	ranlib $(DESTDIR)$(libdir)/libx264.a
+	install x264$(EXE) $(DESTDIR)$(bindir)
+	$(RANLIB) $(DESTDIR)$(libdir)/libx264.a
 
 uninstall:
 	rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(libdir)/libx264.a
--- configure   (revision 452)
+++ configure   (working copy)
@@ -7,6 +7,7 @@
 echo "available options:"
 echo ""
 echo "  --help                   print this message"
+echo "  --crosscompile=ARCH      crosscompile for ARCH"
 echo "  --enable-avis-input      enables avisynth input (win32 only)"
 echo "  --enable-mp4-output      enables mp4 output (using gpac)"
 echo "  --enable-vfw             compiles the VfW frontend"
@@ -62,45 +63,141 @@

 EXE=""

-UNAMES="`uname -s`"
+AR="ar"
+AROPTS="rc"
+RANLIB="ranlib"
+
+UNAMES="`uname -s |tr A-Z a-z`"
+UNAMEM="`uname -m |tr A-Z a-z`"
+
+# parse options
+
+for opt do
+    optarg="${opt#*=}"
+    case "$opt" in
+       --crosscompile=*)
+           CROSS="$optarg"
+           CC="$CROSS-gcc"
+           AR="$CROSS-ar"
+           RANLIB="$CROSS-ranlib"
+           UNAMES="`echo $CROSS | cut -d- -f2`"
+           UNAMEM="`echo $CROSS | cut -d- -f1`"
+           ;;
+       --prefix=*)
+           prefix="$optarg"
+           ;;
+       --exec-prefix=*)
+           eprefix="$optarg"
+           ;;
+       --bindir=*)
+           bindir="$optarg"
+           ;;
+       --libdir=*)
+           libdir="$optarg"
+           ;;
+       --includedir=*)
+           includedir="$optarg"
+           ;;
+        --enable-avis-input)
+            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
+                CFLAGS="$CFLAGS -DAVIS_INPUT"
+                LDFLAGS="$LDFLAGS -lvfw32"
+                avis_input="yes"
+            fi
+            ;;
+        --enable-mp4-output)
+            CFLAGS="$CFLAGS -DMP4_OUTPUT"
+            LDFLAGS="$LDFLAGS -lgpac_static"
+            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
+                LDFLAGS="$LDFLAGS -lwinmm"
+            fi
+            mp4_output="yes"
+            ;;
+        --extra-asflags=*)
+            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
+            ;;
+        --extra-cflags=*)
+            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
+            VFW_CFLAGS="${opt#--extra-cflags=}"
+            ;;
+        --extra-ldflags=*)
+            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
+            VFW_LDFLAGS="${opt#--extra-ldflags=}"
+            ;;
+        --enable-pthread)
+            CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
+            pthread="yes"
+            case $SYS in
+              MINGW|CYGWIN|BEOS)
+                ;;
+              *)
+                LDFLAGS="$LDFLAGS -lpthread"
+                ;;
+            esac
+            ;;
+        --enable-debug)
+            CFLAGS="$CFLAGS -g"
+            debug="yes"
+            ;;
+        --enable-gprof)
+            CFLAGS="$CFLAGS -pg"
+            LDFLAGS="$LDFLAGS -pg"
+            gprof="yes"
+            ;;
+        --enable-pic)
+            CFLAGS="$CFLAGS -fPIC"
+            ASFLAGS="$ASFLAGS -D__PIC__"
+            pic="yes"
+            ;;
+        --enable-vfw)
+            vfw="yes"
+            ;;
+        --enable-visualize)
+            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+            CFLAGS="$CFLAGS -DVISUALIZE=1"
+            vis="yes"
+            ;;
+        *)
+            echo "Unknown option $opt, ignored"
+            ;;
+    esac
+done
+
+
 case "$UNAMES" in
-  BeOS)
+  beos)
     SYS="BEOS"
     CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
     ;;
-  Darwin)
+  darwin)
     SYS="MACOSX"
     CFLAGS="$CFLAGS -falign-loops=16"
     LDFLAGS="$LDFLAGS -lm -lmx"
     ;;
-  FreeBSD)
+  freebsd)
     SYS="FREEBSD"
     LDFLAGS="$LDFLAGS -lm"
     ;;
-  NetBSD)
+  netbsd)
     SYS="NETBSD"
     LDFLAGS="$LDFLAGS -lm"
     ;;
-  Linux)
+  linux)
     SYS="LINUX"
     CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
     LDFLAGS="$LDFLAGS -lm"
     ;;
-  CYGWIN*)
+  cygwin*)
     SYS="CYGWIN"
     CFLAGS="$CFLAGS -mno-cygwin"
     LDFLAGS="$LDFLAGS -mno-cygwin"
     EXE=".exe"
-    DEVNULL="NUL"
-    vfw="yes"
     ;;
-  MINGW*)
+  mingw*)
     SYS="MINGW"
     EXE=".exe"
-    DEVNULL="NUL"
-    vfw="yes"
     ;;
-  SunOS)
+  sunos)
     SYS="SunOS"
     CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
     LDFLAGS="$LDFLAGS -lm"
@@ -112,9 +209,8 @@
     ;;
 esac

-UNAMEM="`uname -m`"
 case "$UNAMEM" in
-  i386|i486|i586|i686|BePC)
+  i386|i486|i586|i686|bepc)
     ARCH="X86"
     CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
     AS="nasm"
@@ -135,7 +231,7 @@
     AS="yasm"
     ASFLAGS="-f elf -m amd64"
     ;;
-  "Power Macintosh"|ppc)
+  "power macintosh"|ppc)
     ARCH="PPC"
     if [ $SYS = MACOSX ]
     then
@@ -183,134 +276,6 @@

 CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"

-# parse options
-
-for opt do
-    optarg="${opt#*=}"
-    case "$opt" in
-        --prefix=*)
-            prefix="$optarg"
-            ;;
-        --exec-prefix=*)
-            exec_prefix="$optarg"
-            ;;
-        --bindir=*)
-            bindir="$optarg"
-            ;;
-        --libdir=*)
-            libdir="$optarg"
-            ;;
-        --includedir=*)
-            includedir="$optarg"
-            ;;
-        --enable-avis-input)
-            avis_input="yes"
-            ;;
-        --disable-avis-input)
-            avis_input="no"
-            ;;
-        --enable-mp4-output)
-            mp4_output="yes"
-            ;;
-        --disable-mp4-output)
-            mp4_output="no"
-            ;;
-        --extra-asflags=*)
-            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
-            ;;
-        --extra-cflags=*)
-            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
-            VFW_CFLAGS="${opt#--extra-cflags=}"
-            ;;
-        --extra-ldflags=*)
-            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
-            VFW_LDFLAGS="${opt#--extra-ldflags=}"
-            ;;
-        --enable-pthread)
-            pthread="yes"
-            ;;
-        --disable-pthread)
-            pthread="no"
-            ;;
-        --enable-debug)
-            CFLAGS="$CFLAGS -g"
-            debug="yes"
-            ;;
-        --enable-gprof)
-            CFLAGS="$CFLAGS -pg"
-            LDFLAGS="$LDFLAGS -pg"
-            gprof="yes"
-            ;;
-        --enable-pic)
-            CFLAGS="$CFLAGS -fPIC"
-            ASFLAGS="$ASFLAGS -D__PIC__"
-            pic="yes"
-            ;;
-        --enable-vfw)
-            vfw="yes"
-            ;;
-        --disable-vfw)
-            vfw="no"
-            ;;
-        --enable-visualize)
-            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
-            CFLAGS="$CFLAGS -DVISUALIZE=1"
-            vis="yes"
-            ;;
-        *)
-            echo "Unknown option $opt, ignored"
-            ;;
-    esac
-done
-
-# autodetect options that weren't forced nor disabled
-
-if test "$pthread" = "auto" ; then
-    case $SYS in
-        MINGW|CYGWIN|BEOS)
-            pthread="yes"
-            ;;
-        *)
-            pthread="no"
-            cc_check pthread.h -lpthread && pthread="yes"
-            ;;
-    esac
-fi
-if test "$pthread" = "yes" ; then
-    CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
-    case $SYS in
-        MINGW|CYGWIN|BEOS)
-            ;;
-        *) LDFLAGS="$LDFLAGS -lpthread"
-            ;;
-    esac
-fi
-
-MP4_LDFLAGS="-lgpac_static"
-if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
-    MP4_LDFLAGS="$MP4_LDFLAGS -lwinmm"
-fi
-if [ "$mp4_output" = "auto" ] ; then
-    mp4_output="no"
-    cc_check gpac/isomedia.h "$MP4_LDFLAGS" && mp4_output="yes"
-fi
-if [ "$mp4_output" = "yes" ] ; then
-    echo "#define MP4_OUTPUT" >> config.h
-    LDFLAGS="$LDFLAGS $MP4_LDFLAGS"
-fi
-
-if [ "$avis_input" = "auto" ] ; then
-    if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
-        avis_input="yes"
-    else
-        avis_input="no";
-    fi
-fi
-if [ "$avis_input" = "yes" ] ; then
-    echo "#define AVIS_INPUT" >> config.h
-    LDFLAGS="$LDFLAGS -lvfw32"
-fi
-
 if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
     CFLAGS="$CFLAGS -s -fomit-frame-pointer"
     LDFLAGS="$LDFLAGS -s"
@@ -342,6 +307,9 @@
 ASFLAGS=$ASFLAGS
 VFW=$vfw
 EXE=$EXE
+AR=$AR
+AROPTS=$AROPTS
+RANLIB=$RANLIB
 VIS=$vis
 HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
 DEVNULL=$DEVNULL



+	$(AR) rc libx264.a $(OBJS) $(OBJASM)
+	$(RANLIB) libx264.a
 
 $(SONAME): .depend $(OBJS) $(OBJASM)
 	$(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME)
@@ -133,14 +133,14 @@
 distclean: clean
 	rm -f config.mak config.h vfw/build/cygwin/config.mak x264.pc
 
-install: x264 $(SONAME)
+install: x264$(EXE)
 	install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
 	install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig
