diff --git a/configure b/configure
index 39342a1c408703736540048286530a298f3ba7ac..d56cd98c1f0a1f589916dee92d860ed02ca1bbc5 100755
--- a/configure
+++ b/configure
@@ -21,6 +21,7 @@ prefix="/usr/local"
 cross_prefix=""
 cc="gcc"
 ar="ar"
+ranlib="ranlib"
 make="make"
 strip="strip"
 cpu=`uname -m`
@@ -239,6 +240,7 @@ fi
 
 cc="${cross_prefix}${cc}"
 ar="${cross_prefix}${ar}"
+ranlib="${cross_prefix}${ranlib}"
 strip="${cross_prefix}${strip}"
 
 # ---
@@ -392,6 +394,7 @@ echo "prefix=$prefix" >> config.mak
 echo "MAKE=$make" >> config.mak
 echo "CC=$cc" >> config.mak
 echo "AR=$ar" >> config.mak
+echo "RANLIB=$ranlib" >> config.mak
 echo "STRIP=$strip" >> config.mak
 echo "OPTFLAGS=$CFLAGS" >> config.mak
 echo "LDFLAGS=$LDFLAGS" >> config.mak
diff --git a/libav/Makefile b/libav/Makefile
index 1a535ffb96014212fa2765f5e9362cb996c5a725..b8b93cc3624cbd15477191ba9ddc0239d0624956 100644
--- a/libav/Makefile
+++ b/libav/Makefile
@@ -43,7 +43,8 @@ all: $(LIB)
 
 $(LIB): $(OBJS)
 	rm -f $@
-	$(AR) rcs $@ $(OBJS)
+	$(AR) rc $@ $(OBJS)
+	$(RANLIB) $@
 
 installlib: all
 	install -m 644 $(LIB) $(prefix)/lib
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 31f5be28a67e57e9a9d9a023c29f68b111a1d5ae..d66dfcad149a6d9145aea0bff23d821ff1b53038 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -96,7 +96,8 @@ tests: apiexample cpuid_test $(TESTS)
 
 $(LIB): $(OBJS)
 	rm -f $@
-	$(AR) rcs $@ $(OBJS)
+	$(AR) rc $@ $(OBJS)
+	$(RANLIB) $@
 
 $(SLIB): $(OBJS)
 	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)