blob: 04c5aac2a4f45ea62d9df04c5df802a3129dbf21 [file] [log] [blame]
Richard Henderson252b5131999-05-03 07:29:111# GNU Install script for MPW.
2
3Set OldExit "{Exit}"
4Set Exit 0
5
6Set TempUserStartup "{TempFolder}"__temp__UserStartup
7
8Echo '# UserStartup generated by GNU Install script' > "{TempUserStartup}"
9Echo ''>> "{TempUserStartup}"
10
11# (should) Check that disk space is sufficient for installation.
12
13# Assume that the install script is where everything else is.
14
15Set thisdir "`Directory`"
16
17# Copy the binaries to the desired place.
18
19Confirm -t "Copy the binaries to somewhere else?"
20Set TmpStatus {Status}
21If {TmpStatus} == 0
22Set bindest "`GetFileName -d -m "Where to install the binaries?"`"
23If {Status} == 0
24If "`Exists "{thisdir}bin"`" != ""
25For afile In "{thisdir}"bin:\Option-x
26Duplicate -y "{afile}" "{bindest}"
27End For
28Else
29Echo "bin directory not found, exiting"
30Exit 1
31End If
32Else
33Echo "No destination supplied, exiting"
34Exit 1
35End If
36Else If {TmpStatus} == 4
37# Use the existing directory.
38Set bindest "{thisdir}bin:"
39Else
40# Cancelled from confirmation, escape altogether.
41Exit 1
42End If
43
44# Copy the libraries to the desired place.
45
46Confirm -t "Copy the libraries to somewhere else?"
47Set TmpStatus {Status}
48If {TmpStatus} == 0
49Set libdest "`GetFileName -d -m "Where to install the libraries?"`"
50If {Status} == 0
51If "`Exists "{thisdir}lib:"`" != ""
52For afile In "{thisdir}"lib:\Option-x
53Duplicate -y "{afile}" "{libdest}"
54End For
55Else
56Echo "lib directory not found, exiting"
57Exit 1
58End If
59Else
60Echo "No destination supplied, exiting"
61Exit 1
62End If
63Else If {TmpStatus} == 4
64# Use the existing directory.
65Set libdest "{thisdir}lib:"
66Else
67# Cancelled from confirmation, escape altogether.
68Exit 1
69End If
70
71
72# Add the location of the binaries to the command path.
73
74Echo -n 'Set Commands "'>> "{TempUserStartup}"
75Echo -n "{bindest}">> "{TempUserStartup}"
76Echo ',{Commands}"'>> "{TempUserStartup}"
77Echo ''>> "{TempUserStartup}"
78
79# Set up GCC exec prefix.
80
81Set gcclibdir "{libdest}"gcc-lib:
82
83Echo -n 'Set GCC_EXEC_PREFIX "'>> "{TempUserStartup}"
84Echo -n "{gcclibdir}">> "{TempUserStartup}"
85Echo '"'>> "{TempUserStartup}"
86Echo "Export GCC_EXEC_PREFIX">> "{TempUserStartup}"
87Echo ''>> "{TempUserStartup}"
88
89# Set up path to libgcc.xcoff etc.
90
91Echo -n 'Set GCCPPCLibraries "'>> "{TempUserStartup}"
92Echo -n "{libdest}">> "{TempUserStartup}"
93Echo '"'>> "{TempUserStartup}"
94Echo "Export GCCPPCLibraries">> "{TempUserStartup}"
95Echo ''>> "{TempUserStartup}"
96
97# Display contents of UserStartup, confirm installation.
98
99Set UserStartupName "UserStartup\Option-8GNU"
100
101Echo "Contents of" {UserStartupName} "will be:"
102Catenate "{TempUserStartup}"
103
104Confirm "Install {UserStartupName} into the MPW folder {MPW} ?"
105If {Status} == 0
106Duplicate "{TempUserStartup}" "{MPW}{UserStartupName}"
107Delete -y "{TempUserStartup}"
108Else
109Echo "{UserStartupName} file not installed"
110End If
111
112# (should) Check HEXA resource, warn if low.
113
114# (should) Check for spaces in pathnames, warn if found.
115
116Echo "Installation was successful."
117Echo ""
118Echo "Be sure to review the usage notes in 'Read Me for MPW' before proceeding!"
119
120# Restore previous settings.
121
122Set Exit "{OldExit}"