1994-01-15 21:46:29 +01:00
|
|
|
# Configuration script
|
|
|
|
|
|
|
|
### This script (and its config.in fragments) must NOT use any 8-bit chars!
|
|
|
|
|
|
|
|
Set savedir "`Directory`"
|
|
|
|
|
|
|
|
#Set Echo 1
|
|
|
|
|
1994-02-28 01:15:29 +01:00
|
|
|
Set ThisScript "{0}"
|
1994-01-15 21:46:29 +01:00
|
|
|
|
|
|
|
Set srcroot "--------"
|
|
|
|
|
|
|
|
Set srcdir ":"
|
|
|
|
|
|
|
|
Set objdir ":"
|
|
|
|
|
1994-02-28 01:15:29 +01:00
|
|
|
Set prefix ":"
|
|
|
|
|
1994-01-15 21:46:29 +01:00
|
|
|
Set hostalias "m68k-apple-mpw"
|
|
|
|
|
|
|
|
Set targetalias {hostalias}
|
|
|
|
|
1994-02-28 01:15:29 +01:00
|
|
|
Set prefix "{Boot}"Cygnus:latest:
|
|
|
|
|
1994-01-15 21:46:29 +01:00
|
|
|
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}"
|
|
|
|
|
1994-03-18 00:02:58 +01:00
|
|
|
Set target_cpu "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`"
|
|
|
|
Set target_vendor "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`"
|
|
|
|
Set target_os "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`"
|
|
|
|
|
1994-01-15 21:46:29 +01:00
|
|
|
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`" != ""
|
1994-01-22 22:28:29 +01:00
|
|
|
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
|
1994-01-15 21:46:29 +01:00
|
|
|
Echo "srcdir = " {srcdir} >> "{objdir}"Makefile.tem
|
1994-02-28 01:15:29 +01:00
|
|
|
Echo "mpw_prefix = " {prefix} >> "{objdir}"Makefile.tem
|
1994-01-15 21:46:29 +01:00
|
|
|
Echo "target_canonical = " {target_canonical} >> "{objdir}"Makefile.tem
|
1994-03-18 00:02:58 +01:00
|
|
|
# gcc definitions.
|
|
|
|
If "{mdname}" != ""
|
|
|
|
Echo "mdname = " {mdname} >> "{objdir}"Makefile.tem
|
|
|
|
End If
|
|
|
|
If "{maybe_target_default}" != ""
|
|
|
|
Echo "MAYBE_TARGET_DEFAULT = " {maybe_target_default} >> "{objdir}"Makefile.tem
|
|
|
|
End If
|
|
|
|
# binutils definitions.
|
1994-02-28 01:15:29 +01:00
|
|
|
Echo "ARCHDEFS = -d" {archname} >> "{objdir}"Makefile.tem
|
1994-03-18 00:02:58 +01:00
|
|
|
# ld definitions.
|
|
|
|
Echo "EMUL = " {emulname} >> "{objdir}"Makefile.tem
|
|
|
|
# gdb definitions.
|
1994-02-28 01:15:29 +01:00
|
|
|
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
|
1994-03-18 00:02:58 +01:00
|
|
|
If "{natdepfiles}" != ""
|
|
|
|
Echo "NATDEPFILES = " {nat_file} >> "{objdir}"Makefile.tem
|
|
|
|
End If
|
1994-02-28 01:15:29 +01:00
|
|
|
If "{nat_file}" != ""
|
|
|
|
Echo "NAT_FILE = " {nat_file} >> "{objdir}"Makefile.tem
|
|
|
|
End If
|
1994-01-22 22:28:29 +01:00
|
|
|
Echo "host_makefile_frag = " >> "{objdir}"Makefile.tem
|
|
|
|
Echo "target_makefile_frag = " >> "{objdir}"Makefile.tem
|
1994-03-18 00:02:58 +01:00
|
|
|
If "`Exists "{srcroot}"config:mpw-mh-mpw`" != ""
|
|
|
|
mpw-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem
|
|
|
|
Else If "`Exists "{srcroot}":config:mpw-mh-mpw`" != ""
|
|
|
|
mpw-7to8 "{srcroot}":config:mpw-mh-mpw >>"{objdir}"Makefile.tem
|
|
|
|
Else
|
|
|
|
Echo "can't find a host config file!"
|
|
|
|
Exit 0
|
|
|
|
End If
|
1994-01-15 21:46:29 +01:00
|
|
|
mpw-7to8 "{srcdir}"mpw-make.in >>"{objdir}"Makefile.tem
|
1994-02-28 01:15:29 +01:00
|
|
|
mpw-edit-prefix "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2
|
1994-03-18 00:02:58 +01:00
|
|
|
Delete -i -y "{objdir}"Makefile.tem
|
1994-02-28 01:15:29 +01:00
|
|
|
MoveIfChange "{objdir}"Makefile.tem2 "{objdir}"Makefile
|
1994-01-15 21:46:29 +01:00
|
|
|
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
|
1994-02-28 01:15:29 +01:00
|
|
|
Echo "Set prefix " {prefix} >> "{objdir}"mpw-build.tem
|
1994-01-15 21:46:29 +01:00
|
|
|
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
|
1994-02-28 01:15:29 +01:00
|
|
|
Else
|
|
|
|
Echo '::mpw-build {1}' >"{objdir}"mpw-build
|
1994-01-15 21:46:29 +01:00
|
|
|
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}:"
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" {verifystr}
|
1994-01-15 21:46:29 +01:00
|
|
|
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}"
|