summaryrefslogtreecommitdiff
path: root/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch
blob: cd3c042f26390f95e435913eb4b7d1114acfde1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
commit 28b553622bd0f168411d86ddcfba1adab0d87b92
Author: Yawar Amin <yawar.amin@gmail.com>
Date:   Mon Nov 15 22:40:43 2021 -0500

    Fix ranlib error
    
    - Always pass ranlib one file argument at a time to avoid error 'Exactly
      one archive should be specified'
    - Call ranlib without cd'ing into the library's directory
    - Use Makefile functionality to simplify recipes

diff --git a/Makefile b/Makefile
index c2522c775..2e4e44faa 100644
--- a/Makefile
+++ b/Makefile
@@ -549,6 +549,8 @@ else
 endif
 	$(MAKE) -C tools installopt
 
+LIBRARIES = $(addsuffix .$(A), ocamlcommon ocamlbytecomp ocamloptcomp)
+
 .PHONY: installoptopt
 installoptopt:
 	$(INSTALL_PROG) ocamlc.opt$(EXE) "$(INSTALL_BINDIR)"
@@ -585,8 +587,11 @@ endif
 ifeq "$(INSTALL_OCAMLNAT)" "true"
 	  $(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)"
 endif
-	cd "$(INSTALL_COMPLIBDIR)" && \
-	   $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A)
+# Some versions of ranlib do not support multiple archives
+	for library in $(LIBRARIES); \
+	do \
+	  $(RANLIB) "$(INSTALL_COMPLIBDIR)/$$library"; \
+	done
 
 # Installation of the *.ml sources of compiler-libs
 .PHONY: install-compiler-sources
diff --git a/otherlibs/Makefile.otherlibs.common b/otherlibs/Makefile.otherlibs.common
index 95ff4d58f..6a4451e47 100644
--- a/otherlibs/Makefile.otherlibs.common
+++ b/otherlibs/Makefile.otherlibs.common
@@ -95,7 +95,7 @@ install::
 	fi
 ifneq "$(STUBSLIB)" ""
 	$(INSTALL_DATA) $(STUBSLIB) "$(INSTALL_LIBDIR)/"
-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) lib$(CLIBNAME).$(A)
+	$(RANLIB) "$(INSTALL_LIBDIR)/lib$(CLIBNAME).$(A)"
 endif
 
 	$(INSTALL_DATA) \
@@ -104,7 +104,7 @@ endif
 ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
 	$(INSTALL_DATA) \
 	  $(CMIFILES:.cmi=.mli) \
-          $(CMIFILES:.cmi=.cmti) \
+	        $(CMIFILES:.cmi=.cmti) \
 	  "$(INSTALL_LIBDIR)/"
 endif
 	if test -n "$(HEADERS)"; then \
@@ -115,7 +115,7 @@ installopt:
 	$(INSTALL_DATA) \
 	   $(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) \
 	   "$(INSTALL_LIBDIR)/"
-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) $(LIBNAME).a
+	$(RANLIB) "$(INSTALL_LIBDIR)/$(LIBNAME).$(A)"
 	if test -f $(LIBNAME).cmxs; then \
 	  $(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR)"; \
 	fi
diff --git a/otherlibs/dynlink/Makefile b/otherlibs/dynlink/Makefile
index 6b02dc197..dccc45103 100644
--- a/otherlibs/dynlink/Makefile
+++ b/otherlibs/dynlink/Makefile
@@ -249,12 +249,12 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
 endif
 
 installopt:
-	if $(NATDYNLINK); then \
-	  $(INSTALL_DATA) \
-	    $(NATOBJS) dynlink.cmxa dynlink.$(A) \
-	    "$(INSTALL_LIBDIR)" && \
-	  cd "$(INSTALL_LIBDIR)" && $(RANLIB) dynlink.$(A); \
-	fi
+ifeq "$(NATDYNLINK)" "true"
+	$(INSTALL_DATA) \
+	  $(NATOBJS) dynlink.cmxa dynlink.$(A) \
+	  "$(INSTALL_LIBDIR)"
+	$(RANLIB) "$(INSTALL_LIBDIR)/dynlink.$(A)"
+endif
 
 partialclean:
 	rm -f $(extract_crc) *.cm[ioaxt] *.cmti *.cmxa \
diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile
index 8fc1bdb92..379c530fa 100644
--- a/otherlibs/systhreads/Makefile
+++ b/otherlibs/systhreads/Makefile
@@ -121,7 +121,7 @@ install:
 	  $(INSTALL_PROG) dllthreads$(EXT_DLL) "$(INSTALL_STUBLIBDIR)"; \
 	fi
 	$(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)"
-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A)
+	$(RANLIB) "$(INSTALL_LIBDIR)/libthreads.$(A)"
 	mkdir -p "$(INSTALL_THREADSLIBDIR)"
 	$(INSTALL_DATA) \
 	  $(CMIFILES) threads.cma \
@@ -136,11 +136,11 @@ endif
 
 installopt:
 	$(INSTALL_DATA) libthreadsnat.$(A) "$(INSTALL_LIBDIR)"
-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreadsnat.$(A)
+	$(RANLIB) "$(INSTALL_LIBDIR)/libthreadsnat.$(A)"
 	$(INSTALL_DATA) \
 	  $(THREADS_NCOBJS) threads.cmxa threads.$(A) \
 	  "$(INSTALL_THREADSLIBDIR)"
-	cd "$(INSTALL_THREADSLIBDIR)" && $(RANLIB) threads.$(A)
+	$(RANLIB) "$(INSTALL_THREADSLIBDIR)/threads.$(A)"
 
 %.cmi: %.mli
 	$(CAMLC) -c $(COMPFLAGS) $<
diff --git a/stdlib/Makefile b/stdlib/Makefile
index df34bc2d4..32c5dab56 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -105,7 +105,7 @@ installopt-default::
 	$(INSTALL_DATA) \
 	  stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx \
 	  "$(INSTALL_LIBDIR)"
-	cd "$(INSTALL_LIBDIR)"; $(RANLIB) stdlib.$(A)
+	$(RANLIB) "$(INSTALL_LIBDIR)/stdlib.$(A)"
 
 ifeq "$(UNIX_OR_WIN32)" "unix"
 HEADERPROGRAM = header