]>
Commit | Line | Data |
---|---|---|
5db7ecb7 | 1 | # Configuration script |
1e490350 | 2 | # Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. |
5db7ecb7 | 3 | |
a2e72689 SS |
4 | # This program is free software; you can redistribute it and/or modify |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
17 | ||
18 | ### WARNING | |
1e490350 | 19 | ### This script must NOT use any 8-bit chars! |
a2e72689 SS |
20 | ### WARNING |
21 | ||
22 | # This is an MPW Shell script that sets everything up for compilation, | |
23 | # mainly creating directories, and editing copies of files. | |
5db7ecb7 SS |
24 | |
25 | Set savedir "`Directory`" | |
26 | ||
27 | #Set Echo 1 | |
28 | ||
aa8f28af | 29 | Set ThisScript "{0}" |
5db7ecb7 SS |
30 | |
31 | Set srcroot "--------" | |
32 | ||
33 | Set srcdir ":" | |
34 | ||
35 | Set objdir ":" | |
36 | ||
4ac27a60 SS |
37 | Set prefix "{MPW}":GNUTools: |
38 | ||
39 | Set exec_prefix "" | |
aa8f28af | 40 | |
1e490350 JL |
41 | Set bindir "" |
42 | ||
a2e72689 SS |
43 | Set host_alias "m68k-apple-mpw" |
44 | ||
45 | Set target_alias {host_alias} | |
5db7ecb7 | 46 | |
a2e72689 | 47 | Set host_cc "mpwc" |
5db7ecb7 | 48 | |
4ac27a60 | 49 | Set with_gnu_ld 0 |
aa8f28af | 50 | |
1e490350 JL |
51 | Set helpoutput 0 |
52 | ||
53 | Set recurse 1 | |
54 | ||
5db7ecb7 SS |
55 | Set verify 0 |
56 | Set verifystr "" | |
57 | ||
1e490350 JL |
58 | Set enable_options "" |
59 | Set disable_options "" | |
60 | ||
5db7ecb7 SS |
61 | # Parse arguments. |
62 | ||
63 | Loop | |
64 | Break If {#} == 0 | |
a2e72689 SS |
65 | If "{1}" =~ /--cc/ |
66 | Set host_cc "{2}" | |
67 | Shift 1 | |
1e490350 JL |
68 | Else If "{1}" =~ /--bindir/ |
69 | Set bindir "{2}" | |
4ac27a60 | 70 | Shift 1 |
1e490350 JL |
71 | Else If "{1}" =~ /--disable-?+/ |
72 | Set `Echo {1} | sed -e 's/--disable-/enable_/'` no | |
73 | Set disable_options "{disable_options} '{1}'" | |
74 | Else If "{1}" =~ /--enable-?+/ | |
75 | Set `Echo {1} | sed -e 's/--enable-/enable_/'` yes | |
76 | Set enable_options "{enable_options} '{1}'" | |
4ac27a60 SS |
77 | Else If "{1}" =~ /--exec-prefix/ |
78 | Set exec_prefix "{2}" | |
79 | Shift 1 | |
1e490350 JL |
80 | Else If "{1}" =~ /--help/ |
81 | Set helpoutput 1 | |
a2e72689 SS |
82 | Else If "{1}" =~ /--host/ |
83 | Set host_alias "{2}" | |
84 | Shift 1 | |
1e490350 JL |
85 | Else If "{1}" =~ /--norecursion/ |
86 | Set recurse 0 | |
a2e72689 | 87 | Else If "{1}" =~ /--prefix/ |
5db7ecb7 SS |
88 | Set prefix "{2}" |
89 | Shift 1 | |
90 | Else If "{1}" =~ /--srcdir/ | |
91 | Set srcdir "{2}" | |
92 | Shift 1 | |
93 | Else If "{1}" =~ /--srcroot/ | |
94 | Set srcroot "{2}" | |
95 | Shift 1 | |
96 | Else If "{1}" =~ /--target/ | |
a2e72689 | 97 | Set target_alias "{2}" |
5db7ecb7 SS |
98 | Shift 1 |
99 | Else If "{1}" =~ /-v/ | |
100 | Set verify 1 | |
101 | Set verifystr "-v" | |
4ac27a60 SS |
102 | Else If "{1}" =~ /--with-gnu-ld/ |
103 | Set with_gnu_ld 1 | |
5db7ecb7 | 104 | Else |
1e490350 JL |
105 | Echo -n 'mpw-configure: Unrecognized option: "' |
106 | Echo -n "{1}" | |
107 | Echo '"; use --help for usage.' | |
5db7ecb7 SS |
108 | Exit 1 |
109 | End If | |
110 | Shift 1 | |
111 | End Loop | |
112 | ||
1e490350 JL |
113 | If {helpoutput} == 1 |
114 | Echo "Usage: mpw-configure [OPTIONS]" | |
115 | Echo "" | |
116 | Echo "Options: [defaults in brackets]" | |
117 | Echo "--bindir DIR directory for binaries []" | |
118 | Echo "--cc CC use C compiler CC [mpwc]" | |
119 | Echo "--disable-FOO do not include feature FOO" | |
120 | Echo "--enable-FOO include feature FOO" | |
121 | Echo "--exec-prefix DIR install host-dependent files into DIR []" | |
122 | Echo "--help print this message" | |
123 | Echo "--host HOST configure for HOST [m68k-apple-mpw]" | |
124 | Echo "--norecursion configure this directory only [recurse]" | |
125 | Echo "--prefix DIR install into DIR [{MPW}:GNUTools:]" | |
126 | Echo "--srcdir DIR find the sources in DIR [:]" | |
127 | Echo "--srcroot DIR find the toplevel sources in DIR [:]" | |
128 | Echo "--target TARGET configure for TARGET [TARGET=HOST]" | |
129 | Echo "-v verbose" | |
130 | Echo "--with-gnu-ld link using GNU ld [no]" | |
131 | Exit 0 | |
132 | End If | |
133 | ||
5db7ecb7 SS |
134 | Set Exit 0 |
135 | ||
4ac27a60 | 136 | # Default exec_prefix from prefix. |
5db7ecb7 | 137 | |
4ac27a60 SS |
138 | If "{exec_prefix}" == "" |
139 | Set exec_prefix "{prefix}" | |
140 | End If | |
a2e72689 | 141 | |
1e490350 JL |
142 | If "{bindir}" == "" |
143 | Set bindir "{prefix}"bin: | |
144 | End If | |
145 | ||
a2e72689 SS |
146 | # Point to the correct set of tools to use with the chosen compiler. |
147 | ||
148 | If "{host_cc}" =~ /mpwc/ | |
4ac27a60 | 149 | Set host_alias "m68k-apple-mpw" |
a2e72689 | 150 | Set cc_name '{CC_MPW_C}' |
1e490350 | 151 | Set segment_flag '-s ' |
a2e72689 SS |
152 | Set ar_name '{AR_LIB}' |
153 | Set ranlib_name '{RANLIB_NULL}' | |
154 | Set cc_ld_name '{CC_LD_LINK}' | |
155 | Set prog_ext_name '{PROG_EXT_68K}' | |
156 | Set extralibs_name '{EXTRALIBS_C}' | |
157 | Set makepef_name '{MAKEPEF_NULL}' | |
158 | Set rez_name '{REZ_68K}' | |
159 | Else If "{host_cc}" =~ /sc68k/ | |
4ac27a60 | 160 | Set host_alias "m68k-apple-mpw" |
a2e72689 | 161 | Set cc_name '{CC_SC}' |
1e490350 | 162 | Set segment_flag '-s ' |
a2e72689 SS |
163 | Set ar_name '{AR_LIB}' |
164 | Set ranlib_name '{RANLIB_NULL}' | |
165 | Set cc_ld_name '{CC_LD_LINK}' | |
166 | Set prog_ext_name '{PROG_EXT_68K}' | |
167 | Set extralibs_name '{EXTRALIBS_C}' | |
168 | Set makepef_name '{MAKEPEF_NULL}' | |
169 | Set rez_name '{REZ_68K}' | |
170 | Else If "{host_cc}" =~ /mwc68k/ | |
4ac27a60 | 171 | Set host_alias "m68k-apple-mpw" |
a2e72689 | 172 | Set cc_name '{CC_MWC68K}' |
1e490350 | 173 | Set segment_flag '-s ' |
a2e72689 SS |
174 | Set ar_name '{AR_MWLINK68K}' |
175 | Set ranlib_name '{RANLIB_NULL}' | |
176 | Set cc_ld_name '{CC_LD_MWLINK68K}' | |
177 | Set prog_ext_name '{PROG_EXT_68K}' | |
1e490350 | 178 | Set extralibs_name '{EXTRALIBS_MWC68K}' |
a2e72689 | 179 | Set makepef_name '{MAKEPEF_NULL}' |
1e490350 | 180 | Set rez_name '{REZ_68K}' |
a2e72689 | 181 | Else If "{host_cc}" =~ /gcc68k/ |
4ac27a60 | 182 | Set host_alias "m68k-apple-mpw" |
a2e72689 | 183 | Set cc_name '{CC_68K_GCC}' |
1e490350 | 184 | Set segment_flag '-s ' |
a2e72689 SS |
185 | Set ar_name '{AR_68K_AR}' |
186 | Set ranlib_name '{RANLIB_RANLIB}' | |
187 | Set cc_ld_name '{CC_68K_GCC}' | |
188 | Set prog_ext_name '{PROG_EXT_68K}' | |
189 | Set extralibs_name '{EXTRALIBS_C}' | |
190 | Set makepef_name '{MAKEPEF_NULL}' | |
191 | Set rez_name '{REZ_68K}' | |
192 | Else If "{host_cc}" =~ /ppcc/ | |
4ac27a60 | 193 | Set host_alias "powerpc-apple-mpw" |
a2e72689 | 194 | Set cc_name '{CC_PPCC}' |
1e490350 | 195 | Set segment_flag '-d ___s_e_g___=' |
a2e72689 SS |
196 | Set ar_name '{AR_PPCLINK}' |
197 | Set ranlib_name '{RANLIB_NULL}' | |
198 | Set cc_ld_name '{CC_LD_PPCLINK}' | |
199 | Set prog_ext_name '{PROG_EXT_XCOFF}' | |
200 | Set extralibs_name '{EXTRALIBS_PPC}' | |
201 | Set makepef_name '{MAKEPEF_PPC}' | |
202 | Set rez_name '{REZ_PPC}' | |
203 | Else If "{host_cc}" =~ /mrc/ | |
4ac27a60 | 204 | Set host_alias "powerpc-apple-mpw" |
a2e72689 | 205 | Set cc_name '{CC_MRC}' |
1e490350 | 206 | Set segment_flag '-d ___s_e_g___=' |
a2e72689 SS |
207 | Set ar_name '{AR_PPCLINK}' |
208 | Set ranlib_name '{RANLIB_NULL}' | |
209 | Set cc_ld_name '{CC_LD_PPCLINK}' | |
210 | Set prog_ext_name '{PROG_EXT_XCOFF}' | |
211 | Set extralibs_name '{EXTRALIBS_PPC}' | |
212 | Set makepef_name '{MAKEPEF_PPC}' | |
213 | Set rez_name '{REZ_PPC}' | |
214 | Else If "{host_cc}" =~ /scppc/ | |
4ac27a60 | 215 | Set host_alias "powerpc-apple-mpw" |
a2e72689 | 216 | Set cc_name '{CC_SC}' |
1e490350 | 217 | Set segment_flag '-d ___s_e_g___=' |
a2e72689 SS |
218 | Set ar_name '{AR_PPCLINK}' |
219 | Set ranlib_name '{RANLIB_NULL}' | |
220 | Set cc_ld_name '{CC_LD_PPCLINK}' | |
221 | Set prog_ext_name '{PROG_EXT_XCOFF}' | |
222 | Set extralibs_name '{EXTRALIBS_PPC}' | |
223 | Set makepef_name '{MAKEPEF_PPC}' | |
224 | Set rez_name '{REZ_PPC}' | |
225 | Else If "{host_cc}" =~ /mwcppc/ | |
4ac27a60 | 226 | Set host_alias "powerpc-apple-mpw" |
a2e72689 | 227 | Set cc_name '{CC_MWCPPC}' |
1e490350 | 228 | Set segment_flag '-d ___s_e_g___=' |
a2e72689 SS |
229 | Set ar_name '{AR_MWLINKPPC}' |
230 | Set ranlib_name '{RANLIB_NULL}' | |
231 | Set cc_ld_name '{CC_LD_MWLINKPPC}' | |
232 | # Misleading, but we don't need a PEF step. | |
233 | Set prog_ext_name '{PROG_EXT_68K}' | |
234 | Set extralibs_name '{EXTRALIBS_MWCPPC}' | |
235 | Set makepef_name '{MAKEPEF_NULL}' | |
236 | Set rez_name '{REZ_PPC}' | |
237 | Else If "{host_cc}" =~ /gccppc/ | |
4ac27a60 | 238 | Set host_alias "powerpc-apple-mpw" |
a2e72689 | 239 | Set cc_name '{CC_PPC_GCC}' |
1e490350 | 240 | Set segment_flag '-d ___s_e_g___=' |
a2e72689 | 241 | Set ar_name '{AR_PPCLINK}' |
4ac27a60 | 242 | If {with_gnu_ld} == 1 |
1e490350 | 243 | Set ranlib_name '{RANLIB_RANLIB}' |
4ac27a60 SS |
244 | Set cc_ld_name '{CC_LD_GLD}' |
245 | Else | |
1e490350 | 246 | Set ranlib_name '{RANLIB_NULL}' |
4ac27a60 SS |
247 | Set cc_ld_name '{CC_LD_PPCLINK}' |
248 | End If | |
a2e72689 SS |
249 | Set prog_ext_name '{PROG_EXT_XCOFF}' |
250 | Set extralibs_name '{EXTRALIBS_PPC}' | |
251 | Set makepef_name '{MAKEPEF_PPC}' | |
252 | Set rez_name '{REZ_PPC}' | |
253 | Else | |
4ac27a60 | 254 | Echo "{host_cc}" is not a known MPW compiler type |
a2e72689 | 255 | End If |
68c2f070 | 256 | |
1e490350 JL |
257 | Set dash_c_flag '' |
258 | If "{host_cc}" =~ /gcc68k/ | |
259 | Set dash_c_flag '-c' | |
260 | Else If "{host_cc}" =~ /gccppc/ | |
261 | Set dash_c_flag '-c' | |
262 | End If | |
263 | ||
4ac27a60 SS |
264 | # (should interpret aliases if not in canonical form) |
265 | ||
266 | Set host_canonical "{host_alias}" | |
267 | ||
268 | Set target_canonical "{target_alias}" | |
269 | ||
5db7ecb7 SS |
270 | Set configdirs "" |
271 | ||
272 | If "{srcroot}" =~ /--------/ | |
273 | Set srcroot "{srcdir}" | |
274 | End If | |
275 | If "`Exists "{srcdir}"`" == "" | |
276 | Echo Source directory {srcdir} does not exist! | |
277 | Exit 1 | |
278 | End If | |
279 | If "`Exists "{srcroot}"`" == "" | |
280 | Echo Top-level source directory {srcroot} does not exist! | |
281 | Exit 1 | |
282 | End If | |
283 | ||
a2e72689 SS |
284 | Set target_cpu "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`" |
285 | Set target_vendor "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`" | |
286 | Set target_os "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`" | |
287 | ||
288 | # Create a file that is guaranteed to be older than any other here. | |
289 | ||
290 | If "`Exists "{objdir}"_oldest`" == "" | |
291 | mpw-touch _oldest | |
292 | End If | |
293 | ||
294 | # Record this before creating any files, makefiles sometimes mention | |
295 | # dependencies on config.status. | |
296 | ||
297 | Echo "# This directory was configured as follows:" >config.new | |
1e490350 | 298 | Echo "{ThisScript} --host {host_alias} --target {target_alias} --srcdir {srcdir} --srcroot {srcroot} --prefix {prefix} --cc {host_cc} {verifystr} {enable_options} {disable_options} --norecursion" >>config.new |
a2e72689 SS |
299 | MoveIfChange config.new config.status |
300 | ||
5db7ecb7 | 301 | If "`Exists "{srcdir}"mpw-config.in`" != "" |
a2e72689 SS |
302 | tr-7to8 "{srcdir}"mpw-config.in >"{objdir}"mpw-config.in |
303 | Execute "{objdir}"mpw-config.in | |
304 | End If | |
305 | ||
306 | # Start Makefile construction by defining all the variables chosen by | |
307 | # configuration. | |
308 | ||
309 | Echo "# This Makefile produced by mpw-configure. Changes may get lost!" > "{objdir}"Makefile.tem | |
310 | Echo "srcroot = " {srcroot} >> "{objdir}"Makefile.tem | |
311 | Echo "topsrcdir = " {srcroot} >> "{objdir}"Makefile.tem | |
312 | Echo "srcdir = " {srcdir} >> "{objdir}"Makefile.tem | |
313 | Echo "mpw_prefix = " {prefix} >> "{objdir}"Makefile.tem | |
4ac27a60 | 314 | Echo "mpw_exec_prefix = " {exec_prefix} >> "{objdir}"Makefile.tem |
1e490350 | 315 | Echo "mpw_bindir = " {bindir} >> "{objdir}"Makefile.tem |
a2e72689 SS |
316 | Echo "host_alias = " {host_alias} >> "{objdir}"Makefile.tem |
317 | Echo "target_alias = " {target_alias} >> "{objdir}"Makefile.tem | |
318 | Echo "target_cpu = " {target_cpu} >> "{objdir}"Makefile.tem | |
319 | Echo "target_vendor = " {target_vendor} >> "{objdir}"Makefile.tem | |
320 | Echo "target_os = " {target_os} >> "{objdir}"Makefile.tem | |
321 | Echo "target_canonical = " {target_canonical} >> "{objdir}"Makefile.tem | |
322 | Echo "host_makefile_frag = " >> "{objdir}"Makefile.tem | |
323 | Echo "target_makefile_frag = " >> "{objdir}"Makefile.tem | |
324 | Echo "CC = " {cc_name} >> "{objdir}"Makefile.tem | |
325 | Echo "AR = " {ar_name} >> "{objdir}"Makefile.tem | |
326 | Echo "RANLIB = " {ranlib_name} >> "{objdir}"Makefile.tem | |
327 | Echo "CC_LD = " {cc_ld_name} >> "{objdir}"Makefile.tem | |
328 | Echo "PROG_EXT = " {prog_ext_name} >> "{objdir}"Makefile.tem | |
329 | Echo "EXTRALIBS = " {extralibs_name} >> "{objdir}"Makefile.tem | |
330 | Echo "MAKEPEF = " {makepef_name} >> "{objdir}"Makefile.tem | |
331 | Echo "REZ = " {rez_name} >> "{objdir}"Makefile.tem | |
332 | ||
1e490350 JL |
333 | If {host_cc} =~ /gccppc/ |
334 | Echo -n "dq =\Option-d\Option-d\Option-d" > "{objdir}"Makefile.tem0 | |
335 | Echo '"' >> "{objdir}"Makefile.tem0 | |
336 | tr-7to8 "{objdir}"Makefile.tem0 >>"{objdir}"Makefile.tem | |
337 | Else | |
338 | Echo -n "dq ='" >> "{objdir}"Makefile.tem | |
339 | Echo -n '"' >> "{objdir}"Makefile.tem | |
340 | Echo "'" >> "{objdir}"Makefile.tem | |
341 | End If | |
342 | ||
a2e72689 SS |
343 | # Append the master set of definitions for the various compilers. |
344 | ||
345 | If "`Exists "{srcdir}"config:mpw-mh-mpw`" != "" | |
346 | tr-7to8 "{srcdir}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem | |
347 | Else If "`Exists "{srcroot}"config:mpw-mh-mpw`" != "" | |
348 | tr-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem | |
349 | Else | |
350 | Echo "can't find a host config file!" | |
351 | Exit 0 | |
5db7ecb7 | 352 | End If |
a2e72689 SS |
353 | |
354 | # Append anything produced by the directory's mpw-config.in. | |
355 | ||
356 | If "`Exists "{objdir}"mk.tmp`" != "" | |
357 | Catenate "{objdir}"mk.tmp >>"{objdir}"Makefile.tem | |
358 | # An mpw-config.in might change so as not to create this | |
359 | # anymore, so get rid of it now to be safe. | |
360 | Delete -i -y "{objdir}"mk.tmp | |
5db7ecb7 SS |
361 | End If |
362 | ||
4ac27a60 | 363 | # If there are sed scripts to edit the Unix Makefile.in, use them; otherwise |
a2e72689 SS |
364 | # use an mpw-make.in if present. |
365 | ||
366 | If "`Exists "{srcdir}"mpw-make.sed`" != "" | |
4ac27a60 SS |
367 | If "`Exists "{objdir}"hacked_Makefile.in`" != "" |
368 | Set MakefileIn "{objdir}"hacked_Makefile.in | |
369 | Else | |
370 | Set MakefileIn "{srcdir}"Makefile.in | |
371 | End If | |
1e490350 JL |
372 | # Find the generic makefile editing script. |
373 | If "`Exists "{srcroot}"config:mpw:g-mpw-make.sed`" != "" | |
374 | sed -f "{srcroot}"config:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 | |
375 | Else If "`Exists "{srcroot}"utils:mpw:g-mpw-make.sed`" != "" | |
4ac27a60 | 376 | sed -f "{srcroot}"utils:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 |
1e490350 JL |
377 | Else If "`Exists "{srcdir}"g-mpw-make.sed`" != "" |
378 | sed -f "{srcdir}"g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1 | |
4ac27a60 | 379 | Else |
1e490350 | 380 | Echo Warning: g-mpw-make.sed not found, copying "{MakefileIn}" verbatim... |
4ac27a60 SS |
381 | Catenate "{MakefileIn}" >"{objdir}"Makefile.tem1 |
382 | End If | |
a2e72689 | 383 | sed -f "{srcdir}"mpw-make.sed "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2 |
1e490350 JL |
384 | sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' -e 's/^exec_prefix = .*$/exec_prefix = {mpw_exec_prefix}/g' -e 's/^bindir = @bindir@/bindir = {mpw_bindir}/g' "{objdir}"Makefile.tem2 >"{objdir}"Makefile.tem3 |
385 | sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}\1/" "{objdir}"Makefile.tem3 >"{objdir}"mpw-make.in | |
a2e72689 | 386 | tr-7to8 "{objdir}"mpw-make.in >>"{objdir}"Makefile.tem |
1e490350 JL |
387 | If "`Exists "{objdir}"mk.sed`" != "" |
388 | sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2 | |
389 | Rename -y "{objdir}"Makefile.tem2 "{objdir}"Makefile.tem | |
390 | End If | |
a2e72689 SS |
391 | MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile |
392 | Delete -i -y "{objdir}"Makefile.tem[12] | |
393 | If {verify} == 1 | |
394 | Echo Created Makefile in "`Directory`" | |
68c2f070 | 395 | End If |
a2e72689 SS |
396 | Else If "`Exists "{srcdir}"mpw-make.in`" != "" |
397 | sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' "{srcdir}"mpw-make.in >"{objdir}"Makefile.tem1 | |
1e490350 | 398 | sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}}\1/" "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2 |
a2e72689 | 399 | tr-7to8 "{objdir}"Makefile.tem2 >>"{objdir}"Makefile.tem |
1e490350 JL |
400 | If "`Exists "{objdir}"mk.sed`" != "" |
401 | sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2 | |
402 | Rename -y "{objdir}"Makefile.tem2 "{objdir}"Makefile.tem | |
403 | End If | |
a2e72689 SS |
404 | MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile |
405 | Delete -i -y "{objdir}"Makefile.tem[12] | |
5db7ecb7 SS |
406 | If {verify} == 1 |
407 | Echo Created Makefile in "`Directory`" | |
408 | End If | |
409 | End If | |
410 | ||
a2e72689 SS |
411 | # Produce a build script if the source is defined. |
412 | ||
5db7ecb7 SS |
413 | If "`Exists "{srcdir}"mpw-build.in`" != "" |
414 | Echo "Set srcroot " {srcroot} > "{objdir}"mpw-build.tem | |
415 | Echo "Set srcdir " {srcdir} >> "{objdir}"mpw-build.tem | |
416 | Echo "Set target_canonical " {target_canonical} >> "{objdir}"mpw-build.tem | |
aa8f28af | 417 | Echo "Set prefix " {prefix} >> "{objdir}"mpw-build.tem |
a2e72689 | 418 | tr-7to8 "{srcdir}"mpw-build.in >>"{objdir}"mpw-build.tem |
5db7ecb7 SS |
419 | MoveIfChange "{objdir}"mpw-build.tem "{objdir}"mpw-build |
420 | If {verify} == 1 | |
421 | Echo Created mpw-build in "`Directory`" | |
422 | End If | |
423 | End If | |
424 | ||
1e490350 JL |
425 | # Apply ourselves recursively to the list of subdirectories to configure. |
426 | ||
427 | If {recurse} == 1 | |
428 | For subdir In {configdirs} | |
429 | Set savedir "`Directory`" | |
430 | If "`Exists "{srcdir}{subdir}:"`" == "" | |
431 | If {verify} == 1 | |
432 | Echo No "{srcdir}{subdir}:" found, skipping | |
433 | End If | |
434 | Continue | |
435 | End If | |
436 | If {verify} == 1 | |
437 | Echo Configuring {subdir}... | |
438 | End If | |
439 | If "`Exists "{objdir}{subdir}:"`" == "" | |
440 | NewFolder "{objdir}{subdir}" | |
441 | End If | |
442 | SetDirectory "{objdir}{subdir}:" | |
443 | "{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" --cc "{host_cc}" {verifystr} {enable_options} {disable_options} | |
444 | SetDirectory "{savedir}" | |
445 | End For | |
446 | End If | |
5db7ecb7 | 447 | |
5db7ecb7 | 448 | SetDirectory "{savedir}" |