]> git.pld-linux.org Git - packages/llvm.git/blob - llvm-2.6-destdir.patch
- fix some files
[packages/llvm.git] / llvm-2.6-destdir.patch
1 From 5a380ce5d1c8d5a1474764a7a54a1e2072fddb03 Mon Sep 17 00:00:00 2001
2 From: Erick Tryzelaar <idadesub@users.sourceforge.net>
3 Date: Fri, 21 Aug 2009 11:59:01 -0700
4 Subject: [PATCH] Rewrite makefiles to explicitly reference DESTDIR so we can not bake DESTDIR
5  into the O'Caml symlinks.
6 MIME-Version: 1.0
7 Content-Type: multipart/mixed; boundary="------------1.6.4"
8
9 This is a multi-part message in MIME format.
10 --------------1.6.4
11 Content-Type: text/plain; charset=UTF-8; format=fixed
12 Content-Transfer-Encoding: 8bit
13
14 ---
15  Makefile.config.in         |   16 +++++++-------
16  Makefile.rules             |   46 ++++++++++++++++++++++----------------------
17  docs/CommandGuide/Makefile |    6 ++--
18  docs/Makefile              |   24 +++++++++++-----------
19  docs/tutorial/Makefile     |    2 +-
20  lib/VMCore/Makefile        |    4 +-
21  tools/gccas/Makefile       |    4 +-
22  tools/gccld/Makefile       |    4 +-
23  tools/llvm-config/Makefile |    4 +-
24  9 files changed, 55 insertions(+), 55 deletions(-)
25
26
27 --------------1.6.4
28 Content-Type: text/x-patch; name="0001-Rewrite-makefiles-to-explicitly-reference-DESTDIR-so.patch"
29 Content-Transfer-Encoding: 8bit
30 Content-Disposition: attachment; filename="0001-Rewrite-makefiles-to-explicitly-reference-DESTDIR-so.patch"
31
32 diff --git Makefile.config.in Makefile.config.in
33 index ecd0595..73656f7 100644
34 --- Makefile.config.in
35 +++ Makefile.config.in
36 @@ -76,14 +76,14 @@ endif
37  
38  LLVMMAKE := $(LLVM_SRC_ROOT)/make
39  
40 -PROJ_bindir     := $(DESTDIR)$(PROJ_prefix)/bin
41 -PROJ_libdir     := $(DESTDIR)$(PROJ_prefix)/lib
42 -PROJ_datadir    := $(DESTDIR)$(PROJ_prefix)/share
43 -PROJ_docsdir    := $(DESTDIR)$(PROJ_prefix)/docs/llvm
44 -PROJ_etcdir     := $(DESTDIR)$(PROJ_prefix)/etc/llvm
45 -PROJ_includedir := $(DESTDIR)$(PROJ_prefix)/include
46 -PROJ_infodir    := $(DESTDIR)$(PROJ_prefix)/info
47 -PROJ_mandir     := $(DESTDIR)$(PROJ_prefix)/share/man
48 +PROJ_bindir     := $(PROJ_prefix)/bin
49 +PROJ_libdir     := $(PROJ_prefix)/lib
50 +PROJ_datadir    := $(PROJ_prefix)/share
51 +PROJ_docsdir    := $(PROJ_prefix)/docs/llvm
52 +PROJ_etcdir     := $(PROJ_prefix)/etc/llvm
53 +PROJ_includedir := $(PROJ_prefix)/include
54 +PROJ_infodir    := $(PROJ_prefix)/info
55 +PROJ_mandir     := $(PROJ_prefix)/share/man
56  
57  # Determine if we're on a unix type operating system
58  LLVM_ON_UNIX:=@LLVM_ON_UNIX@
59 diff --git Makefile.rules Makefile.rules
60 index 5556684..08965f3 100644
61 --- Makefile.rules
62 +++ Makefile.rules
63 @@ -720,7 +720,7 @@ ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
64  # in the file so they get built before dependencies
65  #---------------------------------------------------------
66  
67 -$(PROJ_bindir) $(PROJ_libdir) $(PROJ_includedir) $(PROJ_etcdir)::
68 +$(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
69         $(Verb) $(MKDIR) $@
70  
71  # To create other directories, as needed, and timestamp their creation
72 @@ -842,22 +842,22 @@ install-local::
73  uninstall-local::
74         $(Echo) UnInstall circumvented with NO_INSTALL
75  else
76 -install-local:: $(PROJ_etcdir) $(CONFIG_FILES)
77 -       $(Echo) Installing Configuration Files To $(PROJ_etcdir)
78 +install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
79 +       $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
80         $(Verb)for file in $(CONFIG_FILES); do \
81            if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
82 -            $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \
83 +            $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
84            elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
85 -            $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \
86 +            $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
87            else \
88              $(ECHO) Error: cannot find config file $${file}. ; \
89            fi \
90         done
91  
92  uninstall-local::
93 -       $(Echo) Uninstalling Configuration Files From $(PROJ_etcdir)
94 +       $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
95         $(Verb)for file in $(CONFIG_FILES); do \
96 -         $(RM) -f $(PROJ_etcdir)/$${file} ; \
97 +         $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
98         done
99  endif
100  
101 @@ -944,7 +944,7 @@ endif
102  ifdef BYTECODE_DESTINATION
103  ModuleDestDir := $(BYTECODE_DESTINATION)
104  else
105 -ModuleDestDir := $(PROJ_libdir)
106 +ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
107  endif
108  
109  ifdef NO_INSTALL
110 @@ -1023,17 +1023,17 @@ install-local::
111  uninstall-local::
112         $(Echo) Uninstall circumvented with NO_INSTALL
113  else
114 -DestSharedLib = $(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
115 +DestSharedLib = $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
116  
117  install-local:: $(DestSharedLib)
118  
119 -$(DestSharedLib): $(LibName.SO) $(PROJ_libdir)
120 +$(DestSharedLib): $(LibName.SO) $(DESTDIR)$(PROJ_libdir)
121         $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
122         $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
123  
124  uninstall-local::
125         $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
126 -       -$(Verb) $(RM) -f $(PROJ_libdir)/lib$(LIBRARYNAME).*
127 +       -$(Verb) $(RM) -f $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).*
128  endif
129  endif
130  
131 @@ -1078,7 +1078,7 @@ endif
132  ifdef BYTECODE_DESTINATION
133  BytecodeDestDir := $(BYTECODE_DESTINATION)
134  else
135 -BytecodeDestDir := $(PROJ_libdir)
136 +BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
137  endif
138  
139  DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
140 @@ -1141,13 +1141,13 @@ install-local::
141  uninstall-local::
142         $(Echo) Uninstall circumvented with NO_INSTALL
143  else
144 -DestArchiveLib := $(PROJ_libdir)/lib$(LIBRARYNAME).a
145 +DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
146  
147  install-local:: $(DestArchiveLib)
148  
149 -$(DestArchiveLib): $(LibName.A) $(PROJ_libdir)
150 +$(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
151         $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
152 -       $(Verb) $(MKDIR) $(PROJ_libdir)
153 +       $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
154         $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
155  
156  uninstall-local::
157 @@ -1225,11 +1225,11 @@ install-local::
158  uninstall-local::
159         $(Echo) Uninstall circumvented with NO_INSTALL
160  else
161 -DestTool = $(PROJ_bindir)/$(TOOLNAME)$(EXEEXT)
162 +DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLNAME)$(EXEEXT)
163  
164  install-local:: $(DestTool)
165  
166 -$(DestTool): $(ToolBuildPath) $(PROJ_bindir)
167 +$(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
168         $(Echo) Installing $(BuildMode) $(DestTool)
169         $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
170  
171 @@ -1824,25 +1824,25 @@ uninstall-local::
172  else
173  install-local::
174         $(Echo) Installing include files
175 -       $(Verb) $(MKDIR) $(PROJ_includedir)
176 +       $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
177         $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
178           cd $(PROJ_SRC_ROOT)/include && \
179           for  hdr in `find . -type f '!' '(' -name '*~' \
180               -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \
181               grep -v .svn` ; do \
182 -           instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
183 +           instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
184             if test \! -d "$$instdir" ; then \
185               $(EchoCmd) Making install directory $$instdir ; \
186               $(MKDIR) $$instdir ;\
187             fi ; \
188 -           $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
189 +           $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
190           done ; \
191         fi
192  ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
193         $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
194           cd $(PROJ_OBJ_ROOT)/include && \
195           for hdr in `find . -type f -print | grep -v CVS` ; do \
196 -           $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
197 +           $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
198           done ; \
199         fi
200  endif
201 @@ -1854,10 +1854,10 @@ uninstall-local::
202             $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
203               '!' '(' -name '*~' -o -name '.#*' \
204          -o -name '*.in' ')' -print ')' | \
205 -        grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \
206 +        grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
207           cd $(PROJ_SRC_ROOT)/include && \
208             $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
209 -      -print ')' | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \
210 +      -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
211         fi
212  endif
213  endif
214 diff --git docs/CommandGuide/Makefile docs/CommandGuide/Makefile
215 index cf77e6a..28835ac 100644
216 --- docs/CommandGuide/Makefile
217 +++ docs/CommandGuide/Makefile
218 @@ -71,9 +71,9 @@ EXTRA_DIST := $(POD) index.html
219  clean-local::
220         $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
221  
222 -HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
223 -MAN_DIR  := $(PROJ_mandir)/man1
224 -PS_DIR   := $(PROJ_docsdir)/ps
225 +HTML_DIR := $(DESTDIR)$(PROJ_docsdir)/html/CommandGuide
226 +MAN_DIR  := $(DESTDIR)$(PROJ_mandir)/man1
227 +PS_DIR   := $(DESTDIR)$(PROJ_docsdir)/ps
228  
229  install-local:: $(HTML) $(MAN) $(PS)
230         $(Echo) Installing HTML CommandGuide Documentation
231 diff --git docs/Makefile docs/Makefile
232 index 310c4bd..30cd8a7 100644
233 --- docs/Makefile
234 +++ docs/Makefile
235 @@ -48,11 +48,11 @@ generated:: doxygen ocamldoc
236  
237  install-html: $(PROJ_OBJ_DIR)/html.tar.gz
238         $(Echo) Installing HTML documentation
239 -       $(Verb) $(MKDIR) $(PROJ_docsdir)/html
240 -       $(Verb) $(MKDIR) $(PROJ_docsdir)/html/img
241 -       $(Verb) $(DataInstall) $(HTML) $(PROJ_docsdir)/html
242 -       $(Verb) $(DataInstall) $(IMAGES) $(PROJ_docsdir)/html/img
243 -       $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(PROJ_docsdir)
244 +       $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
245 +       $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
246 +       $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
247 +       $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
248 +       $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
249  
250  $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
251         $(Echo) Packaging HTML documentation
252 @@ -63,11 +63,11 @@ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
253  
254  install-doxygen: doxygen
255         $(Echo) Installing doxygen documentation
256 -       $(Verb) $(MKDIR) $(PROJ_docsdir)/html/doxygen
257 -       $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_docsdir)
258 +       $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
259 +       $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
260         $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
261           $(FIND) . -type f -exec \
262 -           $(DataInstall) {} $(PROJ_docsdir)/html/doxygen \;
263 +           $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
264  
265  doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
266  
267 @@ -94,11 +94,11 @@ $(LLVM_SRC_ROOT)/docs/userloc.html:
268  
269  install-ocamldoc: ocamldoc
270         $(Echo) Installing ocamldoc documentation
271 -       $(Verb) $(MKDIR) $(PROJ_docsdir)/ocamldoc/html
272 -       $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_docsdir)
273 +       $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
274 +       $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
275         $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
276           $(FIND) . -type f -exec \
277 -           $(DataInstall) {} $(PROJ_docsdir)/ocamldoc/html \;
278 +           $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
279  
280  ocamldoc: regen-ocamldoc $(PROJ_OBJ_DIR)/ocamldoc.tar.gz
281  
282 @@ -122,4 +122,4 @@ $(PROJ_OBJ_DIR)/ocamldoc.tar.gz:
283  
284  uninstall-local::
285         $(Echo) Uninstalling Documentation
286 -       $(Verb) $(RM) -rf $(PROJ_docsdir)
287 +       $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)
288 diff --git docs/tutorial/Makefile docs/tutorial/Makefile
289 index 6169bb8..9082ad4 100644
290 --- docs/tutorial/Makefile
291 +++ docs/tutorial/Makefile
292 @@ -12,7 +12,7 @@ include $(LEVEL)/Makefile.common
293  
294  HTML       := $(wildcard $(PROJ_SRC_DIR)/*.html)
295  EXTRA_DIST := $(HTML) index.html
296 -HTML_DIR   := $(PROJ_docsdir)/html/tutorial
297 +HTML_DIR   := $(DESTDIR)$(PROJ_docsdir)/html/tutorial
298  
299  install-local:: $(HTML)
300         $(Echo) Installing HTML Tutorial Documentation
301 diff --git lib/VMCore/Makefile lib/VMCore/Makefile
302 index e9d3dc8..c4817a5 100644
303 --- lib/VMCore/Makefile
304 +++ lib/VMCore/Makefile
305 @@ -29,5 +29,5 @@ $(GENFILE): $(ObjDir)/Intrinsics.gen.tmp
306             changed significantly. )
307  
308  install-local:: $(GENFILE)
309 -       $(Echo) Installing $(PROJ_includedir)/llvm/Intrinsics.gen
310 -       $(Verb) $(DataInstall) $(GENFILE) $(PROJ_includedir)/llvm/Intrinsics.gen
311 +       $(Echo) Installing $(DESTDIR)$(PROJ_includedir)/llvm/Intrinsics.gen
312 +       $(Verb) $(DataInstall) $(GENFILE) $(DESTDIR)$(PROJ_includedir)/llvm/Intrinsics.gen
313 diff --git tools/gccas/Makefile tools/gccas/Makefile
314 index ff84d96..594f9e4 100644
315 --- tools/gccas/Makefile
316 +++ tools/gccas/Makefile
317 @@ -10,9 +10,9 @@ LEVEL = ../..
318  
319  include $(LEVEL)/Makefile.common
320  
321 -install-local:: $(PROJ_bindir)/gccas
322 +install-local:: $(DESTDIR)$(PROJ_bindir)/gccas
323         
324 -$(PROJ_bindir)/gccas : gccas.sh Makefile
325 +$(DESTDIR)$(PROJ_bindir)/gccas : gccas.sh Makefile
326         $(Echo) Installing gccas shell script.
327         $(Verb) sed "s#@TOOLDIR@#$(PROJ_bindir)#" $< > $@
328         $(Verb) chmod 0755 $@
329 diff --git tools/gccld/Makefile tools/gccld/Makefile
330 index b2d3f73..8ec0307 100644
331 --- tools/gccld/Makefile
332 +++ tools/gccld/Makefile
333 @@ -11,9 +11,9 @@ LEVEL = ../..
334  
335  include $(LEVEL)/Makefile.common
336  
337 -install-local:: $(PROJ_bindir)/gccld
338 +install-local:: $(DESTDIR)$(PROJ_bindir)/gccld
339         
340 -$(PROJ_bindir)/gccld : gccld.sh Makefile
341 +$(DESTDIR)$(PROJ_bindir)/gccld : gccld.sh Makefile
342         $(Echo) Installing gccld shell script.
343         $(Verb) sed "s#@TOOLDIR@#$(PROJ_bindir)#" $< > $@
344         $(Verb) chmod 0755 $@
345 diff --git tools/llvm-config/Makefile tools/llvm-config/Makefile
346 index 6eedca0..8659681 100644
347 --- tools/llvm-config/Makefile
348 +++ tools/llvm-config/Makefile
349 @@ -87,6 +87,6 @@ clean-local::
350           $(LibDeps) GenLibDeps.out
351  install-local:: all-local
352         $(Echo) Installing llvm-config
353 -       $(Verb) $(MKDIR) $(PROJ_bindir)
354 -       $(Verb) $(ScriptInstall) $(ToolDir)/llvm-config $(PROJ_bindir)
355 +       $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_bindir)
356 +       $(Verb) $(ScriptInstall) $(ToolDir)/llvm-config $(DESTDIR)$(PROJ_bindir)
357  
358
359 --------------1.6.4--
360
361
This page took 0.166601 seconds and 3 git commands to generate.