From 36261646607eda5c49bc1b09c23011d0a710574b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Tue, 4 Nov 1997 23:55:24 +0100
Subject: [PATCH] Added support for AR.

Rev: src/modules/Image/Makefile.in:1.8
Rev: src/modules/Image/encodings/Makefile.in:1.6
Rev: src/modules/Makefile.in:1.13
Rev: src/modules/_Crypto/lib/Makefile.in:1.13
Rev: src/modules/dynamic_module_makefile.in:1.23
Rev: src/modules/static_module_makefile.in:1.18
---
 .gitattributes                          |  2 ++
 src/modules/Image/Makefile.in           |  4 ++--
 src/modules/Image/encodings/Makefile.in |  5 +++--
 src/modules/Makefile.in                 |  4 +++-
 src/modules/_Crypto/lib/Makefile.in     |  5 +++--
 src/modules/dynamic_module_makefile.in  |  9 +++++++--
 src/modules/static_module_makefile.in   | 11 ++++++++---
 7 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/.gitattributes b/.gitattributes
index 3f1caa5125..9aaa7808af 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -156,6 +156,7 @@ testfont binary
 /src/modules/_Crypto/test_crypto.pike foreign_ident
 /src/modules/call_out/call_out.c foreign_ident
 /src/modules/call_out/test_co.pike foreign_ident
+/src/modules/dynamic_module_makefile.in foreign_ident
 /src/modules/files/acconfig.h foreign_ident
 /src/modules/files/file.c foreign_ident
 /src/modules/files/socktest.pike foreign_ident
@@ -163,6 +164,7 @@ testfont binary
 /src/modules/spider/accesseddb.h foreign_ident
 /src/modules/spider/dumudp.c foreign_ident
 /src/modules/sprintf/sprintf.c foreign_ident
+/src/modules/static_module_makefile.in foreign_ident
 /src/modules/system/acconfig.h foreign_ident
 /src/modules/system/passwords.c foreign_ident
 /src/modules/system/syslog.c foreign_ident
diff --git a/src/modules/Image/Makefile.in b/src/modules/Image/Makefile.in
index 8e1971c8ad..3df582cef1 100644
--- a/src/modules/Image/Makefile.in
+++ b/src/modules/Image/Makefile.in
@@ -12,10 +12,10 @@ MODULE_LDFLAGS=@LDFLAGS@
 @dynamic_module_makefile@
 
 pike: all
-	cd ../..; $(MAKE)
+	cd ../..; $(MAKE) "AR=$(AR)"
 
 pure: all
-	cd ../..; $(MAKE) pure
+	cd ../..; $(MAKE) "AR=$(AR)" pure
 
 
 @dependencies@
diff --git a/src/modules/Image/encodings/Makefile.in b/src/modules/Image/encodings/Makefile.in
index 8e435d6b7d..accd11f8d4 100644
--- a/src/modules/Image/encodings/Makefile.in
+++ b/src/modules/Image/encodings/Makefile.in
@@ -8,6 +8,7 @@ OBJS=gif.a pnm.a
 
 CC=@CC@
 CPP=@CPP@
+AR=ar
 
 PREFLAGS=-I. -I$(SRCDIR) -I$(SRCDIR)/../../.. -I$(SRCDIR)/.. -I../../.. -I.. -I. $(MODULE_CPPFLAGS) $(DEFINES) 
 CFLAGS=$(PREFLAGS) $(OTHERFLAGS) $(MODULE_CFLAGS) #@CCSHARED@ 
@@ -16,11 +17,11 @@ all: $(OBJS)
 
 gif.a : $(GIF_OBJS)
 	rm -f gif.a
-	ar cq gif.a $(GIF_OBJS)
+	$(AR) cq gif.a $(GIF_OBJS)
 
 pnm.a : $(PNM_OBJS)
 	rm -f pnm.a
-	ar cq pnm.a $(PNM_OBJS)
+	$(AR) cq pnm.a $(PNM_OBJS)
 
 depend:
 	gcc -MM $(PREFLAGS) $(SRCDIR)/*.c | $(TMP_BINDIR)/fixdepends.sh $(SRCDIR)
diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in
index 3085c46fe4..192ad293b6 100644
--- a/src/modules/Makefile.in
+++ b/src/modules/Makefile.in
@@ -3,11 +3,13 @@
 CC=@CC@
 CPP=@CPP@
 
+AR=@AR@
+
 MODULES=@subdirs@
 MODULE_SEGMENTS=@MODULE_SEGMENTS@
 MODULE_LINKOPTS=@MODULE_LINKOPTS@
 
-MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "OTHERFLAGS=$(OTHERFLAGS)" "TMP_BINDIR=$(TMP_BINDIR)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "DEFINES=$(DEFINES)" "INSTALL=$(INSTALL)"
+MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "OTHERFLAGS=$(OTHERFLAGS)" "TMP_BINDIR=$(TMP_BINDIR)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "DEFINES=$(DEFINES)" "INSTALL=$(INSTALL)" "AR=$(AR)"
 
 all: modules
 
diff --git a/src/modules/_Crypto/lib/Makefile.in b/src/modules/_Crypto/lib/Makefile.in
index 07a1a693b0..f3750edd95 100644
--- a/src/modules/_Crypto/lib/Makefile.in
+++ b/src/modules/_Crypto/lib/Makefile.in
@@ -3,6 +3,7 @@
 CC=@CC@
 CPP=@CPP@
 RANLIB=@RANLIB@
+AR=ar
 
 # Reset VPATH
 SRCDIR=@srcdir@
@@ -65,7 +66,7 @@ clean:
 depend:
 
 desCore.a:	$O
-		ar cru $@ $O
+		$(AR) cru $@ $O
 		$(RANLIB) $@
 
 desdata.o:	desinfo.h $(SRCDIR)/../include/des.h
@@ -140,5 +141,5 @@ OBJS = idea.o sha.o md5.o rc4.o cast.o $(O)
 
 algorithms.a: $(OBJS)
 	rm -f algorithms.a
-	ar cq algorithms.a $(OBJS)
+	$(AR) cq algorithms.a $(OBJS)
 	$(RANLIB) algorithms.a
diff --git a/src/modules/dynamic_module_makefile.in b/src/modules/dynamic_module_makefile.in
index bdae3214cd..691c84edb8 100644
--- a/src/modules/dynamic_module_makefile.in
+++ b/src/modules/dynamic_module_makefile.in
@@ -1,16 +1,21 @@
+#
+# $Id: dynamic_module_makefile.in,v 1.23 1997/11/04 22:46:27 grubba Exp $
+#
+
 
 CC=@CC@
 CPP=@CPP@
+AR=@AR@
 
 PREFLAGS=-I. -I$(SRCDIR) -I$(SRCDIR)/../.. -I../.. -I. $(MODULE_CPPFLAGS) $(DEFINES) 
 CFLAGS=$(PREFLAGS) $(OTHERFLAGS) @CCSHARED@ $(MODULE_CFLAGS)
 
-MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "OTHERFLAGS=$(OTHERFLAGS) @CCSHARED@" "TMP_BINDIR=$(TMP_BINDIR)" "DEFINES=$(DEFINES)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "INSTALL=$(INSTALL)" $(MODULE_MAKE_FLAGS)
+MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "OTHERFLAGS=$(OTHERFLAGS) @CCSHARED@" "TMP_BINDIR=$(TMP_BINDIR)" "DEFINES=$(DEFINES)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "INSTALL=$(INSTALL)" "AR=$(AR)" $(MODULE_MAKE_FLAGS)
 
 all: subdirs dummy
 
 subdirs:
-	for a in '' $(MODULE_SUBDIRS) ; do if test ! -z "$$a"; then echo making $$a ; ( cd $$a ; $(MAKE) $(MAKE_FLAGS) ) ; fi ; done
+	for a in '' $(MODULE_SUBDIRS) ; do if test ! -z "$$a"; then echo making $$a ; ( cd $$a && $(MAKE) $(MAKE_FLAGS) ) || exit $$? ; fi ; done
 
 dummy:	$(DUMMY) linker_options modlist_headers modlist_segment module.so
 	tmp="$(INSTALL_NAME)" ; \
diff --git a/src/modules/static_module_makefile.in b/src/modules/static_module_makefile.in
index 2b4139bf0f..c715916e5d 100644
--- a/src/modules/static_module_makefile.in
+++ b/src/modules/static_module_makefile.in
@@ -1,16 +1,21 @@
+#
+# $Id: static_module_makefile.in,v 1.18 1997/11/04 22:46:28 grubba Exp $
+#
+
 
 CC=@CC@
 CPP=@CPP@
+AR=@AR@
 
 PREFLAGS=-I. -I$(SRCDIR) -I$(SRCDIR)/../.. -I../.. -I. -Dpike_module_init=pike_module_$(MODNAME)_init -Dpike_module_exit=pike_module_$(MODNAME)_exit $(MODULE_CPPFLAGS) $(DEFINES) 
 CFLAGS=$(PREFLAGS) $(OTHERFLAGS) $(MODULE_CFLAGS)
 
-MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "OTHERFLAGS=$(OTHERFLAGS)" "TMP_BINDIR=$(TMP_BINDIR)" "DEFINES=$(DEFINES)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "INSTALL=$(INSTALL)" $(MODULE_MAKE_FLAGS)
+MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "OTHERFLAGS=$(OTHERFLAGS)" "TMP_BINDIR=$(TMP_BINDIR)" "DEFINES=$(DEFINES)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "INSTALL=$(INSTALL)" "AR=$(AR)" $(MODULE_MAKE_FLAGS)
 
 all: subdirs dummy
 
 subdirs:
-	for a in '' $(MODULE_SUBDIRS) ; do if test ! -z "$$a"; then echo making $$a ; ( cd $$a ; $(MAKE) $(MAKE_FLAGS) ) ; fi ; done
+	for a in '' $(MODULE_SUBDIRS) ; do if test ! -z "$$a"; then echo making $$a ; ( cd $$a && $(MAKE) $(MAKE_FLAGS) ) || exit $$? ; fi ; done
 
 dummy:	linker_options modlist_headers modlist_segment module.pmod module.a
 	tmp="$(INSTALL_NAME)" ;\
@@ -41,7 +46,7 @@ module.pmod: Makefile
 
 module.a: $(OBJS)
 	-rm -f module.a
-	ar cq module.a $(OBJS)
+	$(AR) cq module.a $(OBJS)
 	-@RANLIB@ module.a
 	if test -f linker_options ; then touch linker_options ; fi
 
-- 
GitLab