Fix the build for non-GNU-ar
authorIan Lynagh <igloo@earth.li>
Wed, 24 Mar 2010 13:29:07 +0000 (13:29 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 24 Mar 2010 13:29:07 +0000 (13:29 +0000)
aclocal.m4
configure.ac
mk/config.mk.in
rules/build-package-way.mk

index 816e1f5..42b8ed5 100644 (file)
@@ -395,6 +395,7 @@ else
   fp_cv_prog_ar_is_gnu=no
 fi])
 fp_prog_ar_is_gnu=$fp_cv_prog_ar_is_gnu
+AC_SUBST([ArIsGNUAr], [`echo $fp_prog_ar_is_gnu | tr 'a-z' 'A-Z'`])
 ])# FP_PROG_AR_IS_GNU
 
 
index 849b185..236c881 100644 (file)
@@ -576,6 +576,7 @@ dnl If you can run configure, you certainly have /bin/sh
 AC_DEFINE([HAVE_BIN_SH], [1], [Define to 1 if you have /bin/sh.])
 
 dnl ** how to invoke `ar' and `ranlib'
+FP_PROG_AR_IS_GNU
 FP_PROG_AR_NEEDS_RANLIB
 FP_PROG_AR_SUPPORTS_INPUT
 
index a640c3e..db21b14 100644 (file)
@@ -563,6 +563,7 @@ DLLTOOL                     = inplace/mingw/bin/dlltool.exe
 AR                     = @ArCmd@
 AR_OPTS                        = @ArArgs@
 ArSupportsInput                = @ArSupportsInput@
+ArIsGNUAr = @ArIsGNUAr@
 # Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
 BASH                    = /usr/local/bin/bash
 
index 735527c..d66ed7c 100644 (file)
@@ -81,7 +81,11 @@ ifeq "$$($1_$2_SplitObjs)" "YES"
 else
        echo $$($1_$2_$3_ALL_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` >> $$@.contents
 endif
+ifeq "$$(ArIsGNUAr)" "YES"
        "$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ @$$@.contents
+else
+       "$$(XARGS)" $$(XARGS_OPTS) "$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ < $$@.contents
+endif
        "$$(RM)" $$(RM_OPTS) $$@.contents
 endif