aboutsummaryrefslogtreecommitdiff
path: root/mpw-configure
blob: ddac26e65cda9912b1d50ae34bd016c1f38e25c4 (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
# Configuration script

### This script (and its config.in fragments) must NOT use any 8-bit chars!

Set savedir "`Directory`"

#Set Echo 1

Set ThisScript "{0}"

Set srcroot "--------"

Set srcdir ":"

Set objdir ":"

Set prefix ":"

Set hostalias "m68k-apple-mpw"

Set targetalias {hostalias}

Set prefix "{Boot}"Cygnus:latest:

Set verify 0
Set verifystr ""

# Parse arguments.

Loop
	Break If {#} == 0
	If "{1}" =~ /--prefix/
		Set prefix "{2}"
		Shift 1
	Else If "{1}" =~ /--srcdir/
		Set srcdir "{2}"
		Shift 1
	Else If "{1}" =~ /--srcroot/
		Set srcroot "{2}"
		Shift 1
	Else If "{1}" =~ /--target/
		Set targetalias "{2}"
		Shift 1
	Else If "{1}" =~ /-v/
		Set verify 1
		Set verifystr "-v"
		Shift 1
	Else
		Echo "{1}" is not a valid argument
		Exit 1
	End If
	Shift 1
End Loop

Set Exit 0

# (should interpret aliases if not in canonical form)

Set target_canonical "{targetalias}"

Set configdirs ""

If "{srcroot}" =~ /--------/
	Set srcroot "{srcdir}"
End If
If "`Exists "{srcdir}"`" == ""
	Echo Source directory {srcdir} does not exist!
	Exit 1
End If
If "`Exists "{srcroot}"`" == ""
	Echo Top-level source directory {srcroot} does not exist!
	Exit 1
End If

If "`Exists "{srcdir}"mpw-config.in`" != ""
	Execute "{srcdir}"mpw-config.in
End If
If "`Exists "{srcdir}"mpw-xconfig.in`" != ""
	Execute "{srcdir}"mpw-xconfig.in
End If

If "`Exists "{srcdir}"mpw-make.in`" != ""
	Echo "# This Makefile produced by mpw-configure.  Changes may get lost!" > "{objdir}"Makefile.tem
	Echo "srcroot = " {srcroot} >> "{objdir}"Makefile.tem
	Echo "topsrcdir = " {srcroot} >> "{objdir}"Makefile.tem
	Echo "srcdir = " {srcdir} >> "{objdir}"Makefile.tem
	Echo "mpw_prefix = " {prefix} >> "{objdir}"Makefile.tem
	Echo "target_canonical = " {target_canonical} >> "{objdir}"Makefile.tem
	Echo "mdname = " {mdname} >> "{objdir}"Makefile.tem
	Echo "EMUL = " {emulname} >> "{objdir}"Makefile.tem
	Echo "ARCHDEFS = -d" {archname} >> "{objdir}"Makefile.tem
	If "{tdepfiles}" != ""
		Echo "TDEPFILES = " {tdepfiles} >> "{objdir}"Makefile.tem
	End If
	If "{tm_file}" != ""
		Echo "TM_FILE = " {tm_file} >> "{objdir}"Makefile.tem
	End If
	If "{xdepfiles}" != ""
		Echo "XDEPFILES = " {xdepfiles} >> "{objdir}"Makefile.tem
	End If
	If "{xm_file}" != ""
		Echo "XM_FILE = " {xm_file} >> "{objdir}"Makefile.tem
	End If
	If "{nat_file}" != ""
		Echo "NAT_FILE = " {nat_file} >> "{objdir}"Makefile.tem
	End If
	Echo "host_makefile_frag = " >> "{objdir}"Makefile.tem
	Echo "target_makefile_frag = " >> "{objdir}"Makefile.tem
	mpw-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem
	mpw-7to8 "{srcdir}"mpw-make.in >>"{objdir}"Makefile.tem
	mpw-edit-prefix "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2
	MoveIfChange "{objdir}"Makefile.tem2 "{objdir}"Makefile
	If {verify} == 1
		Echo Created Makefile in "`Directory`"
	End If
End If

If "`Exists "{srcdir}"mpw-build.in`" != ""
	Echo "Set srcroot " {srcroot} > "{objdir}"mpw-build.tem
	Echo "Set srcdir " {srcdir} >> "{objdir}"mpw-build.tem
	Echo "Set target_canonical " {target_canonical} >> "{objdir}"mpw-build.tem
	Echo "Set prefix " {prefix} >> "{objdir}"mpw-build.tem
	mpw-7to8 "{srcdir}"mpw-build.in >>"{objdir}"mpw-build.tem
	MoveIfChange "{objdir}"mpw-build.tem "{objdir}"mpw-build
	If {verify} == 1
		Echo Created mpw-build in "`Directory`"
	End If
Else
	Echo '::mpw-build {1}' >"{objdir}"mpw-build
End If

For subdir In {configdirs}
	Set savedir "`Directory`"
	If "`Exists "{srcdir}{subdir}:"`" == ""
		Echo Strange, no {subdir} in {srcdir}
		Continue
	End If
	If {verify} == 1
		Echo Configuring {subdir}...
	End If
	If "`Exists "{objdir}{subdir}:"`" == ""
		NewFolder "{objdir}{subdir}"
	End If
	SetDirectory "{objdir}{subdir}:"
	"{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" {verifystr}
	SetDirectory "{savedir}"
End For

Echo "# This directory was configured as follows:" >config.status
Echo "mpw-configure --host {hostalias} --target {targetalias} --srcdir {srcdir}" >>config.status

SetDirectory "{savedir}"