This allows building with Microsofts version of ar
by specifying --ar='c99wrap lib.exe' during configure.
---
 configure   |   11 +++++++++++
 library.mak |    2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 7c377aa..876659d 100755
--- a/configure
+++ b/configure
@@ -1807,6 +1807,7 @@ enable static
 enable swscale_alpha
 
 # build settings
+ARFLAGS='rc'
 SHFLAGS='-shared -Wl,-soname,$$(@F)'
 AVSERVERLDFLAGS=-Wl,-E
 LIBPREF="lib"
@@ -1826,6 +1827,7 @@ asflags_filter=echo
 cflags_filter=echo
 ldflags_filter=echo
 
+AR_O='$@'
 AS_C='-c'
 AS_O='-o $@'
 CC_C='-c'
@@ -2204,6 +2206,7 @@ probe_cc(){
     unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
     unset _ld_o _ldflags _ld_lib _ld_path
     unset _depflags _DEPCMD _DEPFLAGS
+    unset _arflags _ar_o
     _flags_filter=echo
 
     if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
@@ -2334,6 +2337,8 @@ probe_cc(){
         if [ $pfx = hostcc ]; then
             append _cflags -Dsnprintf=_snprintf
         fi
+        _ar_o='-out $@'
+        _arflags='-nologo'
     fi
 
     eval ${pfx}_type=\$_type
@@ -2382,6 +2387,10 @@ asflags_filter=$_flags_filter
 add_asflags $_flags $_cflags
 set_ccvars AS
 
+probe_cc ar "$ar"
+ARFLAGS=${_arflags-$ARFLAGS}
+AR_O=${_ar_o-$AR_O}
+
 probe_cc ld "$ld"
 ldflags_filter=$_flags_filter
 add_ldflags $_flags $_ldflags
@@ -3635,6 +3644,8 @@ RANLIB=$ranlib
 LN_S=$ln_s
 CPPFLAGS=$CPPFLAGS
 CFLAGS=$CFLAGS
+ARFLAGS=$ARFLAGS
+AR_O=$AR_O
 ASFLAGS=$ASFLAGS
 AS_C=$AS_C
 AS_O=$AS_O
diff --git a/library.mak b/library.mak
index d89050e..19f05f9 100644
--- a/library.mak
+++ b/library.mak
@@ -25,7 +25,7 @@ $(TESTOBJS): CPPFLAGS += -DTEST
 
 $(SUBDIR)$(LIBNAME): $(OBJS)
        $(RM) $@
-       $(AR) rc $@ $^ $(EXTRAOBJS)
+       $(AR) $(ARFLAGS) $(AR_O) $^ $(EXTRAOBJS)
        $(RANLIB) $@
 
 install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
-- 
1.7.10.msysgit.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to