summaryrefslogtreecommitdiff
blob: ba62e85fdf679b804b565183ffbaf5e992a78a96 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
diff -ur mercury-compiler-10.04.1.orig/compiler/file_util.m mercury-compiler-10.04.1/compiler/file_util.m
--- mercury-compiler-10.04.1.orig/compiler/file_util.m	2009-10-14 18:28:32.000000000 +1300
+++ mercury-compiler-10.04.1/compiler/file_util.m	2010-09-05 15:35:56.000000000 +1200
@@ -261,7 +261,7 @@
     ( InstallNamePath0 = "" ->
         globals.lookup_string_option(Globals, install_prefix, InstallPrefix),
         grade_directory_component(Globals, GradeDir),
-        InstallNamePath = InstallPrefix / "lib" / "mercury" / "lib" / GradeDir
+        InstallNamePath = InstallPrefix / "@libdir@" / "mercury" / "lib" / GradeDir
     ;
         InstallNamePath = InstallNamePath0
     ),
diff -ur mercury-compiler-10.04.1.orig/compiler/libs.file_util.c mercury-compiler-10.04.1/compiler/libs.file_util.c
--- mercury-compiler-10.04.1.orig/compiler/libs.file_util.c	2010-08-30 04:35:03.000000000 +1200
+++ mercury-compiler-10.04.1/compiler/libs.file_util.c	2010-09-05 11:29:44.000000000 +1200
@@ -856,7 +856,7 @@
 	MR_tempr1 = MR_sv(1);
 	MR_sv(1) = MR_r1;
 	MR_r1 = MR_tempr1;
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	}
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		libs__file_util__get_install_name_option_3_0_i8);
diff -ur mercury-compiler-10.04.1.orig/compiler/make.program_target.c mercury-compiler-10.04.1/compiler/make.program_target.c
--- mercury-compiler-10.04.1.orig/compiler/make.program_target.c	2010-08-30 04:37:52.000000000 +1200
+++ mercury-compiler-10.04.1/compiler/make.program_target.c	2010-09-05 08:58:59.000000000 +1200
@@ -5422,7 +5422,7 @@
 		make__program_target__install_grade_init_6_0_i2);
 MR_def_label(make__program_target__install_grade_init_6_0,2)
 	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__install_grade_init_6_0_i3);
 MR_def_label(make__program_target__install_grade_init_6_0,3)
@@ -5873,7 +5873,7 @@
 		make__program_target__make_grade_install_dirs_6_0_i2);
 MR_def_label(make__program_target__make_grade_install_dirs_6_0,2)
 	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__make_grade_install_dirs_6_0_i3);
 MR_def_label(make__program_target__make_grade_install_dirs_6_0,3)
@@ -6318,7 +6318,7 @@
 		MR_GOTO_LAB(make__program_target__install_library_grade_files_10_0_i11);
 	}
 	MR_r1 = MR_sv(10);
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__install_library_grade_files_10_0_i14);
 MR_def_label(make__program_target__install_library_grade_files_10_0,14)
@@ -6382,7 +6382,7 @@
 		MR_GOTO_LAB(make__program_target__install_library_grade_files_10_0_i20);
 	}
 	MR_r1 = MR_sv(10);
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__install_library_grade_files_10_0_i23);
 MR_def_label(make__program_target__install_library_grade_files_10_0,23)
@@ -6448,7 +6448,7 @@
 MR_def_label(make__program_target__install_library_grade_files_10_0,20)
 	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
 	MR_r1 = MR_sv(10);
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__install_library_grade_files_10_0_i30);
 MR_def_label(make__program_target__install_library_grade_files_10_0,30)
@@ -6585,7 +6585,7 @@
 		make__program_target__make_install_dirs_5_0_i2);
 MR_def_label(make__program_target__make_install_dirs_5_0,2)
 	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__make_install_dirs_5_0_i3);
 MR_def_label(make__program_target__make_install_dirs_5_0,3)
@@ -6806,7 +6806,7 @@
 		make__program_target__install_library_7_0_i11);
 MR_def_label(make__program_target__install_library_7_0,11)
 	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__install_library_7_0_i12);
 MR_def_label(make__program_target__install_library_7_0,12)
@@ -10596,7 +10596,7 @@
 		make__program_target__install_ints_and_headers_8_0_i13);
 MR_def_label(make__program_target__install_ints_and_headers_8_0,13)
 	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__install_ints_and_headers_8_0_i14);
 MR_def_label(make__program_target__install_ints_and_headers_8_0,14)
@@ -11222,7 +11222,7 @@
 		make__program_target__install_grade_ints_and_headers_9_0_i5);
 MR_def_label(make__program_target__install_grade_ints_and_headers_9_0,5)
 	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
-	MR_r2 = (MR_Word) MR_string_const("lib", 3);
+	MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
 	MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
 		make__program_target__install_grade_ints_and_headers_9_0_i6);
 MR_def_label(make__program_target__install_grade_ints_and_headers_9_0,6)
diff -ur mercury-compiler-10.04.1.orig/compiler/make.program_target.m mercury-compiler-10.04.1/compiler/make.program_target.m
--- mercury-compiler-10.04.1.orig/compiler/make.program_target.m	2010-05-20 21:29:30.000000000 +1200
+++ mercury-compiler-10.04.1/compiler/make.program_target.m	2010-09-05 15:35:08.000000000 +1200
@@ -1370,7 +1370,7 @@
         ),
 
         globals.lookup_string_option(Globals, install_prefix, Prefix),
-        LibDir = Prefix/"lib"/"mercury",
+        LibDir = Prefix/"@libdir@"/"mercury",
         list.map_foldl(
             install_subdir_file(Globals, SubdirLinkSucceeded, LibDir/"ints",
                 ModuleName),
@@ -1424,7 +1424,7 @@
     globals.lookup_accumulating_option(Globals, extra_library_header,
         ExtraHdrs),
     globals.lookup_string_option(Globals, install_prefix, Prefix),
-    IncDir = Prefix / "lib" / "mercury" / "inc",
+    IncDir = Prefix / "@libdir@" / "mercury" / "inc",
     list.foldl2(install_extra_header(Globals, IncDir), ExtraHdrs,
         yes, ExtraHdrsSucceeded, !IO).
 
@@ -1572,19 +1572,19 @@
         globals.lookup_string_option(Globals, install_prefix, Prefix),
 
         ( string.prefix(GradeDir, "java") ->
-            GradeLibDir = Prefix/"lib"/"mercury"/"lib"/GradeDir,
+            GradeLibDir = Prefix/"@libdir@"/"mercury"/"lib"/GradeDir,
             install_file(Globals, JarFileName, GradeLibDir, LibsSucceeded,
                 !IO),
             InitSucceeded = yes
         ; string.prefix(GradeDir, "erlang") ->
-            GradeLibDir = Prefix/"lib"/"mercury"/"lib"/GradeDir,
+            GradeLibDir = Prefix/"@libdir@"/"mercury"/"lib"/GradeDir,
             % Our "Erlang archives" are actually directories.
             install_directory(Globals, ErlangArchiveFileName, GradeLibDir,
                 LibsSucceeded, !IO),
             install_grade_init(Globals, GradeDir, ModuleName, InitSucceeded,
                 !IO)
         ;
-            GradeLibDir = Prefix/"lib"/"mercury"/"lib"/GradeDir,
+            GradeLibDir = Prefix/"@libdir@"/"mercury"/"lib"/GradeDir,
             maybe_install_library_file(Globals, "static", LibFileName,
                 GradeLibDir, LibSuccess, !IO),
             ( LibFileName = SharedLibFileName ->
@@ -1615,7 +1615,7 @@
 
 install_grade_init(Globals, GradeDir, ModuleName, Succeeded, !IO) :-
     globals.lookup_string_option(Globals, install_prefix, Prefix),
-    GradeModulesDir = Prefix / "lib" / "mercury" / "modules" / GradeDir,
+    GradeModulesDir = Prefix / "@libdir@" / "mercury" / "modules" / GradeDir,
     module_name_to_file_name(Globals, ModuleName, ".init", do_not_create_dirs,
         InitFileName, !IO),
     install_file(Globals, InitFileName, GradeModulesDir, Succeeded, !IO).
@@ -1632,7 +1632,7 @@
     (
         MaybeImports = yes(Imports),
         globals.lookup_string_option(Globals, install_prefix, Prefix),
-        LibDir = Prefix/"lib"/"mercury",
+        LibDir = Prefix/"@libdir@"/"mercury",
 
         globals.get_target(Globals, Target),
         globals.lookup_bool_option(Globals, highlevel_code, HighLevelCode),
@@ -1784,7 +1784,7 @@
 
 make_install_dirs(Globals, Result, LinkResult, !IO) :-
     globals.lookup_string_option(Globals, install_prefix, Prefix),
-    LibDir = Prefix/"lib"/"mercury",
+    LibDir = Prefix/"@libdir@"/"mercury",
     make_directory(LibDir/"inc", Result1, !IO),
     make_directory(LibDir/"modules", Result2, !IO),
 
@@ -1815,7 +1815,7 @@
 
 make_grade_install_dirs(Globals, Grade, Result, LinkResult, !IO) :-
     globals.lookup_string_option(Globals, install_prefix, Prefix),
-    LibDir = Prefix/"lib"/"mercury",
+    LibDir = Prefix/"@libdir@"/"mercury",
 
     GradeIntsSubdir = LibDir/"ints"/Grade/"Mercury",
     make_directory(GradeIntsSubdir, Result1, !IO),
diff -ur mercury-compiler-10.04.1.orig/library/Mmakefile mercury-compiler-10.04.1/library/Mmakefile
--- mercury-compiler-10.04.1.orig/library/Mmakefile	2010-09-05 11:44:16.000000000 +1200
+++ mercury-compiler-10.04.1/library/Mmakefile	2010-09-05 09:02:39.000000000 +1200
@@ -268,8 +268,8 @@
 	[ -d jmercury/runtime ] || cp -r ../java/runtime jmercury
 
 install_mer_rt: $(RT_LIB_NAME).jar
-	mkdir -p $(INSTALL_PREFIX)/lib/mercury/lib/$(GRADE)
-	cp $(RT_LIB_NAME).jar $(INSTALL_PREFIX)/lib/mercury/lib/$(GRADE)
+	mkdir -p $(INSTALL_LIBDIR)/lib/$(GRADE)
+	cp $(RT_LIB_NAME).jar $(INSTALL_LIBDIR)/lib/$(GRADE)
 
 else
 
diff -ur mercury-compiler-10.04.1.orig/scripts/Mmake.vars.in mercury-compiler-10.04.1/scripts/Mmake.vars.in
--- mercury-compiler-10.04.1.orig/scripts/Mmake.vars.in	2010-05-20 21:29:31.000000000 +1200
+++ mercury-compiler-10.04.1/scripts/Mmake.vars.in	2010-09-05 08:59:58.000000000 +1200
@@ -688,17 +688,17 @@
 INSTALL_PREFIX		= @prefix@
 FINAL_INSTALL_PREFIX	= @prefix@
 INSTALL_BINDIR		= $(INSTALL_PREFIX)/bin
-INSTALL_LIBDIR		= $(INSTALL_PREFIX)/lib/mercury
-FINAL_INSTALL_LIBDIR	= $(FINAL_INSTALL_PREFIX)/lib/mercury
+INSTALL_LIBDIR		= $(INSTALL_PREFIX)/@libdir@/mercury
+FINAL_INSTALL_LIBDIR	= $(FINAL_INSTALL_PREFIX)/@libdir@/mercury
 INSTALL_INFO_DIR	= $(INSTALL_PREFIX)/info
-INSTALL_DVI_DIR		= $(INSTALL_PREFIX)/lib/mercury/doc
-INSTALL_TEXT_DIR	= $(INSTALL_PREFIX)/lib/mercury/doc
-INSTALL_PS_DIR		= $(INSTALL_PREFIX)/lib/mercury/doc
-INSTALL_PDF_DIR		= $(INSTALL_PREFIX)/lib/mercury/doc
+INSTALL_DVI_DIR		= $(INSTALL_PREFIX)/@libdir@/mercury/doc
+INSTALL_TEXT_DIR	= $(INSTALL_PREFIX)/@libdir@/mercury/doc
+INSTALL_PS_DIR		= $(INSTALL_PREFIX)/@libdir@/mercury/doc
+INSTALL_PDF_DIR		= $(INSTALL_PREFIX)/@libdir@/mercury/doc
 INSTALL_MAN_DIR		= $(INSTALL_PREFIX)/man
-INSTALL_HTML_DIR	= $(INSTALL_PREFIX)/lib/mercury/html
-INSTALL_MDB_DOC_DIR	= $(INSTALL_PREFIX)/lib/mercury/mdb
-INSTALL_ELISP_DIR	= $(INSTALL_PREFIX)/lib/mercury/elisp
+INSTALL_HTML_DIR	= $(INSTALL_PREFIX)/@libdir@/mercury/html
+INSTALL_MDB_DOC_DIR	= $(INSTALL_PREFIX)/@libdir@/mercury/mdb
+INSTALL_ELISP_DIR	= $(INSTALL_PREFIX)/@libdir@/mercury/elisp
 INSTALL_CGI_DIR		= @CGIDIR@
 
 # You should not need to override anything below here