removed rcs cruft
[deliverable/binutils-gdb.git] / mpw-configure
CommitLineData
5db7ecb7
SS
1# Configuration script
2
3### This script (and its config.in fragments) must NOT use any 8-bit chars!
4
5Set savedir "`Directory`"
6
7#Set Echo 1
8
9Set thisscript "{0}"
10
11Set srcroot "--------"
12
13Set srcdir ":"
14
15Set objdir ":"
16
17Set hostalias "m68k-apple-mpw"
18
19Set targetalias {hostalias}
20
21Set verify 0
22Set verifystr ""
23
24# Parse arguments.
25
26Loop
27 Break If {#} == 0
28 If "{1}" =~ /--prefix/
29 Set prefix "{2}"
30 Shift 1
31 Else If "{1}" =~ /--srcdir/
32 Set srcdir "{2}"
33 Shift 1
34 Else If "{1}" =~ /--srcroot/
35 Set srcroot "{2}"
36 Shift 1
37 Else If "{1}" =~ /--target/
38 Set targetalias "{2}"
39 Shift 1
40 Else If "{1}" =~ /-v/
41 Set verify 1
42 Set verifystr "-v"
43 Shift 1
44 Else
45 Echo "{1}" is not a valid argument
46 Exit 1
47 End If
48 Shift 1
49End Loop
50
51Set Exit 0
52
53# (should interpret aliases if not in canonical form)
54
55Set target_canonical "{targetalias}"
56
57Set configdirs ""
58
59If "{srcroot}" =~ /--------/
60 Set srcroot "{srcdir}"
61End If
62If "`Exists "{srcdir}"`" == ""
63 Echo Source directory {srcdir} does not exist!
64 Exit 1
65End If
66If "`Exists "{srcroot}"`" == ""
67 Echo Top-level source directory {srcroot} does not exist!
68 Exit 1
69End If
70
71If "`Exists "{srcdir}"mpw-config.in`" != ""
72 Execute "{srcdir}"mpw-config.in
73End If
74If "`Exists "{srcdir}"mpw-xconfig.in`" != ""
75 Execute "{srcdir}"mpw-xconfig.in
76End If
77
78If "`Exists "{srcdir}"mpw-make.in`" != ""
498d098a
SS
79 Echo "# This Makefile produced by mpw-configure. Changes may get lost!" > "{objdir}"Makefile.tem
80 Echo "srcroot = " {srcroot} >> "{objdir}"Makefile.tem
81 Echo "topsrcdir = " {srcroot} >> "{objdir}"Makefile.tem
5db7ecb7
SS
82 Echo "srcdir = " {srcdir} >> "{objdir}"Makefile.tem
83 Echo "target_canonical = " {target_canonical} >> "{objdir}"Makefile.tem
84 Echo "mdname = " {mdname} >> "{objdir}"Makefile.tem
498d098a
SS
85 Echo "host_makefile_frag = " >> "{objdir}"Makefile.tem
86 Echo "target_makefile_frag = " >> "{objdir}"Makefile.tem
87 mpw-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem
5db7ecb7
SS
88 mpw-7to8 "{srcdir}"mpw-make.in >>"{objdir}"Makefile.tem
89 MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile
90 If {verify} == 1
91 Echo Created Makefile in "`Directory`"
92 End If
93End If
94
95If "`Exists "{srcdir}"mpw-build.in`" != ""
96 Echo "Set srcroot " {srcroot} > "{objdir}"mpw-build.tem
97 Echo "Set srcdir " {srcdir} >> "{objdir}"mpw-build.tem
98 Echo "Set target_canonical " {target_canonical} >> "{objdir}"mpw-build.tem
99 mpw-7to8 "{srcdir}"mpw-build.in >>"{objdir}"mpw-build.tem
100 MoveIfChange "{objdir}"mpw-build.tem "{objdir}"mpw-build
101 If {verify} == 1
102 Echo Created mpw-build in "`Directory`"
103 End If
104End If
105
106For subdir In {configdirs}
107 Set savedir "`Directory`"
108 If "`Exists "{srcdir}{subdir}:"`" == ""
109 Echo Strange, no {subdir} in {srcdir}
110 Continue
111 End If
112 If {verify} == 1
113 Echo Configuring {subdir}...
114 End If
115 If "`Exists "{objdir}{subdir}:"`" == ""
116 NewFolder "{objdir}{subdir}"
117 End If
118 SetDirectory "{objdir}{subdir}:"
119 "{thisscript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" {verifystr}
120 SetDirectory "{savedir}"
121End For
122
123Echo "# This directory was configured as follows:" >config.status
124Echo "mpw-configure --host {hostalias} --target {targetalias} --srcdir {srcdir}" >>config.status
125
126SetDirectory "{savedir}"
This page took 0.027833 seconds and 4 git commands to generate.