Skip to content

Commit

Permalink
Split off AR options in Makefile.in and configure.
Browse files Browse the repository at this point in the history
Adds ARFLAGS variable for options, where AR is now just the command
name.  So now $(AR) $(ARFLAGS) is used to build the static library.
  • Loading branch information
madler committed Nov 13, 2011
1 parent 9e50ed8 commit d169dd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ SHAREDLIBV=libz.so.1.2.5.2
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIBV)

AR=ar rc
AR=ar
ARFLAGS=rc
RANLIB=ranlib
LDCONFIG=ldconfig
LDSHAREDLIBC=-lc
Expand Down Expand Up @@ -111,7 +112,7 @@ test64: all64
-@rm -f foo.gz

libz.a: $(OBJS)
$(AR) $@ $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1

match.o: match.S
Expand Down
13 changes: 8 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ else
AR=${AR-"ar"}
test -n "${CROSS_PREFIX}" && echo Using ${AR}
fi
AR_RC="${AR} rc"
ARFLAGS=${ARFLAGS-"rc"}
if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
test -n "${CROSS_PREFIX}" && echo Using ${RANLIB}
Expand Down Expand Up @@ -161,7 +161,7 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
SHAREDLIBM=libz.$VER1$shared_ext
LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
AR="libtool"
AR_RC="${AR} -o" ;;
ARFLAGS="-o" ;;
*) LDSHARED=${LDSHARED-"$cc -shared"} ;;
esac
else
Expand Down Expand Up @@ -198,7 +198,8 @@ else
CFLAGS=${CFLAGS-"-4 -O"}
LDSHARED=${LDSHARED-"cc"}
RANLIB=${RANLIB-"true"}
AR_RC="cc -A" ;;
AR="cc"
ARFLAGS="-A" ;;
SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
CFLAGS=${CFLAGS-"-O3"}
LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
Expand Down Expand Up @@ -598,7 +599,8 @@ sed < Makefile.in "
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
/^AR *=/s#=.*#=$AR_RC#
/^AR *=/s#=.*#=$AR#
/^ARFLAGS *=/s#=.*#=$ARFLAGS#
/^RANLIB *=/s#=.*#=$RANLIB#
/^LDCONFIG *=/s#=.*#=$LDCONFIG#
/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
Expand All @@ -624,7 +626,8 @@ sed < zlib.pc.in "
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
/^AR *=/s#=.*#=$AR_RC#
/^AR *=/s#=.*#=$AR#
/^ARFLAGS *=/s#=.*#=$ARFLAGS#
/^RANLIB *=/s#=.*#=$RANLIB#
/^EXE *=/s#=.*#=$EXE#
/^prefix *=/s#=.*#=$prefix#
Expand Down

0 comments on commit d169dd7

Please sign in to comment.