autoconf: allow a user to override ar

This is used on specific buildchains (nixos static builds for example).
This commit is contained in:
Arthur Gautier 2020-07-25 15:04:18 -07:00
parent e9055f5d7d
commit e6faac9b80
4 changed files with 7 additions and 5 deletions

View File

@ -185,6 +185,7 @@ ifeq ("@STATIC@", "yes")
LDFLAGS+=-static LDFLAGS+=-static
endif endif
AR:=@AR@
INSTALL:=@INSTALL@ INSTALL:=@INSTALL@
PREFIX:=@prefix@ PREFIX:=@prefix@
BINDIR:=$(DESTDIR)$(PREFIX)/sbin BINDIR:=$(DESTDIR)$(PREFIX)/sbin
@ -234,7 +235,7 @@ endif
lib/libpdata.a: $(OBJECTS) $(EMITTERS) lib/libpdata.a: $(OBJECTS) $(EMITTERS)
@echo " [AR] $<" @echo " [AR] $<"
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(V)ar -rv $@ $(OBJECTS) $(EMITTERS) > /dev/null 2>&1 $(V)$(AR) -rv $@ $(OBJECTS) $(EMITTERS) > /dev/null 2>&1
bin/pdata_tools: $(OBJECTS) $(EMITTERS) bin/pdata_tools: $(OBJECTS) $(EMITTERS)
@echo " [LD] $@" @echo " [LD] $@"

View File

@ -188,6 +188,7 @@ VERSION_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'`
VERSION_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'` VERSION_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
################################################################ ################################################################
AC_SUBST(AR)
AC_SUBST(CXXDEBUG_FLAG) AC_SUBST(CXXDEBUG_FLAG)
AC_SUBST(CXXOPTIMISE_FLAG) AC_SUBST(CXXOPTIMISE_FLAG)
AC_SUBST(CXX_STRERROR_FLAG) AC_SUBST(CXX_STRERROR_FLAG)

View File

@ -16,7 +16,7 @@ contrib/%.o: contrib/%.cc
contrib/%.a: contrib/%.o contrib/%.a: contrib/%.o
$(V)echo " [AR] $@" $(V)echo " [AR] $@"
$(V)ar rcs $@ $^ $(V)$(AR) rcs $@ $^
contrib/%.so: contrib/%.a contrib/%.so: contrib/%.a
$(V)echo " [LD] $@" $(V)echo " [LD] $@"

View File

@ -36,11 +36,11 @@ GMOCK_DEPS=\
lib/libgmock.a: $(GMOCK_DEPS) lib/libgmock.a: $(GMOCK_DEPS)
@echo " [CXX] gtest" @echo " [CXX] gtest"
@mkdir -p lib @mkdir -p lib
$(V)g++ $(GMOCK_INCLUDES) -I$(GMOCK_DIR)/googletest -std=c++11 -c $(GMOCK_DIR)/googletest/src/gtest-all.cc $(V) $(CXX) $(GMOCK_INCLUDES) -I$(GMOCK_DIR)/googletest -std=c++11 -c $(GMOCK_DIR)/googletest/src/gtest-all.cc
@echo " [CXX] gmock" @echo " [CXX] gmock"
$(V)g++ $(GMOCK_INCLUDES) -I$(GMOCK_DIR)/googlemock -std=c++11 -c $(GMOCK_DIR)/googlemock/src/gmock-all.cc $(V) $(CXX) $(GMOCK_INCLUDES) -I$(GMOCK_DIR)/googlemock -std=c++11 -c $(GMOCK_DIR)/googlemock/src/gmock-all.cc
@echo " [AR] $<" @echo " [AR] $<"
$(V)ar -rv lib/libgmock.a gtest-all.o gmock-all.o > /dev/null 2>&1 $(V)$(AR) -rv lib/libgmock.a gtest-all.o gmock-all.o > /dev/null 2>&1
TEST_SOURCE=\ TEST_SOURCE=\
unit-tests/gmock_main.cc \ unit-tests/gmock_main.cc \